[asterisk-commits] qwell: branch 1.8 r385745 - /branches/1.8/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 15 12:07:50 CDT 2013


Author: qwell
Date: Mon Apr 15 12:07:45 2013
New Revision: 385745

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385745
Log:
Don't unnecessarily rebuild things on every run of 'make'.

Review: https://reviewboard.asterisk.org/r/2449/

Modified:
    branches/1.8/Makefile

Modified: branches/1.8/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/Makefile?view=diff&rev=385745&r1=385744&r2=385745
==============================================================================
--- branches/1.8/Makefile (original)
+++ branches/1.8/Makefile Mon Apr 15 12:07:45 2013
@@ -289,7 +289,7 @@
 	@echo " +               $(mK) install               +"  
 	@echo " +-------------------------------------------+"  
 
-_all: cleantest makeopts $(SUBDIRS) doc/core-en_US.xml
+_all: .lastclean makeopts $(SUBDIRS) doc/core-en_US.xml
 
 makeopts: configure
 	@echo "****"
@@ -350,31 +350,30 @@
 $(OTHER_SUBDIRS):
 	+ at _ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
 
-defaults.h: makeopts cleantest
+defaults.h: makeopts .lastclean
 	@build_tools/make_defaults_h > $@.tmp
 	@cmp -s $@.tmp $@ || mv $@.tmp $@
 	@rm -f $@.tmp
 
-main/version.c: FORCE cleantest
+main/version.c: FORCE .lastclean
 	@build_tools/make_version_c > $@.tmp
 	@cmp -s $@.tmp $@ || mv $@.tmp $@
 	@rm -f $@.tmp
 
-include/asterisk/version.h: FORCE cleantest
+include/asterisk/version.h: FORCE .lastclean
 	@build_tools/make_version_h > $@.tmp
 	@cmp -s $@.tmp $@ || mv $@.tmp $@
 	@rm -f $@.tmp
 
-include/asterisk/buildopts.h: menuselect.makeopts cleantest
+include/asterisk/buildopts.h: menuselect.makeopts .lastclean
 	@build_tools/make_buildopts_h > $@.tmp
 	@cmp -s $@.tmp $@ || mv $@.tmp $@
 	@rm -f $@.tmp
 
-# build.h must depend on cleantest, or parallel make may wipe it out after it's
-# been created. But since build.h contains a timestamp, the cmp trick used above
-# won't work. Just testing for existence is good enough.
-include/asterisk/build.h: cleantest
-	@test -f $@ || build_tools/make_build_h > $@
+# build.h must depend on .lastclean, or parallel make may wipe it out after it's
+# been created.
+include/asterisk/build.h: .lastclean
+	@build_tools/make_build_h > $@
 
 $(SUBDIRS_CLEAN):
 	+@$(SUBMAKE) -C $(@:-clean=) clean
@@ -421,7 +420,7 @@
 	done
 	$(MAKE) -C sounds install
 
-doc/core-en_US.xml: cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+doc/core-en_US.xml: .lastclean $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
 	@printf "Building Documentation For: "
 	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
 	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
@@ -762,8 +761,8 @@
 # .cleancount is the global clean count, and .lastclean is the 
 # last clean count we had
 
-cleantest:
-	@cmp -s .cleancount .lastclean || $(MAKE) clean
+.lastclean: .cleancount
+	@$(MAKE) clean
 
 $(SUBDIRS_UNINSTALL):
 	+@$(SUBMAKE) -C $(@:-uninstall=) uninstall
@@ -876,7 +875,6 @@
 .PHONY: distclean
 .PHONY: all
 .PHONY: prereqs
-.PHONY: cleantest
 .PHONY: uninstall
 .PHONY: _uninstall
 .PHONY: uninstall-all




More information about the asterisk-commits mailing list