common Makefile.common,1.48,1.49

Mike Bonnet (mikeb) fedora-extras-commits at redhat.com
Thu May 3 18:33:29 UTC 2007


Author: mikeb

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

Modified Files:
	Makefile.common 
Log Message:
avoid recursive invocation of make, and refactor some check code into its own target


Index: Makefile.common
===================================================================
RCS file: /cvs/pkgs/common/Makefile.common,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Makefile.common	3 May 2007 16:59:28 -0000	1.48
+++ Makefile.common	3 May 2007 18:32:59 -0000	1.49
@@ -97,8 +97,8 @@
 CURL	?= $(shell if test -f /usr/bin/curl ; then echo "curl -H Pragma: -O -R -S --fail --show-error" ; fi)
 WGET	?= $(shell if test -f /usr/bin/wget ; then echo "wget -nd -m" ; fi)
 CLIENT	?= $(if $(CURL),$(CURL),$(if $(WGET),$(WGET)))
-PLAGUE_CLIENT ?= $(shell which plague-client)
-BUILD_CLIENT ?= $(shell which koji) 
+PLAGUE_CLIENT ?= $(shell which plague-client 2>/dev/null)
+BUILD_CLIENT ?= $(shell which koji 2>/dev/null) 
 
 # RPM with all the overrides in place; you can override this in your
 # .cvspkgsrc also, to use a default rpm setup
@@ -139,7 +139,7 @@
 PREP_ARCHES	= $(addprefix prep-,$(ARCHES))
 
 ## list all our bogus targets
-.PHONY :: $(ARCHES) sources uploadsource upload export check build test-srpm real-srpm srpm tag verrel new clean patch prep compile install-short compile-short FORCE
+.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build test-srpm real-srpm srpm tag verrel new clean patch prep compile install-short compile-short FORCE
 
 # The TARGETS define is meant for local module targets that should be
 # made in addition to the SOURCEFILES whenever needed
@@ -345,30 +345,24 @@
 	cvs commit -m "request build of $(CVS_REPOSITORY) $(TAG) for $(TARGET)" tobuild ;\
 	popd >/dev/null)
 
-plague: $(COMMON_DIR)/branches
-	@if [ ! -x $(PLAGUE_CLIENT) ]; then echo "Must have plague-client installed - see http://fedoraproject.org/wiki/Extras/BuildSystemClientSetup"; exit 1; fi
-	@if [ -z "$(TARGET)" -a ! -d CVS ]; then echo "Must be in a branch subdirectory"; exit 1; fi
-
-	@cvs status -v $(SPECFILE) 2>/dev/null | grep -q $(TAG); ret=$$? ;\
+build-check: $(SPECFILE)
+	@if [ -z "$(TARGET)" -o ! -d CVS ]; then echo "Must be in a branch subdirectory"; exit 1; fi
+	@cvs -f status -v $(SPECFILE) 2>/dev/null | grep -q $(TAG); ret=$$? ;\
 	if [ $$ret -ne 0 ]; then echo "$(SPECFILE) not tagged with tag $(TAG)"; exit 1;  fi
-	$(PLAGUE_CLIENT) build $(NAME) $(TAG) $(TARGET)
 
-koji: $(COMMON_DIR)/branches
-	@if [ ! -x $(BUILD_CLIENT) ]; then echo "Must have koji installed - see http://fedoraproject.org/wiki/BuildSystemClientSetup"; exit 1; fi
-	@if [ -z "$(TARGET)" -a ! -d CVS ]; then echo "Must be in a branch subdirectory"; exit 1; fi
-
-	@cvs status -v $(SPECFILE) 2>/dev/null | grep -q $(TAG); ret=$$? ;\
-	if [ $$ret -ne 0 ]; then echo "$(SPECFILE) not tagged with tag $(TAG)"; exit 1;  fi
+plague: build-check $(COMMON_DIR)/branches
+	@if [ ! -x "$(PLAGUE_CLIENT)" ]; then echo "Must have plague-client installed - see http://fedoraproject.org/wiki/Extras/BuildSystemClientSetup"; exit 1; fi
+	@$(PLAGUE_CLIENT) build $(NAME) $(TAG) $(TARGET)
 
+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 selects koji for devel and plague for the rest
-build: $(COMMON_DIR)/branches
-	@if [ "x$(BRANCH)" = "xdevel" ]; then \
-	  $(MAKE) koji ; \
-	else \
-	  $(MAKE) plague ; \
-	fi
+ifeq ($(BRANCH),devel)
+build: koji
+else
+build: plague
+endif
 
 # "make new | less" to see what has changed since the last tag was assigned
 new:




More information about the fedora-extras-commits mailing list