[cpp-linbuild] 02/06: Form path to platform products only once

John W. O'Brien john at saltant.com
Fri Mar 3 14:42:36 UTC 2023


This is an automated email from the git hooks/post-receive script.

obrienjw pushed a commit to branch main
in repository cpp-linbuild.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-linbuild.git;a=commit;h=636ffd2205649af4c8d4a1932c88a05530d18bb2

commit 636ffd2205649af4c8d4a1932c88a05530d18bb2
Author: John W. O'Brien <john at saltant.com>
AuthorDate: Fri Feb 3 19:38:58 2023 +0000

    Form path to platform products only once
---
 Makefile | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 221147d..d02ed61 100644
--- a/Makefile
+++ b/Makefile
@@ -205,9 +205,10 @@ endef
 
 $(foreach platform,$(PLATFORMS),$(foreach component,$(COMPONENTS),$(eval $(call dependencies-component-platform,$(component),$(platform)))))
 
-# Build a docker image for each supported platform
-define build-docker-image-platform
+# Prepare each supported platform
+define prepare-platform
 $(1)_token = $$(srcdir).$(1)_image
+$(1)_products = $(srcdir)os/$(1)/products
 $$($(1)_token): $(srcdir)os/$(1)/image/Dockerfile
 	@echo "==> Building base Docker image for $(1)"
 	docker build -t shibboleth/$(1):$(BASETAG) $(srcdir)os/$(1)/image
@@ -215,7 +216,7 @@ $$($(1)_token): $(srcdir)os/$(1)/image/Dockerfile
 $(1)-image: $$($(1)_token)
 endef
 
-$(foreach platform,$(PLATFORMS),$(eval $(call build-docker-image-platform,$(platform))))
+$(foreach platform,$(PLATFORMS),$(eval $(call prepare-platform,$(platform))))
 
 # Convenience target to build Docker images for all supported platforms
 .PHONY: images
@@ -244,12 +245,12 @@ $(foreach platform,$(PLATFORMS),$(foreach component,$(COMPONENTS),$(eval $(call
 define build-component-platform
 $(1)_$(2)_token = $(srcdir).$(1)_$(2)_products
 $$($(1)_$(2)_token): $$($(1)_$(2)_image_token) $(SOURCEDIR)/$$($(1)_DISTFILE) $(SPECDIR)/$$($(1)_COMPNAME).spec
-	mkdir -p $(srcdir)os/$(2)/products/{RPMS,SRPMS}
+	mkdir -p $$($(2)_products)/{RPMS,SRPMS}
 	@echo "==> Sanity checking $(1) on $(2)"
 	grep -E "^Version:[[:space:]]+$$($(1)_VERSION)$$$$" $(SPECDIR)/$$($(1)_COMPNAME).spec
 	@echo "==> Building $(1) on $(2)"
 	docker run -it --rm \
-		-v $(srcdir)os/$(2)/products:/opt/build/external/out:z \
+		-v $$($(2)_products):/opt/build/external/out:z \
 		-v $(srcdir)common:/opt/build/external/in:z \
 		shibboleth/$(2):$($(1)_COMPNAME) \
 		/bin/sh /opt/build/external/in/build.sh $($(1)_COMPNAME)
@@ -263,9 +264,9 @@ $(foreach platform,$(PLATFORMS),$(foreach component,$(COMPONENTS),$(eval $(call
 define run-container-component-platform
 .PHONY: run_container_$($(1)_COMPNAME)_$(2)
 run_container_$($(1)_COMPNAME)_$(2): $$($(1)_$(2)_image_token) $(SOURCEDIR)/$$($(1)_DISTFILE)
-	mkdir -p $(srcdir)os/$(2)/products/{RPMS,SRPMS}
+       mkdir -p $$($(2)_products)/{RPMS,SRPMS}
 	docker run -it --rm \
-		-v $(srcdir)os/$(2)/products:/opt/build/external/out:z \
+		-v $$($(2)_products):/opt/build/external/out:z \
 		-v $(srcdir)common:/opt/build/external/in:z \
 		shibboleth/$(2):$($(1)_COMPNAME) \
 		/bin/bash

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list