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

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Thu Sep 16 19:36:11 CEST 2010


Revision: 10980
          http://gar.svn.sourceforge.net/gar/?rev=10980&view=rev
Author:   dmichelsen
Date:     2010-09-16 17:36:11 +0000 (Thu, 16 Sep 2010)

Log Message:
-----------
mGAR v2: Add clean and rebuild targets, still some work to do

Modified Paths:
--------------
    csw/mgar/gar/v2/gar.lib.mk
    csw/mgar/gar/v2/gar.mk

Modified: csw/mgar/gar/v2/gar.lib.mk
===================================================================
--- csw/mgar/gar/v2/gar.lib.mk	2010-09-16 14:44:05 UTC (rev 10979)
+++ csw/mgar/gar/v2/gar.lib.mk	2010-09-16 17:36:11 UTC (rev 10980)
@@ -629,6 +629,41 @@
 	@( cd $* ; $(BUILD_ENV) python ./setup.py $(PYBUILD_CMD) $(BUILD_ARGS) )
 	@$(MAKECOOKIE)
 
+#################### CLEAN RULES ####################
+
+CLEAN_ARGS ?= clean
+ 
+# build from a standard gnu-style makefile's default rule.
+clean-%/Makefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/makefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/GNUmakefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/Jamfile:
+	$(error *** Don't know how to clean Jamfiles)
+
+clean-%/Rakefile:
+	$(error *** Don't know how to clean Rakefiles)
+
+clean-%/rakefile:
+	$(error *** Don't know how to clean Rakefiles)
+
+clean-%/setup.rb:
+	$(error *** Don't know how to clean Ruby setups)
+
+clean-%/setup.py:
+	$(error *** Don't know how to clean Python builds)
+
 #################### TEST RULES ####################
 
 TEST_TARGET ?= test

Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk	2010-09-16 14:44:05 UTC (rev 10979)
+++ csw/mgar/gar/v2/gar.mk	2010-09-16 17:36:11 UTC (rev 10980)
@@ -151,6 +151,7 @@
 $(call _modulate_target,build,$(2),$(4))
 $(call _modulate_target_nocookie,reset-build,$(2),$(4))
 $(call _modulate_target,test,$(2),$(4))
+$(call _modulate_target_nocookie,reset-test,$(2),$(4))
 $(call _modulate_target,install,$(2),$(4))
 $(call _modulate_target_nocookie,reset-install,$(2),$(4))
 #$(call _modulate_target,merge,$(2),$(4))
@@ -555,6 +556,7 @@
 reset-configure: $(addprefix reset-configure-,$(MODULATIONS))
 	rm -f $(COOKIEDIR)/configure
 
+# XXX: pre-*, post-*
 reset-configure-modulated:
 	rm -f $(addprefix $(COOKIEDIR)/,$(CONFIGURE_TARGETS))
 
@@ -578,6 +580,16 @@
 build-modulated: verify-isa configure-modulated pre-build-modulated pre-build-$(MODULATION) $(BUILD_TARGETS) post-build-$(MODULATION) post-build-modulated
 	@$(MAKECOOKIE)
 
+.PHONY: reset-build reset-build-modulated
+rebuild: reset-build build
+
+reset-build: $(addprefix reset-build-,$(MODULATIONS))
+	rm -f $(COOKIEDIR)/build
+
+# XXX: pre-*, post-*
+reset-build-modulated: $(patsubst build-%,clean-%,$(BUILD_TARGETS))
+	rm -f $(addprefix $(COOKIEDIR)/,pre-build-modulated $(BUILD_TAGRETS) post-build-modulated))
+
 # returns true if build has completed successfully, false
 # otherwise
 build-p:
@@ -591,6 +603,8 @@
 test-modulated: build-modulated pre-test-modulated pre-test-$(MODULATION) $(TEST_TARGETS) post-test-$(MODULATION) post-test-modulated
 	$(DONADA)
 
+# XXX: retest
+
 # strip - Strip executables
 ifneq ($(GARFLAVOR),DBG)
 POST_INSTALL_TARGETS := strip $(POST_INSTALL_TARGETS)


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