Bug 462736 Add support for PARALLEL_DIRS to build system, ||ize suite/ r=KaiRo

This commit is contained in:
Neil Rashbrook 2008-11-05 14:46:40 +00:00
Родитель 5734c7a991
Коммит ffcb377f37
5 изменённых файлов: 83 добавлений и 27 удалений

Просмотреть файл

@ -361,6 +361,11 @@ LOOP_OVER_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
# we only use this for the makefiles target and other stuff that doesn't matter
LOOP_OVER_PARALLEL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
LOOP_OVER_STATIC_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
@ -369,6 +374,15 @@ LOOP_OVER_TOOL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
ifdef PARALLEL_DIRS
# create a bunch of fake targets for order-only processing
PARALLEL_DIRS_export = $(addsuffix _export,$(PARALLEL_DIRS))
PARALLEL_DIRS_libs = $(addsuffix _libs,$(PARALLEL_DIRS))
PARALLEL_DIRS_tools = $(addsuffix _tools,$(PARALLEL_DIRS))
.PHONY: $(PARALLEL_DIRS_export) $(PARALLEL_DIRS_libs) $(PARALLEL_DIRS_tools)
endif
#
# Now we can differentiate between objects used to build a library, and
# objects used to build an executable in the same directory.
@ -577,7 +591,7 @@ endif
# SUBMAKEFILES: List of Makefiles for next level down.
# This is used to update or create the Makefiles before invoking them.
SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS))
SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
# The root makefile doesn't want to do a plain export/libs, because
# of the tiers and because of libxul. Suppress the default rules in favor
@ -673,15 +687,30 @@ endif
# Target to only regenerate makefiles
makefiles: $(SUBMAKEFILES)
ifneq (,$(DIRS)$(TOOL_DIRS))
ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
endif
ifdef PARALLEL_DIRS
export:: $(PARALLEL_DIRS_export)
$(PARALLEL_DIRS_export): %_export: %/Makefile
+$(MAKE) -C $* export
endif
export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),$(PUBLIC)) $(if $(SDK_HEADERS)$(SDK_XPIDLSRCS),$(SDK_PUBLIC)) $(if $(XPIDLSRCS),$(IDL_DIR)) $(if $(SDK_XPIDLSRCS),$(SDK_IDL_DIR))
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
ifdef PARALLEL_DIRS
tools:: $(PARALLEL_DIRS_tools)
$(PARALLEL_DIRS_tools): %_tools: %/Makefile
+$(MAKE) -C $* tools
endif
tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
ifdef TOOL_DIRS
@ -714,6 +743,13 @@ HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(HOST_LIBS))
DSO_LDOPTS_DEPS = $(EXTRA_DSO_LIBS) $(filter %.$(LIB_SUFFIX), $(EXTRA_DSO_LDOPTS))
##############################################
ifdef PARALLEL_DIRS
libs:: $(PARALLEL_DIRS_libs)
$(PARALLEL_DIRS_libs): %_libs: %/Makefile
+$(MAKE) -C $* libs
endif
libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS)
ifndef NO_DIST_INSTALL
ifdef LIBRARY
@ -814,11 +850,13 @@ run_viewer: $(FINAL_TARGET)/viewer
clean clobber realclean clobber_all:: $(SUBMAKEFILES)
-rm -f $(ALL_TRASH)
-rm -rf $(ALL_TRASH_DIRS)
+-$(LOOP_OVER_PARALLEL_DIRS)
+-$(LOOP_OVER_DIRS)
+-$(LOOP_OVER_STATIC_DIRS)
+-$(LOOP_OVER_TOOL_DIRS)
distclean:: $(SUBMAKEFILES)
+-$(LOOP_OVER_PARALLEL_DIRS)
+-$(LOOP_OVER_DIRS)
+-$(LOOP_OVER_STATIC_DIRS)
+-$(LOOP_OVER_TOOL_DIRS)
@ -1365,12 +1403,14 @@ endif
ifneq ($(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),)
$(SDK_PUBLIC) $(PUBLIC)::
@if test ! -d $@; then $(ECHO) Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
endif
ifneq ($(XPI_NAME),)
export::
@if test ! -d $(FINAL_TARGET); then echo Creating $(FINAL_TARGET); rm -fr $(FINAL_TARGET); $(NSINSTALL) -D $(FINAL_TARGET); else true; fi
$(FINAL_TARGET):
$(NSINSTALL) -D $@
export:: $(FINAL_TARGET)
endif
ifndef NO_DIST_INSTALL
@ -1408,8 +1448,10 @@ PREF_PPFLAGS = --line-endings=crlf
endif
ifndef NO_DIST_INSTALL
libs:: $(PREF_JS_EXPORTS)
if test ! -d $(FINAL_TARGET)/$(PREF_DIR); then $(NSINSTALL) -D $(FINAL_TARGET)/$(PREF_DIR); fi
$(FINAL_TARGET)/$(PREF_DIR):
$(NSINSTALL) -D $@
libs:: $(FINAL_TARGET)/$(PREF_DIR) $(PREF_JS_EXPORTS)
$(EXIT_ON_ERROR) \
for i in $(PREF_JS_EXPORTS); do \
dest=$(FINAL_TARGET)/$(PREF_DIR)/`basename $$i`; \
@ -1424,7 +1466,7 @@ endif
ifneq ($(AUTOCFG_JS_EXPORTS),)
$(FINAL_TARGET)/defaults/autoconfig::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
export:: $(AUTOCFG_JS_EXPORTS) $(FINAL_TARGET)/defaults/autoconfig
@ -1454,7 +1496,7 @@ export:: FORCE
endif
$(SDK_IDL_DIR) $(IDL_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(PUBLIC);
# warn against overriding existing .h file.
@ -1517,7 +1559,7 @@ endif # XPIDLSRCS
# http://bugzilla.mozilla.org/show_bug.cgi?id=145777
#
$(IDL_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)
@ -1527,6 +1569,7 @@ export-idl:: $(XPIDLSRCS) $(SDK_XPIDLSRCS) $(IDL_DIR)
$(INSTALL) $(IFLAGS1) $^
endif
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
@ -1605,7 +1648,7 @@ endif
ifneq (,$(SDK_LIBRARY))
$(SDK_LIB_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR)
@ -1616,7 +1659,7 @@ endif # SDK_LIBRARY
ifneq (,$(SDK_BINARY))
$(SDK_BIN_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
libs:: $(SDK_BINARY) $(SDK_BIN_DIR)
@ -1632,14 +1675,17 @@ JAR_MANIFEST := $(srcdir)/jar.mn
chrome::
$(MAKE) realchrome
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
libs realchrome:: $(CHROME_DEPS)
$(FINAL_TARGET)/chrome:
$(NSINSTALL) -D $@
libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
ifndef NO_DIST_INSTALL
@$(EXIT_ON_ERROR) \
if test -f $(JAR_MANIFEST); then \
if test ! -d $(FINAL_TARGET)/chrome; then $(NSINSTALL) -D $(FINAL_TARGET)/chrome; fi; \
$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
@ -1858,11 +1904,13 @@ depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES)
else
depend:: $(SUBMAKEFILES)
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
dependclean:: $(SUBMAKEFILES)
rm -f $(MDDEPFILES)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
@ -1936,8 +1984,10 @@ endif
# Disallow parallel builds with MSVC < 8
#
ifneq (,$(filter 1200 1300 1310,$(_MSC_VER)))
ifneq (,$(OBJS)$(HOST_OBJS))
.NOTPARALLEL:
endif
endif
#
# Re-define the list of default suffixes, so gmake won't have to churn through
@ -1964,6 +2014,7 @@ tags: TAGS
TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
-etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
echo-variable-%:
@ -1987,6 +2038,7 @@ ifdef _REPORT_ALL_DIRS
else
@$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
echo-depth-path:
@ -2016,6 +2068,7 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
@echo "DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
@echo --------------------------------------------------------------------------------
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
showbuild:
@ -2077,6 +2130,7 @@ zipmakes:
ifneq (,$(filter $(PROGRAM) $(SIMPLE_PROGRAMS) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))
zip $(DEPTH)/makefiles $(subst $(topsrcdir),$(MOZ_SRC)/mozilla,$(srcdir)/Makefile.in)
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
documentation:
@ -2084,5 +2138,6 @@ documentation:
$(DOXYGEN) $(DEPTH)/config/doxygen.cfg
check:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)

Просмотреть файл

@ -44,30 +44,31 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# XXX Disable for release builds
DIRS += debugQA
PARALLEL_DIRS = debugQA
# if you add DIRS here, care that app is always at the bottom of the list
# as it packages up the built files on mac...
DIRS += \
PARALLEL_DIRS += \
branding \
browser \
common \
locales \
modules \
themes \
themes/classic \
themes/modern \
profile \
security \
shell \
build \
app \
shell/public \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
PARALLEL_DIRS += shell/src
ifdef MOZ_INSTALLER
DIRS += installer/windows
PARALLEL_DIRS += installer/windows
endif
endif
# app is always last as it packages up the built files on mac
DIRS = build app
include $(topsrcdir)/config/rules.mk
# For Windows build the uninstaller during the application build since the

Просмотреть файл

@ -42,7 +42,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
PARALLEL_DIRS = public src
EXTRA_COMPONENTS = nsBrowserContentHandler.js \
nsAboutAbout.js \

Просмотреть файл

@ -42,10 +42,10 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
PARALLEL_DIRS = public src
ifdef ENABLE_TESTS
DIRS += tests
PARALLEL_DIRS += tests
endif
EXTRA_COMPONENTS = \

Просмотреть файл

@ -42,7 +42,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = migration
PARALLEL_DIRS = migration/public migration/src
MODULE = suiteprofile
LIBRARY_NAME = suiteprofile_s