Bug 480069 - Recursive submakes without shell loops, r=ted

This commit is contained in:
Benjamin Smedberg 2009-02-27 16:03:53 -05:00
Родитель 8497fbcac9
Коммит b06c533da2
4 изменённых файлов: 114 добавлений и 190 удалений

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

@ -397,7 +397,6 @@ ZIP = @ZIP@
XARGS = @XARGS@
STRIP = @STRIP@
DOXYGEN = @DOXYGEN@
MAKE = @MAKE@
PBBUILD_BIN = @PBBUILD@
SDP = @SDP@
NSINSTALL_BIN = @NSINSTALL_BIN@

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

@ -460,35 +460,34 @@ ifdef MOZ_UPDATE_XTERM
# Its good not to have a newline at the end of the titlebar string because it
# makes the make -s output easier to read. Echo -n does not work on all
# platforms, but we can trick sed into doing it.
UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_export = sed -e "s!Y!export in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
endif
define SUBMAKE # $(call SUBMAKE,target,directory)
@$(UPDATE_TITLE)
+@$(MAKE) $(if $(2),-C $(2)) $(1)
endef # The extra line is important here! don't delete it
ifneq (,$(strip $(DIRS)))
LOOP_OVER_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
endif
# we only use this for the makefiles target and other stuff that doesn't matter
ifneq (,$(strip $(PARALLEL_DIRS)))
LOOP_OVER_PARALLEL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(PARALLEL_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifneq (,$(strip $(STATIC_DIRS)))
LOOP_OVER_STATIC_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifneq (,$(strip $(TOOL_DIRS)))
LOOP_OVER_TOOL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifdef PARALLEL_DIRS
@ -719,14 +718,12 @@ SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
ifndef SUPPRESS_DEFAULT_RULES
ifdef TIERS
default all alldep::
$(EXIT_ON_ERROR) \
$(foreach tier,$(TIERS),$(MAKE) tier_$(tier); ) true
$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
else
default all::
ifneq (,$(strip $(STATIC_DIRS)))
$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); )
$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,,$(dir)))
endif
$(MAKE) export
$(MAKE) libs
@ -752,28 +749,24 @@ endif
MAKE_TIER_SUBMAKEFILES = +$(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs)))
export_tier_%:
export_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) export; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,export,$(dir)))
libs_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) libs; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,libs,$(dir)))
tools_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) tools; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,tools,$(dir)))
$(foreach tier,$(TIERS),tier_$(tier))::
@$(ECHO) "$@: $($@_staticdirs) $($@_dirs)"
@$(EXIT_ON_ERROR) \
$(foreach dir,$($@_staticdirs),$(MAKE) -C $(dir); ) true
$(foreach dir,$($@_staticdirs),$(call SUBMAKE,,$(dir)))
$(MAKE) export_$@
$(MAKE) libs_$@
@ -785,53 +778,36 @@ everything::
# Add dummy depend target for tinderboxes
depend::
ifdef ALL_PLATFORMS
all_platforms:: $(NFSPWD)
@d=`$(NFSPWD)`; \
if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; else true; fi; \
for h in $(PLATFORM_HOSTS); do \
echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\
rsh $$h -n "(chdir $$d; \
$(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \
echo DONE) &" 2>&1 > LOGS/$$h.pid & \
sleep 1; \
done
$(NFSPWD):
cd $(@D); $(MAKE) $(@F)
endif
# Target to only regenerate makefiles
makefiles: $(SUBMAKEFILES)
ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_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
+@$(UPDATE_TITLE_export) $(MAKE) -C $* export
+@$(call SUBMAKE,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)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
ifdef PARALLEL_DIRS
tools:: $(PARALLEL_DIRS_tools)
$(PARALLEL_DIRS_tools): %_tools: %/Makefile
+@$(UPDATE_TITLE_tools) $(MAKE) -C $* tools
+@$(call SUBMAKE,tools,$*)
endif
tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_DIRS)
ifneq (,$(strip $(TOOL_DIRS)))
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; )
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
endif
#
@ -866,7 +842,7 @@ ifdef PARALLEL_DIRS
libs:: $(PARALLEL_DIRS_libs)
$(PARALLEL_DIRS_libs): %_libs: %/Makefile
+@$(UPDATE_TITLE_libs) $(MAKE) -C $* libs
+@$(call SUBMAKE,libs,$*)
endif
libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY)
@ -929,7 +905,7 @@ else
endif
endif # JAVA_LIBRARY
endif # !NO_DIST_INSTALL
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_DIRS)
##############################################
@ -980,16 +956,10 @@ 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)
$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
distclean:: $(SUBMAKEFILES)
+-$(LOOP_OVER_PARALLEL_DIRS)
+-$(LOOP_OVER_DIRS)
+-$(LOOP_OVER_STATIC_DIRS)
+-$(LOOP_OVER_TOOL_DIRS)
$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
-rm -rf $(ALL_TRASH_DIRS)
-rm -f $(ALL_TRASH) \
Makefile .HSancillary \
@ -1390,7 +1360,7 @@ host_%.$(OBJ_SUFFIX): %.mm $(GLOBAL_DEPS)
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
%: %.c $(GLOBAL_DEPS)
%:: %.c $(GLOBAL_DEPS)
$(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC)
$(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTOPTION)$@ $(_VPATH_SRCS)
@ -1413,7 +1383,7 @@ endif
%.$(OBJ_SUFFIX): %.S $(GLOBAL_DEPS)
$(AS) -o $@ $(ASFLAGS) -c $<
%: %.cpp $(GLOBAL_DEPS)
%:: %.cpp $(GLOBAL_DEPS)
@$(MAKE_DEPS_AUTO_CXX)
$(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)
@ -1480,12 +1450,12 @@ endif
endif
# need 3 separate lines for OS/2
%: %.pl
%:: %.pl
rm -f $@
cp $< $@
chmod +x $@
%: %.sh
%:: %.sh
rm -f $@; cp $< $@; chmod +x $@
# Cancel these implicit rules
@ -1766,9 +1736,9 @@ export-idl:: $(XPIDLSRCS) $(SDK_XPIDLSRCS) $(IDL_DIR)
$(INSTALL) $(IFLAGS1) $^
endif
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
@ -1913,9 +1883,9 @@ JAR_MANIFEST := $(srcdir)/jar.mn
chrome::
$(MAKE) realchrome
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
$(FINAL_TARGET)/chrome:
$(NSINSTALL) -D $@
@ -2065,15 +2035,15 @@ depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES)
else
depend:: $(SUBMAKEFILES)
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(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)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
endif # MOZ_AUTO_DEPS
@ -2164,7 +2134,7 @@ endif
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
.PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one
.PHONY: all alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one
# Used as a dependency to force targets to rebuild
FORCE:
@ -2179,8 +2149,8 @@ tags: TAGS
TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
-etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-variable-%:
@echo "$($*)"
@ -2206,8 +2176,8 @@ ifdef _REPORT_ALL_DIRS
else
@$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-depth-path:
@$(topsrcdir)/build/unix/print-depth-path.sh
@ -2236,8 +2206,8 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
@echo "DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
@echo --------------------------------------------------------------------------------
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
showbuild:
@echo "MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
@ -2294,18 +2264,11 @@ showbuildmods::
@echo "Build Modules = $(BUILD_MODULES)"
@echo "Module dirs = $(BUILD_MODULE_DIRS)"
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:
@cd $(DEPTH)
$(DOXYGEN) $(DEPTH)/config/doxygen.cfg
check:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)

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

@ -257,7 +257,6 @@ ZIP = @ZIP@
XARGS = @XARGS@
STRIP = @STRIP@
DOXYGEN = @DOXYGEN@
MAKE = @MAKE@
PBBUILD_BIN = @PBBUILD@
SDP = @SDP@
NSINSTALL_BIN = @NSINSTALL_BIN@

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

@ -460,35 +460,34 @@ ifdef MOZ_UPDATE_XTERM
# Its good not to have a newline at the end of the titlebar string because it
# makes the make -s output easier to read. Echo -n does not work on all
# platforms, but we can trick sed into doing it.
UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_export = sed -e "s!Y!export in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
endif
define SUBMAKE # $(call SUBMAKE,target,directory)
@$(UPDATE_TITLE)
+@$(MAKE) $(if $(2),-C $(2)) $(1)
endef # The extra line is important here! don't delete it
ifneq (,$(strip $(DIRS)))
LOOP_OVER_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
endif
# we only use this for the makefiles target and other stuff that doesn't matter
ifneq (,$(strip $(PARALLEL_DIRS)))
LOOP_OVER_PARALLEL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(PARALLEL_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifneq (,$(strip $(STATIC_DIRS)))
LOOP_OVER_STATIC_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifneq (,$(strip $(TOOL_DIRS)))
LOOP_OVER_TOOL_DIRS = \
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,$@,$(dir)))
endif
ifdef PARALLEL_DIRS
@ -719,14 +718,12 @@ SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
ifndef SUPPRESS_DEFAULT_RULES
ifdef TIERS
default all alldep::
$(EXIT_ON_ERROR) \
$(foreach tier,$(TIERS),$(MAKE) tier_$(tier); ) true
$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
else
default all::
ifneq (,$(strip $(STATIC_DIRS)))
$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); )
$(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,,$(dir)))
endif
$(MAKE) export
$(MAKE) libs
@ -752,28 +749,24 @@ endif
MAKE_TIER_SUBMAKEFILES = +$(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs)))
export_tier_%:
export_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) export; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,export,$(dir)))
libs_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) libs; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,libs,$(dir)))
tools_tier_%:
@$(ECHO) "$@"
@$(MAKE_TIER_SUBMAKEFILES)
@$(EXIT_ON_ERROR) \
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) tools; ) true
$(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,tools,$(dir)))
$(foreach tier,$(TIERS),tier_$(tier))::
@$(ECHO) "$@: $($@_staticdirs) $($@_dirs)"
@$(EXIT_ON_ERROR) \
$(foreach dir,$($@_staticdirs),$(MAKE) -C $(dir); ) true
$(foreach dir,$($@_staticdirs),$(call SUBMAKE,,$(dir)))
$(MAKE) export_$@
$(MAKE) libs_$@
@ -785,53 +778,36 @@ everything::
# Add dummy depend target for tinderboxes
depend::
ifdef ALL_PLATFORMS
all_platforms:: $(NFSPWD)
@d=`$(NFSPWD)`; \
if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; else true; fi; \
for h in $(PLATFORM_HOSTS); do \
echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\
rsh $$h -n "(chdir $$d; \
$(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \
echo DONE) &" 2>&1 > LOGS/$$h.pid & \
sleep 1; \
done
$(NFSPWD):
cd $(@D); $(MAKE) $(@F)
endif
# Target to only regenerate makefiles
makefiles: $(SUBMAKEFILES)
ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_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
+@$(UPDATE_TITLE_export) $(MAKE) -C $* export
+@$(call SUBMAKE,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)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
ifdef PARALLEL_DIRS
tools:: $(PARALLEL_DIRS_tools)
$(PARALLEL_DIRS_tools): %_tools: %/Makefile
+@$(UPDATE_TITLE_tools) $(MAKE) -C $* tools
+@$(call SUBMAKE,tools,$*)
endif
tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_DIRS)
ifneq (,$(strip $(TOOL_DIRS)))
@$(EXIT_ON_ERROR) \
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; )
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
endif
#
@ -866,7 +842,7 @@ ifdef PARALLEL_DIRS
libs:: $(PARALLEL_DIRS_libs)
$(PARALLEL_DIRS_libs): %_libs: %/Makefile
+@$(UPDATE_TITLE_libs) $(MAKE) -C $* libs
+@$(call SUBMAKE,libs,$*)
endif
libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY)
@ -929,7 +905,7 @@ else
endif
endif # JAVA_LIBRARY
endif # !NO_DIST_INSTALL
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_DIRS)
##############################################
@ -980,16 +956,10 @@ 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)
$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
distclean:: $(SUBMAKEFILES)
+-$(LOOP_OVER_PARALLEL_DIRS)
+-$(LOOP_OVER_DIRS)
+-$(LOOP_OVER_STATIC_DIRS)
+-$(LOOP_OVER_TOOL_DIRS)
$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
-rm -rf $(ALL_TRASH_DIRS)
-rm -f $(ALL_TRASH) \
Makefile .HSancillary \
@ -1390,7 +1360,7 @@ host_%.$(OBJ_SUFFIX): %.mm $(GLOBAL_DEPS)
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
%: %.c $(GLOBAL_DEPS)
%:: %.c $(GLOBAL_DEPS)
$(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC)
$(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTOPTION)$@ $(_VPATH_SRCS)
@ -1413,7 +1383,7 @@ endif
%.$(OBJ_SUFFIX): %.S $(GLOBAL_DEPS)
$(AS) -o $@ $(ASFLAGS) -c $<
%: %.cpp $(GLOBAL_DEPS)
%:: %.cpp $(GLOBAL_DEPS)
@$(MAKE_DEPS_AUTO_CXX)
$(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)
@ -1480,12 +1450,12 @@ endif
endif
# need 3 separate lines for OS/2
%: %.pl
%:: %.pl
rm -f $@
cp $< $@
chmod +x $@
%: %.sh
%:: %.sh
rm -f $@; cp $< $@; chmod +x $@
# Cancel these implicit rules
@ -1766,9 +1736,9 @@ export-idl:: $(XPIDLSRCS) $(SDK_XPIDLSRCS) $(IDL_DIR)
$(INSTALL) $(IFLAGS1) $^
endif
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
@ -1913,9 +1883,9 @@ JAR_MANIFEST := $(srcdir)/jar.mn
chrome::
$(MAKE) realchrome
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
$(FINAL_TARGET)/chrome:
$(NSINSTALL) -D $@
@ -2065,15 +2035,15 @@ depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES)
else
depend:: $(SUBMAKEFILES)
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(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)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
endif # MOZ_AUTO_DEPS
@ -2164,7 +2134,7 @@ endif
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
.PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one
.PHONY: all alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one
# Used as a dependency to force targets to rebuild
FORCE:
@ -2179,8 +2149,8 @@ tags: TAGS
TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
-etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-variable-%:
@echo "$($*)"
@ -2206,8 +2176,8 @@ ifdef _REPORT_ALL_DIRS
else
@$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-depth-path:
@$(topsrcdir)/build/unix/print-depth-path.sh
@ -2236,8 +2206,8 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
@echo "DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
@echo --------------------------------------------------------------------------------
endif
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
showbuild:
@echo "MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
@ -2294,18 +2264,11 @@ showbuildmods::
@echo "Build Modules = $(BUILD_MODULES)"
@echo "Module dirs = $(BUILD_MODULE_DIRS)"
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:
@cd $(DEPTH)
$(DOXYGEN) $(DEPTH)/config/doxygen.cfg
check:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_PARALLEL_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)