Bug 325096 part 1 - move generic tier logic to rules.mk, so that the toplevel makefile can be split up sanely, r=mento
git-svn-id: svn://10.0.0.236/trunk@208399 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
ba38f50135
commit
777703a7f1
@ -44,34 +44,45 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/build/unix/modules.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifneq ($(MOZ_STANDALONE_BUILD),1) # {
|
||||
#
|
||||
# And now for something completely different...
|
||||
# Divide the default build into tiers.
|
||||
# Tiers must be defined on module boundaries
|
||||
#
|
||||
SUPPRESS_DEFAULT_RULES = 1
|
||||
|
||||
# Make sure that the existing rulesets work
|
||||
|
||||
DIRS += $(tier_0_dirs)
|
||||
|
||||
ifndef LIBXUL_SDK
|
||||
# only build gecko if --with-libxul-sdk isn't passed
|
||||
DIRS += \
|
||||
$(tier_1_dirs) \
|
||||
$(tier_2_dirs) \
|
||||
$(tier_9_dirs) \
|
||||
$(tier_50_dirs) \
|
||||
$(NULL)
|
||||
|
||||
endif # LIBXUL_SDK
|
||||
|
||||
ifdef GC_LEAK_DETECTOR
|
||||
DIRS += gc/boehm
|
||||
TIERS += nspr
|
||||
endif
|
||||
|
||||
DIRS += $(tier_99_dirs)
|
||||
TIERS += 0
|
||||
|
||||
ifndef LIBXUL_SDK
|
||||
TIERS += \
|
||||
1 \
|
||||
2 \
|
||||
9 \
|
||||
50 \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
TIERS += \
|
||||
99 \
|
||||
$(NULL)
|
||||
|
||||
#
|
||||
# tier NSPR
|
||||
#
|
||||
|
||||
ifdef GC_LEAK_DETECTOR
|
||||
tier_nspr_staticdirs = gc/boehm
|
||||
endif
|
||||
|
||||
ifndef MOZ_NATIVE_NSPR
|
||||
tier_nspr_staticdirs += nsprpub
|
||||
endif
|
||||
|
||||
#
|
||||
# tier 0 - base build config dirs
|
||||
@ -312,6 +323,7 @@ tier_50_dirs += tools/trace-malloc
|
||||
endif
|
||||
|
||||
ifdef MOZ_LDAP_XPCOM
|
||||
tier_50_staticdirs += directory/c-sdk
|
||||
tier_50_dirs += directory/xpcom
|
||||
endif
|
||||
|
||||
@ -464,24 +476,10 @@ tier_99_dirs += extensions/java/xpcom/interfaces
|
||||
endif
|
||||
endif
|
||||
|
||||
default alldep all:: $(SUBMAKEFILES)
|
||||
default alldep all::
|
||||
$(RM) -rf $(DIST)/sdk
|
||||
$(RM) -rf $(DIST)/include
|
||||
$(MAKE) -C config export
|
||||
ifndef LIBXUL_SDK
|
||||
$(MAKE) nspr
|
||||
endif
|
||||
$(MAKE) ldap
|
||||
$(MAKE) tier_0
|
||||
ifndef LIBXUL_SDK
|
||||
$(MAKE) tier_1
|
||||
$(MAKE) tier_2
|
||||
$(MAKE) tier_9
|
||||
$(MAKE) tier_50
|
||||
endif
|
||||
$(MAKE) tier_99
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
else # } { MOZ_STANDALONE_BUILD
|
||||
|
||||
@ -528,8 +526,6 @@ default:: $(SUBMAKEFILES)
|
||||
|
||||
endif # } BUILD_MODULES == all or MOZ_STANDALONE
|
||||
|
||||
STATIC_MAKEFILES := nsprpub directory/c-sdk security/nss
|
||||
|
||||
GARBAGE_DIRS += dist
|
||||
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
|
||||
dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
|
||||
@ -541,8 +537,7 @@ DIST_GARBAGE = config.cache config.log config.status config-defs.h \
|
||||
export::
|
||||
$(RM) -rf $(DIST)/sdk
|
||||
$(MAKE) -C config export
|
||||
$(MAKE) nspr
|
||||
$(MAKE) ldap
|
||||
$(MAKE) tier_nspr
|
||||
ifneq ($(BUILD_MODULES),all)
|
||||
ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS)))
|
||||
$(MAKE) -C xpcom/typelib
|
||||
@ -562,73 +557,19 @@ endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# Clean up after pseudo-external modules
|
||||
clean clobber realclean clobber_all distclean::
|
||||
ifndef MOZ_NATIVE_NSPR
|
||||
$(MAKE) -C nsprpub $@
|
||||
endif
|
||||
ifdef MOZ_LDAP_XPCOM
|
||||
$(MAKE) -C directory/c-sdk $@
|
||||
endif
|
||||
|
||||
# Map mozilla targets to standard automake target
|
||||
|
||||
export_tier_%:
|
||||
@echo "$@" $(if $(tier_$*_dirs),,$(error Tier $* not present))
|
||||
@$(MAKE) $(addsuffix /Makefile,$(filter-out $(STATIC_MAKEFILES),$(tier_$*_dirs)))
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(tier_$*_dirs); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d export; \
|
||||
done
|
||||
|
||||
libs_tier_%:
|
||||
@echo "$@" $(if $(tier_$*_dirs),,$(error Tier $* not present))
|
||||
@$(MAKE) $(addsuffix /Makefile,$(filter-out $(STATIC_MAKEFILES),$(tier_$*_dirs)))
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(tier_$*_dirs); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d libs; \
|
||||
done
|
||||
|
||||
tools_tier_%:
|
||||
@echo "$@" $(if $(tier_$*_dirs),,$(error Tier $* not present))
|
||||
@$(MAKE) $(addsuffix /Makefile,$(filter-out $(STATIC_MAKEFILES),$(tier_$*_dirs)))
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(tier_$*_dirs); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d tools; \
|
||||
done
|
||||
|
||||
tier_50:
|
||||
@echo "$@: $($@_dirs)"
|
||||
$(MAKE) export_tier_50
|
||||
$(MAKE) libs_tier_50
|
||||
# After we build tier 50, go back and build the tools from previous dirs
|
||||
tier_50::
|
||||
$(MAKE) tools_tier_2
|
||||
$(MAKE) tools_tier_9
|
||||
$(MAKE) tools_tier_50
|
||||
|
||||
tier_%:
|
||||
@echo "$@: $(if $($@_dirs),$($@_dirs),$(error Tier $* not present.))"
|
||||
$(MAKE) export_$@
|
||||
$(MAKE) libs_$@
|
||||
|
||||
#
|
||||
# Individual modules
|
||||
#
|
||||
boehm:
|
||||
ifdef GC_LEAK_DETECTOR
|
||||
$(MAKE) -C gc/boehm
|
||||
# Clean up after pseudo-external modules
|
||||
clean clobber realclean clobber_all distclean::
|
||||
ifneq (,$(MOZ_NATIVE_NSPR)$(LIBXUL_SDK))
|
||||
$(MAKE) -C nsprpub $@
|
||||
endif
|
||||
|
||||
nspr: boehm
|
||||
ifndef MOZ_NATIVE_NSPR
|
||||
$(MAKE) -C nsprpub
|
||||
endif
|
||||
|
||||
ldap:
|
||||
ifdef MOZ_LDAP_XPCOM
|
||||
$(MAKE) -C directory/c-sdk
|
||||
$(MAKE) -C directory/c-sdk $@
|
||||
endif
|
||||
|
||||
distclean::
|
||||
|
||||
@ -62,12 +62,6 @@ include $(topsrcdir)/config/insure.mk
|
||||
endif
|
||||
endif
|
||||
|
||||
# SUBMAKEFILES: List of Makefiles for next level down.
|
||||
# This is used to update or create the Makefiles before invoking them.
|
||||
ifneq ($(DIRS)$(TOOL_DIRS),)
|
||||
SUBMAKEFILES := $(addsuffix /Makefile, $(TOOL_DIRS) $(filter-out $(STATIC_MAKEFILES), $(DIRS)))
|
||||
endif
|
||||
|
||||
# FINAL_TARGET specifies the location into which we copy end-user-shipped
|
||||
# build products (typelibs, components, chrome).
|
||||
#
|
||||
|
||||
@ -338,34 +338,16 @@ 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)/$$d!" $(MOZILLA_DIR)/config/xterm.str;
|
||||
UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str;
|
||||
endif
|
||||
|
||||
ifdef DIRS
|
||||
LOOP_OVER_DIRS = \
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(DIRS); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d $@; \
|
||||
done
|
||||
$(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
|
||||
|
||||
LOOP_OVER_MOZ_DIRS = \
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(filter-out $(STATIC_MAKEFILES), $(DIRS)); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d $@; \
|
||||
done
|
||||
|
||||
endif
|
||||
|
||||
ifdef TOOL_DIRS
|
||||
LOOP_OVER_TOOL_DIRS = \
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(TOOL_DIRS); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d $@; \
|
||||
done
|
||||
endif
|
||||
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
|
||||
|
||||
#
|
||||
# Now we can differentiate between objects used to build a library, and
|
||||
@ -569,13 +551,29 @@ 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))
|
||||
|
||||
# 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
|
||||
# of something else. Makefiles which use this var *must* provide a sensible
|
||||
# default rule before including rules.mk
|
||||
ifndef SUPPRESS_DEFAULT_RULES
|
||||
ifdef TIERS
|
||||
|
||||
all::
|
||||
DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
|
||||
STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
|
||||
|
||||
default all alldep::
|
||||
$(EXIT_ON_ERROR) \
|
||||
$(foreach tier,$(TIERS),$(MAKE) tier_$(tier); )
|
||||
|
||||
else
|
||||
|
||||
default all::
|
||||
@$(EXIT_ON_ERROR) \
|
||||
$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); )
|
||||
$(MAKE) export
|
||||
$(MAKE) libs
|
||||
$(MAKE) tools
|
||||
@ -587,8 +585,32 @@ alldep::
|
||||
$(MAKE) libs
|
||||
$(MAKE) tools
|
||||
|
||||
endif # TIERS
|
||||
endif # SUPPRESS_DEFAULT_RULES
|
||||
|
||||
MAKE_TIER_SUBMAKEFILES = $(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs)))
|
||||
|
||||
export_tier_%:
|
||||
@$(MAKE_TIER_SUBMAKEFILES)
|
||||
@$(EXIT_ON_ERROR) \
|
||||
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) export; )
|
||||
|
||||
libs_tier_%:
|
||||
@$(MAKE_TIER_SUBMAKEFILES)
|
||||
@$(EXIT_ON_ERROR) \
|
||||
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) libs; )
|
||||
|
||||
tools_tier_%:
|
||||
@$(MAKE_TIER_SUBMAKEFILES)
|
||||
@$(EXIT_ON_ERROR) \
|
||||
$(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) tools; )
|
||||
|
||||
$(foreach tier,$(TIERS),tier_$(tier))::
|
||||
@$(EXIT_ON_ERROR) \
|
||||
$(foreach dir,$($@_staticdirs),$(MAKE) -C $(dir); )
|
||||
$(MAKE) export_$@
|
||||
$(MAKE) libs_$@
|
||||
|
||||
# Do everything from scratch
|
||||
everything::
|
||||
$(MAKE) clean
|
||||
@ -616,10 +638,8 @@ endif
|
||||
# Target to only regenerate makefiles
|
||||
makefiles: $(SUBMAKEFILES)
|
||||
ifneq (,$(DIRS)$(TOOL_DIRS))
|
||||
@for d in $(TOOL_DIRS) $(filter-out $(STATIC_MAKEFILES), $(DIRS)); do\
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d $@; \
|
||||
done
|
||||
+$(LOOP_OVER_DIRS)
|
||||
+$(LOOP_OVER_TOOL_DIRS)
|
||||
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))
|
||||
@ -630,10 +650,7 @@ tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
ifdef TOOL_DIRS
|
||||
@$(EXIT_ON_ERROR) \
|
||||
for d in $(TOOL_DIRS); do \
|
||||
$(UPDATE_TITLE) \
|
||||
$(MAKE) -C $$d libs; \
|
||||
done
|
||||
$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; )
|
||||
endif
|
||||
|
||||
#
|
||||
@ -1545,7 +1562,7 @@ JAR_MANIFEST := $(srcdir)/jar.mn
|
||||
|
||||
chrome::
|
||||
$(MAKE) realchrome
|
||||
+$(LOOP_OVER_MOZ_DIRS)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
+$(LOOP_OVER_TOOL_DIRS)
|
||||
|
||||
libs realchrome:: $(CHROME_DEPS)
|
||||
@ -1867,7 +1884,7 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
|
||||
@echo "DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
|
||||
@echo --------------------------------------------------------------------------------
|
||||
endif
|
||||
+$(LOOP_OVER_MOZ_DIRS)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
showbuild:
|
||||
@echo "MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
|
||||
@ -1922,7 +1939,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_MOZ_DIRS)
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
documentation:
|
||||
@cd $(DEPTH)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user