pkg(Makefile): package entire directory

This commit is contained in:
Thomas Hobson 2021-03-06 19:29:28 +13:00
parent dc7f0ed86c
commit 905ed435fd
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
1 changed files with 3 additions and 10 deletions

View File

@ -8,22 +8,15 @@ help:
@echo "Run $`make [language]-[version].pkg.tar.gz$` to build a specific language"
build build-all: $(addsuffix .pkg.tar.gz, ${PACKAGES})
clean clean-all: $(addprefix clean-, ${PACKAGES})
clean-%: %/
rm -rf $</build $</output
%.pkg.tar.gz: %/output %/run %/environment %/pkg-info.json
%.pkg.tar.gz: %/ %/pkg-info.json
cd $< && chmod +x ./build.sh && ./build.sh
rm -f $@
tar czf $@ -C $* $(patsubst $*/%,%,output run environment pkg-info.json $(shell find $*/compile)) --transform='s|output|$*|;s|environment|$*/environment|'
tar czf $@ $* --transform='s|$*||'
%/pkg-info.json: %/metadata.json
jq '.build_platform="${BUILD_PLATFORM}"' $< > $@
%/output: %/ %/build.sh
cd $< && chmod +x ./build.sh && ./build.sh