[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

common Makefile.common,1.58,1.59



Author: mikeb

Update of /cvs/pkgs/common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5592

Modified Files:
	Makefile.common 
Log Message:
chain-build target (ported from an internal patch provided by David Cantrell)


Index: Makefile.common
===================================================================
RCS file: /cvs/pkgs/common/Makefile.common,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- Makefile.common	18 May 2007 18:25:32 -0000	1.58
+++ Makefile.common	31 May 2007 19:01:14 -0000	1.59
@@ -139,7 +139,7 @@
 PREP_ARCHES	= $(addprefix prep-,$(ARCHES))
 
 ## list all our bogus targets
-.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local
+.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build cvsurl chain-build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local
 
 # The TARGETS define is meant for local module targets that should be
 # made in addition to the SOURCEFILES whenever needed
@@ -308,6 +308,7 @@
 
 CVS_ROOT	:= $(shell if [ -f CVS/Root ] ; then cat CVS/Root ; fi)
 CVS_REPOSITORY	:= $(shell if [ -f CVS/Repository ] ; then cat CVS/Repository ; fi)
+CVS_URL		:= cvs://cvs.fedoraproject.org/cvs/pkgs?$(CVS_REPOSITORY)\#$(TAG)
 
 ## create a clean exported copy in $(TMPCVS)
 export:: sources
@@ -385,7 +386,7 @@
 
 koji: build-check $(COMMON_DIR)/branches
 	@if [ ! -x "$(BUILD_CLIENT)" ]; then echo "Must have koji installed - see http://fedoraproject.org/wiki/BuildSystemClientSetup";; exit 1; fi
-	@$(BUILD_CLIENT) build $(BUILD_FLAGS) $(TARGET) 'cvs://cvs.fedoraproject.org/cvs/pkgs?$(CVS_REPOSITORY)#$(TAG)'
+	@$(BUILD_CLIENT) build $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)'
 
 ifneq (, $(filter devel F-7, $(BRANCH)))
 build: koji
@@ -393,6 +394,36 @@
 build: plague
 endif
 
+cvsurl:
+	@echo '$(CVS_URL)'
+
+chain-build: build-check
+	@if [ -z "$(CHAIN)" ]; then \
+                echo "Missing CHAIN variable, please specify the order of packages to" ; \
+                echo "chain build.  For example:  make chain-build CHAIN='foo bar'" ; \
+                exit 1 ; \
+        fi ; \
+        subdir=`basename $$(pwd)` ; \
+        urls="" ; \
+        for component in $(CHAIN) ; do \
+                if [ -n "$$urls" ]; then \
+                        urls="$$urls :" ; \
+                fi ; \
+                if [ -d ../../$$component/$$subdir ]; then \
+                        urls="$$urls `make -s -C ../../$$component/$$subdir cvsurl`" ; \
+                else \
+                        rm -rf .tmp-$$$$ ; \
+                        mkdir -p .tmp-$$$$ ; \
+                        pushd .tmp-$$$$ > /dev/null ; \
+                        cvs -d $(CVS_ROOT) co $$component ; \
+                        urls="$$urls `make -s -C $$component/$$subdir cvsurl`" ; \
+                        popd > /dev/null ; \
+                        rm -rf .tmp-$$$$ ; \
+                fi ; \
+        done ; \
+        urls="$$urls : `make -s cvsurl`" ; \
+        $(BUILD_CLIENT) chain-build $(BUILD_FLAGS) $(TARGET) $$urls
+
 # "make new | less" to see what has changed since the last tag was assigned
 new:
 	- cvs diff -u -r$$(cvs log Makefile 2>/dev/null | awk '/^symbolic names:$$/ {getline; sub(/^[ \t]*/, "") ; sub (/:.*$$/, ""); print; exit 0}')
@@ -469,6 +500,9 @@
 	@echo "	srpm			Create a srpm"
 	@echo "	tag			Tag sources as \"$(TAG)\""
 	@echo "	build			Request build of \"$(TAG)\" for $(TARGET)"
+	@echo " chain-build             Build current package in order with other packages"
+	@echo "         example:  make chain-build CHAIN='libwidget libgizmo'"
+	@echo "         The current package is added to the end of the CHAIN list."
 	@echo "	mockbuild		Local test build using mock"
 	@echo "	verrel			Echo \"$(NAME)-$(VERSION)-$(RELEASE)\""
 	@echo "	new			Diff against last tag"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]