summaryrefslogtreecommitdiffstats
path: root/scripts/crossbuild/crossbuild.mk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scripts/crossbuild/crossbuild.mk28
1 files changed, 25 insertions, 3 deletions
diff --git a/scripts/crossbuild/crossbuild.mk b/scripts/crossbuild/crossbuild.mk
index da96506..599a34c 100644
--- a/scripts/crossbuild/crossbuild.mk
+++ b/scripts/crossbuild/crossbuild.mk
@@ -11,13 +11,19 @@ else
#
# Short list of common builds
#
-CB_COMMON:=centos7 debian10 ubuntu18
+CB_COMMON:=centos7 rocky9 debian11 ubuntu20
+
+# Where to put stamp files (subdirectory of where this makefile is)
+CB_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
# Where the docker directories are
-DT:=scripts/crossbuild/docker
+DT:=$(CB_DIR)/docker
# Where to put stamp files (subdirectory of where this makefile is)
-DD:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))/build
+DD:=$(CB_DIR)/build
+
+# Location of top-level m4 template
+DOCKER_TMPL:=$(CB_DIR)/../docker/m4/Dockerfile.m4
# List of all the docker images (sorted for "crossbuild.info")
CB_IMAGES:=$(sort $(patsubst $(DT)/%,%,$(wildcard $(DT)/*)))
@@ -99,6 +105,11 @@ crossbuild.clean: $(foreach IMG,${CB_IMAGES},crossbuild.${IMG}.clean)
crossbuild.wipe: $(foreach IMG,${CB_IMAGES},crossbuild.${IMG}.wipe)
#
+# Regenerate all Dockerfiles from m4 templates
+#
+crossbuild.regen: $(foreach IMG,${CB_IMAGES},crossbuild.${IMG}.regen)
+
+#
# Define rules for building a particular image
#
define CROSSBUILD_IMAGE_RULE
@@ -145,6 +156,7 @@ crossbuild.${1}.up: $(DD)/stamp-up.${1}
$(DD)/docker.refresh.${1}: $(DD)/stamp-up.${1}
${Q}echo "REFRESH ${1}"
${Q}docker container exec $(CB_CPREFIX)${1} sh -c 'rsync -a /srv/src/ /srv/local-src/'
+ ${Q}docker container exec $(CB_CPREFIX)${1} sh -c 'git config --global --add safe.directory /srv/local-src'
${Q}docker container exec $(CB_CPREFIX)${1} sh -c 'git config -f /srv/local-src/config core.bare true'
${Q}docker container exec $(CB_CPREFIX)${1} sh -c 'git config -f /srv/local-src/config --unset core.worktree || true'
${Q}docker container exec $(CB_CPREFIX)${1} sh -c '[ -d /srv/build ] || git clone /srv/local-src /srv/build'
@@ -218,6 +230,16 @@ crossbuild.${1}.wipe:
crossbuild.${1}.refresh: $(DD)/docker.refresh.${1}
#
+# Regenerate the image Dockerfile from the m4 templates
+#
+.PHONY: crossbuild.${1}.regen
+crossbuild.${1}.regen: $(DT)/${1}/Dockerfile
+
+$(DT)/${1}/Dockerfile: $(DOCKER_TMPL) $(CB_DIR)/m4/Dockerfile.deb.m4 $(CB_DIR)/m4/Dockerfile.rpm.m4
+ ${Q}echo REGEN ${1}
+ ${Q}m4 -I $(CB_DIR)/m4 -D D_NAME=${1} -D D_TYPE=crossbuild $$< > $$@
+
+#
# Run the build test
#
.PHONY: crossbuild.${1}