android-custom/Makefile

35 lines
1 KiB
Makefile
Raw Normal View History

2015-05-19 16:32:39 +02:00
PRIVKEY = tools/testkey.pk8
PUBKEY = tools/testkey.x509.pem
2017-07-12 11:24:32 +02:00
ZIPS_DIRS = $(wildcard dist-*)
2021-06-17 21:42:10 +02:00
FILES_COMMON_ZIP = $(shell find META-INF -type f)
FILES_COMMON = $(FILES_COMMON_ZIP) $(wildcard common/*)
2015-05-19 16:32:39 +02:00
.SECONDEXPANSION:
2017-07-12 11:24:32 +02:00
.PHONY: $(ZIPS_DIRS:dist-%=clean-%)
2015-05-19 16:32:39 +02:00
#all: $(ZIPS_DIRS:dist-%=cm-custom-%-signed.zip)
all: $(ZIPS_DIRS:dist-%=cm-custom-%.zip)
2015-05-19 16:32:39 +02:00
2017-07-12 11:24:32 +02:00
clean: $(ZIPS_DIRS:dist-%=clean-%)
2015-05-19 16:32:39 +02:00
2017-07-12 11:24:32 +02:00
# clean targets
$(ZIPS_DIRS:dist-%=clean-%):
2021-06-17 17:59:25 +02:00
rm -rf $(@:clean-%=build-%) $(@:clean-%=cm-custom-%.zip) $(@:clean-%=cm-custom-%-signed.zip)
2017-06-30 10:19:51 +02:00
2017-07-12 11:24:32 +02:00
# signature targets
$(ZIPS_DIRS:dist-%=cm-custom-%-signed.zip): cm-custom-%-signed.zip : cm-custom-%.zip
java -jar tools/SignApk.jar -w -a 4 $(PUBKEY) $(PRIVKEY) $< $@
@echo "$@ is ready"
2015-05-19 16:32:39 +02:00
2017-07-12 11:24:32 +02:00
# build target
$(ZIPS_DIRS:dist-%=cm-custom-%.zip): cm-custom-%.zip : $(FILES_COMMON) $$(shell find dist-$$* -type f)
2021-06-17 21:42:10 +02:00
zip $@ $(FILES_COMMON_ZIP)
2021-06-17 17:59:25 +02:00
rm -rf build-$*
cp -a dist-$* build-$*
cd build-$* && \
2021-06-17 21:38:28 +02:00
sed -e '/__HEADER__/ {' -e 'r ../common/addon_head' -e 'd' -e '}' -i cm-data/*.addon && \
zip ../$@ $$(find . -type f)
2021-06-17 17:59:25 +02:00
rm -rf build-$*
2017-06-30 09:48:30 +02:00