bug 757828: move export logic into target_export.mk - batch #1

This commit is contained in:
Joey Armstrong 2012-05-23 11:19:24 -04:00
parent 12fa09abc1
commit 4249f5fd38
6 changed files with 88 additions and 29 deletions

View File

@ -30,3 +30,19 @@ 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

View File

@ -16,12 +16,14 @@ 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)
@ -101,4 +103,22 @@ $(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

View File

@ -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

View File

@ -626,19 +626,6 @@ 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

View File

@ -30,3 +30,19 @@ 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

View File

@ -626,19 +626,6 @@ 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