34 lines
1.1 KiB
Makefile
34 lines
1.1 KiB
Makefile
define INC_DOCKER =
|
|
1
|
|
endef
|
|
$(info Defined INC_DOCKER)
|
|
|
|
include /devel/docker/docker_vars.sh
|
|
export
|
|
|
|
${docker_src}/built/%.sentinel: ${docker_src}/%.dockerfile
|
|
grep -e '^FROM' $< | awk '{print $$2}' \
|
|
| tr : _ | xargs -I{} $(MAKE) ${docker_src}/built/{}.sentinel;
|
|
cd ${docker_src}; docker build -f $< --tag $* .;
|
|
touch $@;
|
|
|
|
${docker_src}/built/debian_10.sentinel:
|
|
docker pull "debian:10" && touch $@;
|
|
|
|
${docker_src}/built/openwrt-builder-%.sentinel: \
|
|
${docker_src}/openwrt-builder-commit.dockerfile \
|
|
${docker_src}/built/openwrt-builder.sentinel \
|
|
${docker_src}/openwrt-remotes.txt
|
|
cd ${docker_src}; \
|
|
rev=$*; \
|
|
if [ "$$rev" != "$${rev%_*}" ]; then \
|
|
remote=$(shell echo $* | cut -d_ -f1); \
|
|
commit=$(shell echo $* | cut -d_ -f2); \
|
|
remoteurl=$(shell echo $* | cut -d_ -f1 | xargs -I{} grep -e "^{}" ${docker_src}/openwrt-remotes.txt | cut -d ' ' -f2); \
|
|
docker build -f $< --build-arg=remote="$$remote" --build-arg=commit="$$commit" --build-arg=remoteurl="$$remoteurl" --tag openwrt-builder-$* .; \
|
|
else \
|
|
commit=$(shell echo $*); \
|
|
docker build -f $< --build-arg=commit="$$commit" --tag openwrt-builder-$* . ; \
|
|
fi; \
|
|
touch $@;
|