-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SHELL := /bin/bash
APP_ID := com.github.avojak.foreman
FLATPAK_REMOTE_URL := https://flatpak.elementary.io/repo.flatpakrepo
FLATPAK_REMOTE_NAME := appcenter
PLATFORM_VERSION := 7
BUILD_DIR := build
NINJA_BUILD_FILE := $(BUILD_DIR)/build.ninja
FLATPAK_BUILDER_FLAGS := --user --install --force-clean
ifdef OFFLINE_BUILD
FLATPAK_BUILDER_FLAGS += --disable-download
endif
# Check for executables which are assumed to already be present on the system
EXECUTABLES = flatpak flatpak-builder
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
.DEFAULT_GOAL := flatpak
.PHONY: all
all: translations flatpak
.PHONY: flatpak-init
flatpak-init:
flatpak remote-add --if-not-exists --system $(FLATPAK_REMOTE_NAME) $(FLATPAK_REMOTE_URL)
flatpak install -y --user $(FLATPAK_REMOTE_NAME) io.elementary.Platform//$(PLATFORM_VERSION)
flatpak install -y --user $(FLATPAK_REMOTE_NAME) io.elementary.Sdk//$(PLATFORM_VERSION)
.PHONY: init
init: flatpak-init
.PHONY: flatpak
flatpak:
flatpak-builder build $(APP_ID).yml $(FLATPAK_BUILDER_FLAGS)
.PHONY: lint
lint:
io.elementary.vala-lint ./src
$(NINJA_BUILD_FILE):
meson build --prefix=/user
.PHONY: translations
translations: $(NINJA_BUILD_FILE)
ninja -C build $(APP_ID)-pot
ninja -C build $(APP_ID)-update-po
.PHONY: clean
clean:
rm -rf ./.flatpak/
rm -rf ./.flatpak-builder/
rm -rf ./build/
rm -rf ./builddir/