forked from MustardOS/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·37 lines (29 loc) · 1.26 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
MODULES := muxapp muxarchive muxassign muxcharge muxconfig muxcredits muxgov muxinfo \
muxlanguage muxlaunch muxnetprofile muxnetscan muxnetwork muxoption muxpass \
muxpower muxplore muxrtc muxsplash muxstart muxstorage muxsysinfo muxtask \
muxtester muxtheme muxtimezone muxtweakadv muxtweakgen muxvisual muxwebserv \
muhotkey
BUILD_TOTAL := $(words $(MODULES))
BUILD_FILE := .build_count
DEVICE ?= $(error DEVICE not specified)
.PHONY: all $(MODULES) clean notify build
MAKEFLAGS += --no-print-directory
all: info clean $(MODULES) notify
info:
$(info ======== muOS Frontend Builder ========)
$(info Targeting: $(DEVICE))
$(info Modules: $(MODULES))
clean:
@rm -rf bin/mu* .build_count
$(MODULES):
@if [ -f "$@/Makefile" ]; then \
MAKE_JOBS=$$(nproc); \
$(MAKE) -j$$MAKE_JOBS -C $@ DEVICE=$(DEVICE) && \
BUILD_COUNT=$$(cat $(BUILD_FILE) 2>/dev/null || echo 0); \
echo $$((BUILD_COUNT + 1)) > $(BUILD_FILE); \
fi
notify:
@BUILD_COUNT=$$(cat $(BUILD_FILE) 2>/dev/null || echo 0); \
printf "Compiled $$BUILD_COUNT of $(BUILD_TOTAL) Modules\n============== Complete! ==============\a\n"; \
notify-send "muOS Frontend Builder" "Compiled $$BUILD_COUNT of $(BUILD_TOTAL) Modules" 2>/dev/null || true
@rm -rf $(BUILD_FILE)