bug 757828: move export logic into target_export.mk - batch #1
authorJoey Armstrong <joey@mozilla.com>
Wed, 23 May 2012 11:19:24 -0400
changeset 96498 31fa915e4a920e50c2430b79a8dd74b282840921
parent 96497 9af545c94146eab35b1c1bfd0cf70d9584e865ba
child 96499 0890dcf220c7bd15bbe4d56c9329c27e8ed714f7
push id22910
push usermbrubeck@mozilla.com
push dateWed, 13 Jun 2012 01:26:32 +0000
treeherdermozilla-central@964b11fea7f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs757828
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 757828: move export logic into target_export.mk - batch #1
config/makefiles/target_export.mk
config/makefiles/test/Makefile.in
config/makefiles/test/check-export-targets.mk
config/rules.mk
js/src/config/makefiles/target_export.mk
js/src/config/rules.mk
--- a/config/makefiles/target_export.mk
+++ b/config/makefiles/target_export.mk
@@ -25,8 +25,24 @@ export:: $(PARALLEL_DIRS_export)
 
 $(PARALLEL_DIRS_export): %_export: %/Makefile
 	+@$(call SUBMAKE,export,$*)
 endif
 
 export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR))
 	$(LOOP_OVER_DIRS)
 	$(LOOP_OVER_TOOL_DIRS)
+
+
+#
+# Rule to create list of libraries for final link
+#
+# todo: use pre-req deps rather than conditionals
+export:: export-gen-final-lib-link-list
+export-gen-final-lib-link-list:
+ifdef LIBRARY_NAME   #{
+ifdef EXPORT_LIBRARY #{
+ifdef IS_COMPONENT   #{
+else # !IS_COMPONENT
+	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
+endif #} IS_COMPONENT
+endif #} EXPORT_LIBRARY
+endif #} LIBRARY_NAME
--- a/config/makefiles/test/Makefile.in
+++ b/config/makefiles/test/Makefile.in
@@ -11,22 +11,24 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 USE_AUTOTARGETS_MK  = 1
 MAKEUTILS_UNIT_TEST = 1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
 dir-ts = .deps/test
-check-arglist     = $(dir-ts)/arglist.ts
-check-autotargets = $(dir-ts)/autotargets_mk.ts
-check-XinY        = $(dir-ts)/check_XinY_mk.ts
+check-arglist        = $(dir-ts)/arglist.ts
+check-autotargets    = $(dir-ts)/autotargets_mk.ts
+check-export-targets = $(dir-ts)/export-targets-mk.ts
+check-XinY           = $(dir-ts)/check_XinY_mk.ts
 check-tests =\
   $(check-arglist) \
   $(check-autotargets) \
+  $(check-export-targets) \
   $(check-XinY) \
   $(NULL)
 
 
 ##------------------_##
 ##---]  TARGETS  [---##
 ##------------------_##
 all::
@@ -96,9 +98,27 @@ check-autotargets-preqs=\
   $(srcdir)/check-autotargets.mk \
   $(eval include $(srcdir)/check-autotargets.mk) \
   $(NULL)
 
 $(check-autotargets): $(check-autotargets-preqs)
 	@$(TOUCH) $@
 # </CHECK: autotargets.mk>
 
+
+###########################################################################
+# <CHECK: export-targets.mk>
+check-export-targets-preqs=\
+  $(call mkdir_deps,$(dir-ts)) \
+  $(topsrcdir)/config/makefiles/makeutils.mk \
+  $(topsrcdir)/config/makefiles/target_export.mk \
+  $(srcdir)/check-export-targets.mk \
+  checkup \
+  $(NULL)
+
+# include then test
+checkup: $(eval include $(srcdir)/check-export-targets.mk)
+
+$(check-export-targets): $(check-export-targets-preqs)
+	@$(TOUCH) $@
+# </CHECK: export-targets.mk>
+
 endif #} findstring check
new file mode 100644
--- /dev/null
+++ b/config/makefiles/test/check-export-targets.mk
@@ -0,0 +1,33 @@
+# -*- makefile -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+ifdef VERBOSE
+  $(warning loading test)
+endif
+
+MOZILLA_DIR ?= $(topsrcdir)
+checkup = \
+  check-final-lib-link-list \
+  $(NULL)
+
+checkup: $(checkup)
+
+
+# <CHECK: final-lib-link-list>
+LIBRARY_NAME   = foo# real_data: xptcmd
+EXPORT_LIBRARY = foo# real_data: ../..
+undefine IS_COMPONENT
+
+test-data = $(CURDIR)/check-export-targets-test-data
+FINAL_LINK_LIBS     = $(test-data)
+STATIC_LIBRARY_NAME = /dev/null
+
+check-final-lib-link-list: export-gen-final-lib-link-list
+	@cat $(test-data)
+# </CHECK: final-lib-link-list>
+
+
+include $(topsrcdir)/config/makefiles/target_export.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -621,29 +621,16 @@ ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DI
 	$(LOOP_OVER_PARALLEL_DIRS)
 	$(LOOP_OVER_DIRS)
 	$(LOOP_OVER_TOOL_DIRS)
 endif
 
 include $(topsrcdir)/config/makefiles/target_export.mk
 include $(topsrcdir)/config/makefiles/target_tools.mk
 
-#
-# Rule to create list of libraries for final link
-#
-export::
-ifdef LIBRARY_NAME
-ifdef EXPORT_LIBRARY
-ifdef IS_COMPONENT
-else # !IS_COMPONENT
-	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
-endif # IS_COMPONENT
-endif # EXPORT_LIBRARY
-endif # LIBRARY_NAME
-
 ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
 $(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
 endif
 
 HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
 
 # Dependencies which, if modified, should cause everything to rebuild
 GLOBAL_DEPS += Makefile Makefile.in $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk
--- a/js/src/config/makefiles/target_export.mk
+++ b/js/src/config/makefiles/target_export.mk
@@ -25,8 +25,24 @@ export:: $(PARALLEL_DIRS_export)
 
 $(PARALLEL_DIRS_export): %_export: %/Makefile
 	+@$(call SUBMAKE,export,$*)
 endif
 
 export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR))
 	$(LOOP_OVER_DIRS)
 	$(LOOP_OVER_TOOL_DIRS)
+
+
+#
+# Rule to create list of libraries for final link
+#
+# todo: use pre-req deps rather than conditionals
+export:: export-gen-final-lib-link-list
+export-gen-final-lib-link-list:
+ifdef LIBRARY_NAME   #{
+ifdef EXPORT_LIBRARY #{
+ifdef IS_COMPONENT   #{
+else # !IS_COMPONENT
+	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
+endif #} IS_COMPONENT
+endif #} EXPORT_LIBRARY
+endif #} LIBRARY_NAME
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -621,29 +621,16 @@ ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DI
 	$(LOOP_OVER_PARALLEL_DIRS)
 	$(LOOP_OVER_DIRS)
 	$(LOOP_OVER_TOOL_DIRS)
 endif
 
 include $(topsrcdir)/config/makefiles/target_export.mk
 include $(topsrcdir)/config/makefiles/target_tools.mk
 
-#
-# Rule to create list of libraries for final link
-#
-export::
-ifdef LIBRARY_NAME
-ifdef EXPORT_LIBRARY
-ifdef IS_COMPONENT
-else # !IS_COMPONENT
-	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
-endif # IS_COMPONENT
-endif # EXPORT_LIBRARY
-endif # LIBRARY_NAME
-
 ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
 $(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
 endif
 
 HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
 
 # Dependencies which, if modified, should cause everything to rebuild
 GLOBAL_DEPS += Makefile Makefile.in $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk