2023-05-25 05:39:51 +02:00
|
|
|
MAKEFILES := sysmod overlay
|
|
|
|
TARGETS := $(foreach dir,$(MAKEFILES),$(CURDIR)/$(dir))
|
2023-05-20 21:52:47 +02:00
|
|
|
|
2023-05-25 18:05:10 +02:00
|
|
|
# the below was taken from atmosphere + switch-examples makefile
|
|
|
|
export VERSION := 1.3.0
|
|
|
|
export GIT_BRANCH := $(shell git symbolic-ref --short HEAD)
|
|
|
|
|
|
|
|
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
|
|
|
|
export GIT_REVISION := $(GIT_BRANCH)-$(shell git rev-parse --short HEAD)
|
|
|
|
export VERSION_DIRTY := $(VERSION)
|
|
|
|
export VERSION_WITH_HASH := $(VERSION)-$(shell git rev-parse --short HEAD)
|
|
|
|
else
|
|
|
|
export GIT_REVISION := $(GIT_BRANCH)-$(shell git rev-parse --short HEAD)-dirty
|
|
|
|
export VERSION_DIRTY := $(VERSION)-dirty
|
|
|
|
export VERSION_WITH_HASH := $(VERSION)-$(shell git rev-parse --short HEAD)-dirty
|
|
|
|
endif
|
|
|
|
|
|
|
|
export BUILD_DATE := -DDATE_YEAR=\"$(shell date +%Y)\" \
|
|
|
|
-DDATE_MONTH=\"$(shell date +%m)\" \
|
|
|
|
-DDATE_DAY=\"$(shell date +%d)\" \
|
|
|
|
-DDATE_HOUR=\"$(shell date +%H)\" \
|
|
|
|
-DDATE_MIN=\"$(shell date +%M)\" \
|
|
|
|
-DDATE_SEC=\"$(shell date +%S)\" \
|
|
|
|
|
|
|
|
export CUSTOM_DEFINES := -DVERSION=\"v$(VERSION)\" \
|
|
|
|
-DGIT_BRANCH=\"$(GIT_BRANCH)\" \
|
|
|
|
-DGIT_REVISION=\"$(GIT_REVISION)\" \
|
|
|
|
-DVERSION_DIRTY=\"$(VERSION_DIRTY)\" \
|
|
|
|
-DVERSION_WITH_HASH=\"$(VERSION_WITH_HASH)\" \
|
|
|
|
$(BUILD_DATE)
|
|
|
|
|
2023-05-25 05:39:51 +02:00
|
|
|
all: $(TARGETS)
|
|
|
|
@mkdir -p out/
|
|
|
|
@cp -R sysmod/out/* out/
|
|
|
|
@cp -R overlay/out/* out/
|
2023-05-20 21:52:47 +02:00
|
|
|
|
2023-05-25 05:39:51 +02:00
|
|
|
.PHONY: $(TARGETS)
|
2023-05-20 21:52:47 +02:00
|
|
|
|
2023-05-25 05:39:51 +02:00
|
|
|
$(TARGETS):
|
|
|
|
@$(MAKE) -C $@
|
2023-05-20 21:52:47 +02:00
|
|
|
|
|
|
|
clean:
|
2023-05-25 05:39:51 +02:00
|
|
|
@rm -rf out
|
|
|
|
@for i in $(TARGETS); do $(MAKE) -C $$i clean || exit 1; done;
|
|
|
|
|
2023-05-20 21:52:47 +02:00
|
|
|
dist: all
|
2023-05-25 05:39:51 +02:00
|
|
|
@for i in $(TARGETS); do $(MAKE) -C $$i dist || exit 1; done;
|
2023-05-20 21:52:47 +02:00
|
|
|
@echo making dist ...
|
|
|
|
|
2023-05-20 21:58:07 +02:00
|
|
|
@rm -f sys-patch.zip
|
2023-05-20 21:52:47 +02:00
|
|
|
@cd out; zip -r ../sys-patch.zip ./*; cd ../
|