[csw-devel] SF.net SVN: gar:[6704] csw/mgar/gar/v2-pbuild

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Mon Oct 5 14:17:50 CEST 2009


Revision: 6704
          http://gar.svn.sourceforge.net/gar/?rev=6704&view=rev
Author:   dmichelsen
Date:     2009-10-05 12:17:49 +0000 (Mon, 05 Oct 2009)

Log Message:
-----------
mGAR v2-pbuild: More fixes towards release

Modified Paths:
--------------
    csw/mgar/gar/v2-pbuild/gar.mk
    csw/mgar/gar/v2-pbuild/gar.pkg.mk

Modified: csw/mgar/gar/v2-pbuild/gar.mk
===================================================================
--- csw/mgar/gar/v2-pbuild/gar.mk	2009-10-05 09:22:58 UTC (rev 6703)
+++ csw/mgar/gar/v2-pbuild/gar.mk	2009-10-05 12:17:49 UTC (rev 6704)
@@ -75,37 +75,6 @@
 include $(GARDIR)/gar.conf.mk
 include $(GARDIR)/gar.lib.mk
 
-#################### DIRECTORY MAKERS ####################
-
-# This is to make dirs as needed by the base rules
-$(sort $(DOWNLOADDIR) $(PARTIALDIR) $(COOKIEDIR) $(WORKSRC) $(WORKDIR) $(EXTRACTDIR) $(FILEDIR) $(SCRATCHDIR) $(PKGROOT) $(INSTALL_DIRS) $(INSTALLISADIR) $(GARCHIVEDIR) $(GARPKGDIR) $(STAGINGDIR)) $(COOKIEDIR)/%:
-	@if test -d $@; then : ; else \
-		ginstall -d $@; \
-		echo "ginstall -d $@"; \
-	fi
-
-# These stubs are wildcarded, so that the port maintainer can
-# define something like "pre-configure" and it won't conflict,
-# while the configure target can call "pre-configure" safely even
-# if the port maintainer hasn't defined it.
-# 
-# in addition to the pre-<target> rules, the maintainer may wish
-# to set a "pre-everything" rule, which runs before the first
-# actual target.
-pre-%:
-	@true
-
-post-%:
-	@true
-
-# Call any arbitrary rule recursively for all dependencies
-deep-%: %
-	@for target in "" $(DEPEND_LIST) ; do \
-		test -z "$$target" && continue ; \
-		$(MAKE) -C ../../$$target DESTIMG=$(DESTIMG) $@ ; \
-	done
-	@$(foreach IMG,$(filter-out $(DESTIMG),$(IMGDEPS)),for dep in "" $($(IMG)_DEPENDS); do test -z "$$dep" && continue ; $(MAKE) -C ../../$$dep DESTIMG=$(IMG) $@; done; )
-
 # ========================= MODULATIONS ======================== 
 
 # The default is to modulate over ISAs
@@ -137,7 +106,7 @@
 
 define _modulate_target
 $(1)-$(2):
-	@gmake MODULATION=$(2) $(3) $(1)-modulated
+	@$(MAKE) MODULATION=$(2) $(3) $(1)-modulated
 	@# This is MAKECOOKIE expanded to use the name of the rule explicily as the rule has
 	@# not been evaluated yet. XXX: Use function _MAKECOOKIE for both
 	@mkdir -p $(COOKIEDIR)/$(dir $(1)-$(2)) && date >> $(COOKIEDIR)/$(1)-$(2)
@@ -147,7 +116,7 @@
 
 define _modulate_target_nocookie
 $(1)-$(2):
-	@gmake -s MODULATION=$(2) $(3) $(1)-modulated
+	@$(MAKE) -s MODULATION=$(2) $(3) $(1)-modulated
 	@# The next line has intentionally been left blank to explicitly terminate this make rule
 
 endef
@@ -161,7 +130,7 @@
 	@echo "[===== Building modulation '$(2)' on host '$$(BUILDHOST)' =====]"
 	$$(if $$(and $$(BUILDHOST),$$(filter-out $$(THISHOST),$$(BUILDHOST))),\
 		$(SSH) $$(BUILDHOST) "PATH=$$(PATH) $(MAKE) -C $$(CURDIR) $(if $(PLATFORM),PLATFORM=$(PLATFORM)) MODULATION=$(2) $(3) merge-modulated",\
-		gmake $(if $(PLATFORM),PLATFORM=$(PLATFORM)) MODULATION=$(2) $(3) merge-modulated\
+		$(MAKE) $(if $(PLATFORM),PLATFORM=$(PLATFORM)) MODULATION=$(2) $(3) merge-modulated\
 	)
 	@# The next line has intentionally been left blank to explicitly terminate this make rule
 
@@ -218,7 +187,38 @@
 
 $(eval $(call _modulate,$(MODULATORS)))
 
+#################### DIRECTORY MAKERS ####################
 
+# This is to make dirs as needed by the base rules
+$(sort $(DOWNLOADDIR) $(PARTIALDIR) $(COOKIEDIR) $(WORKSRC) $(addprefix $(WORKROOTDIR)/build-,global $(MODULATIONS)) $(EXTRACTDIR) $(FILEDIR) $(SCRATCHDIR) $(PKGROOT) $(INSTALL_DIRS) $(INSTALLISADIR) $(GARCHIVEDIR) $(GARPKGDIR) $(STAGINGDIR)) $(COOKIEDIR)/%:
+	@if test -d $@; then : ; else \
+		ginstall -d $@; \
+		echo "ginstall -d $@"; \
+	fi
+
+# These stubs are wildcarded, so that the port maintainer can
+# define something like "pre-configure" and it won't conflict,
+# while the configure target can call "pre-configure" safely even
+# if the port maintainer hasn't defined it.
+# 
+# in addition to the pre-<target> rules, the maintainer may wish
+# to set a "pre-everything" rule, which runs before the first
+# actual target.
+pre-%:
+	@true
+
+post-%:
+	@true
+
+# Call any arbitrary rule recursively for all dependencies
+deep-%: %
+	@for target in "" $(DEPEND_LIST) ; do \
+		test -z "$$target" && continue ; \
+		$(MAKE) -C ../../$$target DESTIMG=$(DESTIMG) $@ ; \
+	done
+	@$(foreach IMG,$(filter-out $(DESTIMG),$(IMGDEPS)),for dep in "" $($(IMG)_DEPENDS); do test -z "$$dep" && continue ; $(MAKE) -C ../../$$dep DESTIMG=$(IMG) $@; done; )
+
+
 # ========================= MAIN RULES ========================= 
 # The main rules are the ones that the user can specify as a
 # target on the "make" command-line.  Currently, they are:
@@ -249,7 +249,9 @@
 # prerequisite	- Make sure that the system is in a sane state for building the package
 PREREQUISITE_TARGETS = $(addprefix prerequisitepkg-,$(PREREQUISITE_BASE_PKGS) $(PREREQUISITE_PKGS)) $(addprefix prerequisite-,$(PREREQUISITE_SCRIPTS))
 
-prerequisite: announce pre-everything $(COOKIEDIR) $(DOWNLOADDIR) $(PARTIALDIR) $(addprefix dep-$(GARDIR)/,$(FETCHDEPS)) pre-prerequisite $(PREREQUISITE_TARGETS) post-prerequisite
+# Force to be called in global modulation
+prerequisite: $(if $(filter global,$(MODULATION)),announce pre-everything $(COOKIEDIR) $(DOWNLOADDIR) $(PARTIALDIR) $(addprefix dep-$(GARDIR)/,$(FETCHDEPS)) pre-prerequisite $(PREREQUISITE_TARGETS) post-prerequisite)
+	$(if $(filter-out global,$(MODULATION)),$(MAKE) -s MODULATION=global prerequisite)
 	$(DONADA)
 
 prerequisitepkg-%:
@@ -289,15 +291,15 @@
 checksum: fetch $(COOKIEDIR) pre-checksum $(CHECKSUM_TARGETS) post-checksum
 	@$(DONADA)
 
-checksum-global:
-	@$(MAKE) -s ISA=global checksum
-	@$(MAKECOOKIE)
+checksum-global: $(if $(filter global,$(MODULATION)),checksum)
+	$(if $(filter-out global,$(MODULATION)),$(MAKE) -s MODULATION=global checksum)
+	@$(DONADA)
 
 # The next rule handles the dependency from the modulated context to
 # the contextless checksumming. The rule is called when the cookie
 # to the global checksum is requested. If the global checksum has not run,
 # then run it. Otherwise it is silently accepted.
-checksum-modulated: $(if $(test ! -e $(COOKIEDIR)/build-global/checksum),checksum-global)
+checksum-modulated: checksum-global
 	@$(DONADA)
 
 # returns true if checksum has completed successfully, false
@@ -331,6 +333,10 @@
 extract: checksum $(COOKIEDIR) pre-extract extract-modulated $(addprefix extract-,$(MODULATIONS)) post-extract
 	@$(DONADA)
 
+extract-global: $(if $(filter global,$(MODULATION)),extract-modulated)
+	$(if $(filter-out global,$(MODULATION)),$(MAKE) -s MODULATION=global extract)
+	@$(MAKECOOKIE)
+
 extract-modulated: checksum-modulated $(EXTRACTDIR) $(COOKIEDIR) \
 		$(addprefix dep-$(GARDIR)/,$(EXTRACTDEPS)) \
 		announce-modulation \
@@ -736,7 +742,7 @@
 # cookie, but that would be lame and unportable).
 
 clean: $(addprefix clean-,$(MODULATIONS))
-	rm -rf $(WORKROOTDIR) $(COOKIEROOTDIR) $(DOWNLOADDIR)
+	@rm -rf $(WORKROOTDIR) $(COOKIEROOTDIR) $(DOWNLOADDIR)
 
 clean-modulated:
 	$(call _pmod,Cleaning )

Modified: csw/mgar/gar/v2-pbuild/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2-pbuild/gar.pkg.mk	2009-10-05 09:22:58 UTC (rev 6703)
+++ csw/mgar/gar/v2-pbuild/gar.pkg.mk	2009-10-05 12:17:49 UTC (rev 6704)
@@ -573,14 +573,18 @@
 # We depend on extract as the additional package files (like .gspec) must be
 # unpacked to global/ for packaging. E. g. 'merge' depends only on the specific
 # modulations and does not fill global/.
-package: validateplatform checksum merge $(SPKG_DESTDIRS) pre-package $(PACKAGE_TARGETS) post-package
+_package: validateplatform extract-global merge $(SPKG_DESTDIRS) pre-package $(PACKAGE_TARGETS) post-package
+
+package: _package
 	@echo
 	@echo "The following packages have been built:"
 	@echo
-	@$(foreach SPEC,$(_PKG_SPECS),echo $(SPEC);echo "  $(SPKG_EXPORT)/$(shell $(call _PKG_ENV,$(SPEC)) $(GARBIN)/mkpackage -qs $(WORKDIR)/$(SPEC).gspec -D pkgfile).gz";)
-	@echo
+	@$(MAKE) -s PLATFORM=$(PLATFORM) _pkgshow
 	@$(DONADA)
 
+_pkgshow:
+	@$(foreach SPEC,$(_PKG_SPECS),printf "  %-20s %s\n"  $(SPEC) $(SPKG_EXPORT)/$(shell $(call _PKG_ENV,$(SPEC)) $(GARBIN)/mkpackage -qs $(WORKDIR)/$(SPEC).gspec -D pkgfile).gz;)
+
 # The dynamic pkginfo is only generated for dynamic gspec-files
 package-%: $(WORKDIR)/%.gspec $(if $(findstring %.gspec,$(DISTFILES)),,$(WORKDIR)/%.pkginfo) $(WORKDIR)/%.prototype-$(GARCH) $(WORKDIR)/%.depend
 	@echo " ==> Processing $*.gspec"
@@ -601,7 +605,7 @@
 # pkgcheck - check if the package is compliant
 #
 pkgcheck: $(addprefix pkgcheck-,$(_PKG_SPECS))
-	$(DONADA)
+	@$(DONADA)
 
 pkgcheck-%:
 	@echo " ==> Checking compliance: $*"
@@ -633,12 +637,25 @@
 	$(foreach P,$(PACKAGING_PLATFORMS),\
 		$(if $(PACKAGING_HOST_$P),\
 			$(if $(filter $(THISHOST),$(PACKAGING_HOST_$P)),\
-				$(MAKE) PLATFORM=$P package && ,\
-				$(SSH) $(PACKAGING_HOST_$P) "$(MAKE) -C $(CURDIR) PLATFORM=$P package" && \
+				$(MAKE) PLATFORM=$P _package && ,\
+				$(SSH) -t $(PACKAGING_HOST_$P) "$(MAKE) -C $(CURDIR) PLATFORM=$P _package" && \
 			),\
 			$(error *** No host has been defined for platform $P)\
 		)\
 	) true
+	@echo
+	@echo "The following packages have been built during this invocation:"
+	@echo
+	@$(foreach P,$(PACKAGING_PLATFORMS),\
+		echo "* Platform $P\c";\
+		$(if $(filter $(THISHOST),$(PACKAGING_HOST_$P)),\
+			echo " (built on this host)";\
+			  $(MAKE) -s PLATFORM=$P _pkgshow;echo;,\
+			echo " (built on host '$(PACKAGING_HOST_$P)')";\
+			  $(SSH) $(PACKAGING_HOST_$P) "$(MAKE) -C $(CURDIR) -s PLATFORM=$P _pkgshow";echo;\
+		)\
+	)
+	#@$(MAKECOOKIE)
 
 # Print relecant informations about the platform
 platformenv:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list