[asterisk-commits] wdoekes: trunk r351360 - /trunk/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 17 13:45:26 CST 2012


Author: wdoekes
Date: Tue Jan 17 13:45:19 2012
New Revision: 351360

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=351360
Log:
Fix support for parallel building with make (-j).

Previously make -j <N> would cause a race between doing cleanup of
certain files (defaults.h, menuselect, ...) and creating them anew.
Add a new target that depends on cleanup only and has a submake doing
the rest as command string. This way the cleanup goes first.

(closes issue ASTERISK-18751)
Tested by: Jeremy Kister
Reviewed by: Paul Belanger
Review: https://reviewboard.asterisk.org/r/1660

Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/Makefile?view=diff&rev=351360&r1=351359&r2=351360
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Jan 17 13:45:19 2012
@@ -338,7 +338,7 @@
 	mK=" make"
 endif
 
-all: _all
+all: _cleantest_all
 	@echo " +--------- Asterisk Build Complete ---------+"  
 	@echo " + Asterisk has successfully been built, and +"  
 	@echo " + can be installed by running:              +"
@@ -346,7 +346,12 @@
 	@echo " +               $(mK) install               +"  
 	@echo " +-------------------------------------------+"  
 
-_all: cleantest makeopts $(SUBDIRS) doc/core-en_US.xml $(ADDL_TARGETS)
+# For parallel builds, we must call cleantest *before* running the
+# other dependencies on _all.
+_cleantest_all: cleantest
+	@$(MAKE) _all
+
+_all: makeopts $(SUBDIRS) doc/core-en_US.xml $(ADDL_TARGETS)
 
 makeopts: configure
 	@echo "****"
@@ -462,7 +467,7 @@
 	rm -rf doc/api
 	rm -f build_tools/menuselect-deps
 
-datafiles: _all doc/core-en_US.xml
+datafiles: _cleantest_all doc/core-en_US.xml
 	CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";
 # Should static HTTP be installed during make samples or even with its own target ala
 # webvoicemail?  There are portions here that *could* be customized but might also be
@@ -563,7 +568,7 @@
 	$(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
 	$(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
 
-bininstall: _all installdirs $(SUBDIRS_INSTALL)
+bininstall: _cleantest_all installdirs $(SUBDIRS_INSTALL)
 	$(INSTALL) -m 755 main/asterisk "$(DESTDIR)$(ASTSBINDIR)/"
 	$(LN) -sf asterisk "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
 	$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
@@ -954,6 +959,8 @@
 .PHONY: dist-clean
 .PHONY: distclean
 .PHONY: all
+.PHONY: _all
+.PHONY: _cleantest_all
 .PHONY: prereqs
 .PHONY: cleantest
 .PHONY: uninstall




More information about the asterisk-commits mailing list