From 9e3b3ce0789b2ae4508eb77558798ba04fb59f42 Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Wed, 29 Aug 2012 20:36:23 +0530 Subject: [PATCH] Backout bug 784262 because of Pymake bustage and GNU Make "warning: overriding commands for target". --- config/Makefile.in | 13 +-- config/makefiles/target_export.mk | 2 +- config/makefiles/test/Makefile.in | 22 ++++ config/makefiles/test/check-xpidl.mk | 43 ++++++++ config/makefiles/xpidl.mk | 60 +++++++++++ config/rules.mk | 126 ++++++++++------------- js/src/config/Makefile.in | 13 +-- js/src/config/makefiles/target_export.mk | 2 +- js/src/config/makefiles/xpidl.mk | 60 +++++++++++ js/src/config/rules.mk | 126 ++++++++++------------- 10 files changed, 307 insertions(+), 160 deletions(-) create mode 100644 config/makefiles/test/check-xpidl.mk create mode 100644 config/makefiles/xpidl.mk create mode 100644 js/src/config/makefiles/xpidl.mk diff --git a/config/Makefile.in b/config/Makefile.in index 5c7bd0da47f2..71192ef4d391 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -20,7 +20,7 @@ VISIBILITY_FLAGS = STDCXX_COMPAT = ifneq (WINNT,$(HOST_OS_ARCH)) -HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX) +HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX) HOST_CSRCS = nsinstall.c pathsub.c endif @@ -49,14 +49,6 @@ include $(topsrcdir)/config/config.mk # Do not install util programs NO_INSTALL=1 -ifneq (WINNT,$(HOST_OS_ARCH)) -export:: nsinstall$(HOST_BIN_SUFFIX) -# Ensure nsinstall is atomically created -nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM) - cp $^ $@.tmp - mv $@.tmp $@ -endif - include $(topsrcdir)/config/rules.mk HOST_CFLAGS += -DUNICODE -D_UNICODE @@ -73,6 +65,9 @@ HEADERS = \ export:: $(TARGETS) $(HEADERS) $(INSTALL) $(IFLAGS1) $(HEADERS) $(DIST)/include -$(RM) $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) +ifdef HOST_PROGRAM + $(INSTALL) $(HOST_PROGRAM) $(DIST)/bin +endif # Generate a new buildid every time we "export" in config... that's only # supposed to be once per-build! diff --git a/config/makefiles/target_export.mk b/config/makefiles/target_export.mk index cc423238772b..fd3d4e4163fa 100644 --- a/config/makefiles/target_export.mk +++ b/config/makefiles/target_export.mk @@ -27,7 +27,7 @@ $(PARALLEL_DIRS_export): %_export: %/Makefile +@$(call SUBMAKE,export,$*) endif -export:: $(SUBMAKEFILES) $(MAKE_DIRS) +export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR)) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) diff --git a/config/makefiles/test/Makefile.in b/config/makefiles/test/Makefile.in index 1e1ecc4b7ebb..56ad5b606e8d 100644 --- a/config/makefiles/test/Makefile.in +++ b/config/makefiles/test/Makefile.in @@ -20,11 +20,13 @@ 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-xpidl = $(dir-ts)/xpidl-mk.ts check-tests =\ $(check-arglist) \ $(check-autotargets) \ $(check-export-targets) \ $(check-XinY) \ + $(check-xpidl) \ $(NULL) @@ -35,6 +37,7 @@ all:: clean: $(RM) $(check-tests) + @$(MAKE) --no-print-directory -f $(srcdir)/check-xpidl.mk clean-xpidl topsrcdir=$(topsrcdir) ########################################################################### ## Logic processed at compile time so be selective about when to test @@ -121,4 +124,23 @@ $(check-export-targets): $(check-export-targets-preqs) @$(TOUCH) $@ # +########################################################################### +##{ +check-xpidl-preqs=\ + $(call mkdir_deps,$(dir-ts)) \ + $(topsrcdir)/config/config.mk \ + $(topsrcdir)/config/makefiles/makeutils.mk \ + $(topsrcdir)/config/makefiles/xpidl.mk \ + $(srcdir)/check-xpidl.mk \ + $(NULL) + +check-xpidl-args =\ + "topsrcdir=$(topsrcdir)" \ + "srcdir=$(srcdir)" \ + $(NULL) +$(check-xpidl): $(check-xpidl-preqs) + $(MAKE) -f $(srcdir)/check-xpidl.mk check-xpidl $(check-xpidl-args) + @$(TOUCH) $@ +#} + endif #} findstring MAKECMDGOAL diff --git a/config/makefiles/test/check-xpidl.mk b/config/makefiles/test/check-xpidl.mk new file mode 100644 index 000000000000..d02d06e30cce --- /dev/null +++ b/config/makefiles/test/check-xpidl.mk @@ -0,0 +1,43 @@ +# -*- 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 + +# Limit scope, we only need install_cmd= for testing +INCLUDED_AUTOCONF_MK = 1 +include $(topsrcdir)/config/config.mk + +USE_AUTOTARGETS_MK = 1 +include $(topsrcdir)/config/makefiles/makeutils.mk + +basedir = blah +DIST = $(basedir)/dist +DI = $(DIST)/include +IDL_DIR = $(basedir)/idl +INSTALL := cp + +XPIDLSRCS = $(srcdir)/check-xpidl.mk + +include $(topsrcdir)/config/makefiles/xpidl.mk + + +$(call requiredfunction,topsrcdir) +$(call requiredfunction,XPIDL_GEN_DIR) + +HIDE=@ +check-xpidl: xpidl-install-src xpidl-install-headers + $(HIDE)test -d $(DIST) || exit 90 + $(HIDE)test -f $(DI)/check-xpidl.mk || exit 91 + $(HIDE)test -f $(IDL_DIR)/check-xpidl.mk || exit 92 + +# Declare targets to avoid including rules.mk +$(DI) $(IDL_DIR): + mkdir -p $@ + +clean-xpidl: + $(RM) -r $(basedir) diff --git a/config/makefiles/xpidl.mk b/config/makefiles/xpidl.mk new file mode 100644 index 000000000000..ea9d36c8d12b --- /dev/null +++ b/config/makefiles/xpidl.mk @@ -0,0 +1,60 @@ +# -*- makefile -*- +# vim:set ts=8 sw=8 sts=8 noet: +# +# 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/. +# + +# Always declared, general use by: +# js/xpconnect/tests/idl/Makefile.in:libs +# toolkit/crashreporter/test/Makefile.in +XPIDL_GEN_DIR ?= _xpidlgen +GARBAGE_DIRS += $(XPIDL_GEN_DIR) + + +########################################################################### +## Conditional logic +########################################################################### +ifndef INCLUDED_XPIDL_MK #{ + INCLUDED_XPIDL_MK = 1 + + ifneq (,$(XPIDLSRCS)) #{ + + ifndef NO_DIST_INSTALL #{ + _xpidl-todo_ += xpidl-install-src + _xpidl-todo_ += xpidl-install-headers + endif #} + + endif #} XPIDLSRCS + + export:: $(_xpidl-todo_) + + $(call requiredfunction,mkdir_deps) +endif #} INCLUDED_XPIDL_MK + + +########################################################################### +## processing targets +########################################################################### +ifdef _xpidl-todo_ #{ + +$(call requiredfunction,install_cmd) + +## Logic batch #1 +xpidl-install-src-preqs=\ + $(XPIDLSRCS) \ + $(call mkdir_deps,$(IDL_DIR)) \ + $(NULL) + +xpidl-install-src: $(xpidl-install-src-preqs) + $(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val)))) + +xpidl-install-headers-preqs =\ + $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) \ + $(call mkdir_deps,$(DIST)/include) \ + $(NULL) +xpidl-install-headers: $(xpidl-install-headers-preqs) + $(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val)))) + +endif #} _xpidl-todo_ diff --git a/config/rules.mk b/config/rules.mk index b6cd5b4aad7c..a2e4584a98bb 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1159,19 +1159,15 @@ endif ifndef NO_DIST_INSTALL ifneq (,$(EXPORTS)) -EXPORTS_FILES := $(EXPORTS) -EXPORTS_DEST := $(DIST)/include -EXPORTS_TARGET := export -INSTALL_TARGETS += EXPORTS +export:: $(EXPORTS) + $(call install_cmd,$(IFLAGS1) $^ $(DIST)/include) endif endif # NO_DIST_INSTALL define EXPORT_NAMESPACE_RULE ifndef NO_DIST_INSTALL -EXPORTS_$(namespace)_FILES := $$(EXPORTS_$(namespace)) -EXPORTS_$(namespace)_DEST := $$(DIST)/include/$(namespace) -EXPORTS_$(namespace)_TARGET := export -INSTALL_TARGETS += EXPORTS_$(namespace) +export:: $(EXPORTS_$(namespace)) + $(call install_cmd,$(IFLAGS1) $$^ $(DIST)/include/$(namespace)) endif # NO_DIST_INSTALL endef @@ -1207,12 +1203,14 @@ endif # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig ifneq ($(AUTOCFG_JS_EXPORTS),) +$(FINAL_TARGET)/defaults/autoconfig:: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -AUTOCFG_JS_EXPORTS_FILES := $(AUTOCFG_JS_EXPORTS) -AUTOCFG_JS_EXPORTS_DEST := $(FINAL_TARGET)/defaults/autoconfig -AUTOCFG_JS_EXPORTS_TARGET := export -INSTALL_TARGETS += AUTOCFG_JS_EXPORTS +export:: $(AUTOCFG_JS_EXPORTS) $(FINAL_TARGET)/defaults/autoconfig + $(call install_cmd,$(IFLAGS1) $^) endif + endif ################################################################################ @@ -1273,11 +1271,9 @@ $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$( $(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS)) endif # XPIDL_MODULE.xpt != XPIDLSRCS +libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt ifndef NO_DIST_INSTALL -XPIDL_MODULE_FILES := $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt -XPIDL_MODULE_DEST := $(FINAL_TARGET)/components -INSTALL_TARGETS += XPIDL_MODULE - + $(call install_cmd,$(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(FINAL_TARGET)/components) ifndef NO_INTERFACES_MANIFEST libs:: $(call mkdir_deps,$(FINAL_TARGET)/components) @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/interfaces.manifest "interfaces $(XPIDL_MODULE).xpt" @@ -1287,22 +1283,26 @@ endif GARBAGE_DIRS += $(XPIDL_GEN_DIR) -ifndef NO_DIST_INSTALL -XPIDL_HEADERS_FILES := $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) -XPIDL_HEADERS_DEST := $(DIST)/include -XPIDL_HEADERS_TARGET := export -INSTALL_TARGETS += XPIDL_HEADERS - -XPIDLSRCS_FILES := $(XPIDLSRCS) -XPIDLSRCS_DEST := $(IDL_DIR) -XPIDLSRCS_TARGET := export-idl -INSTALL_TARGETS += XPIDLSRCS - -export:: export-idl -endif endif #} XPIDLSRCS + +ifndef INCLUDED_XPIDL_MK + include $(topsrcdir)/config/makefiles/xpidl.mk +endif + + +# General rules for exporting idl files. +$(IDL_DIR): + $(NSINSTALL) -D $@ + export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS) + +ifneq ($(XPIDLSRCS),) +ifndef NO_DIST_INSTALL +export-idl:: $(XPIDLSRCS) $(IDL_DIR) + $(call install_cmd,$(IFLAGS1) $^) +endif +endif $(LOOP_OVER_PARALLEL_DIRS) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) @@ -1320,9 +1320,7 @@ endif ifdef EXTRA_COMPONENTS libs:: $(EXTRA_COMPONENTS) ifndef NO_DIST_INSTALL -EXTRA_COMPONENTS_FILES := $(EXTRA_COMPONENTS) -EXTRA_COMPONENTS_DEST := $(FINAL_TARGET)/components -INSTALL_TARGETS += EXTRA_COMPONENTS + $(call install_cmd,$(IFLAGS1) $^ $(FINAL_TARGET)/components) endif endif @@ -1346,11 +1344,11 @@ endif JS_MODULES_PATH ?= $(FINAL_TARGET)/modules ifdef EXTRA_JS_MODULES +libs:: $(EXTRA_JS_MODULES) ifndef NO_DIST_INSTALL -EXTRA_JS_MODULES_FILES := $(EXTRA_JS_MODULES) -EXTRA_JS_MODULES_DEST := $(JS_MODULES_PATH) -INSTALL_TARGETS += EXTRA_JS_MODULES + $(call install_cmd,$(IFLAGS1) $^ $(JS_MODULES_PATH)) endif + endif ifdef EXTRA_PP_JS_MODULES @@ -1372,10 +1370,9 @@ testmodulesdir = $(DEPTH)/_tests/modules/$(TESTING_JS_MODULE_DIR) GENERATED_DIRS += $(testmodulesdir) +libs:: $(TESTING_JS_MODULES) ifndef NO_DIST_INSTALL -TESTING_JS_MODULES_FILES := $(TESTING_JS_MODULES) -TESTING_JS_MODULES_DEST := $(testmodulesdir) -INSTALL_TARGETS += TESTING_JS_MODULES + $(call install_cmd,$(IFLAGS) $^ $(testmodulesdir)) endif endif @@ -1384,19 +1381,25 @@ endif # SDK ifneq (,$(SDK_LIBRARY)) +$(SDK_LIB_DIR):: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -SDK_LIBRARY_FILES := $(SDK_LIBRARY) -SDK_LIBRARY_DEST := $(SDK_LIB_DIR) -INSTALL_TARGETS += SDK_LIBRARY +libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR) + $(call install_cmd,$(IFLAGS2) $^) endif + endif # SDK_LIBRARY ifneq (,$(strip $(SDK_BINARY))) +$(SDK_BIN_DIR):: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -SDK_BINARY_FILES := $(SDK_BINARY) -SDK_BINARY_DEST := $(SDK_BIN_DIR) -INSTALL_TARGETS += SDK_BINARY +libs:: $(SDK_BINARY) $(SDK_BIN_DIR) + $(call install_cmd,$(IFLAGS2) $^) endif + endif # SDK_BINARY ################################################################################ @@ -1532,39 +1535,25 @@ endif # Install/copy rules # # The INSTALL_TARGETS variable contains a list of all install target -# categories. Each category defines a list of files and executables, and an -# install destination, +# categories. Each category defines a list of files, an install destination, +# and whether the files are executables or not. # # FOO_FILES := foo bar # FOO_EXECUTABLES := baz # FOO_DEST := target_path # INSTALL_TARGETS += FOO -# -# Additionally, a FOO_TARGET variable may be added to indicate the target for -# which the files and executables are installed. Default is "libs". - -# If we're using binary nsinstall and it's not built yet, fallback to python nsinstall. -ifneq (,$(filter $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX),$(install_cmd))) -nsinstall_is_usable = $(if $(wildcard $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)),$(eval nsinstall_is_usable := yes)yes) - -define install_cmd_override -$(1): install_cmd = $$(if $$(nsinstall_is_usable),$$(INSTALL),$$(NSINSTALL_PY)) $$(1) -endef -endif - define install_file_template -$(or $(3),libs):: $(2)/$(notdir $(1)) -$(call install_cmd_override,$(2)/$(notdir $(1))) +libs:: $(2)/$(notdir $(1)) $(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) - $$(call install_cmd,$(4) $$< $${@D}) + $(INSTALL) $(3) $$< $${@D} endef $(foreach category,$(INSTALL_TARGETS),\ $(if $($(category)_DEST),,$(error Missing $(category)_DEST))\ $(foreach file,$($(category)_FILES),\ - $(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS1)))\ + $(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS1)))\ )\ $(foreach file,$($(category)_EXECUTABLES),\ - $(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS2)))\ + $(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS2)))\ )\ ) @@ -1578,22 +1567,19 @@ $(foreach category,$(INSTALL_TARGETS),\ # FOO_PATH := target_path # FOO_FLAGS := -Dsome_flag # PP_TARGETS += FOO -# -# Additionally, a FOO_TARGET variable may be added to indicate the target for -# which the files and executables are installed. Default is "libs". # preprocess_file_template defines preprocessing rules. # $(call preprocess_file_template, source_file, target_path, extra_flags) define preprocess_file_template $(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) $$(GLOBAL_DEPS) $$(RM) $$@ - $$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(4) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@ -$(or $(3),libs):: $(2)/$(notdir $(1)) + $$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(3) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@ +libs:: $(2)/$(notdir $(1)) endef $(foreach category,$(PP_TARGETS),\ $(foreach file,$($(category)),\ - $(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_TARGET),$($(category)_FLAGS)))\ + $(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_FLAGS)))\ )\ ) diff --git a/js/src/config/Makefile.in b/js/src/config/Makefile.in index afdce6a05c02..4ed174ee56f3 100644 --- a/js/src/config/Makefile.in +++ b/js/src/config/Makefile.in @@ -15,7 +15,7 @@ include $(DEPTH)/config/autoconf.mk VISIBILITY_FLAGS = ifneq (WINNT,$(HOST_OS_ARCH)) -HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX) +HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX) HOST_CSRCS = nsinstall.c pathsub.c endif @@ -41,19 +41,14 @@ ifneq (,$(JS_SHARED_LIBRARY)$(MOZ_NATIVE_ZLIB)) DEFINES += -DMOZ_NATIVE_ZLIB=1 endif -ifneq (WINNT,$(HOST_OS_ARCH)) -export:: nsinstall$(HOST_BIN_SUFFIX) -# Ensure nsinstall is atomically created -nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM) - cp $^ $@.tmp - mv $@.tmp $@ -endif - include $(topsrcdir)/config/rules.mk HOST_CFLAGS += -DUNICODE -D_UNICODE export:: $(TARGETS) +ifdef HOST_PROGRAM + $(INSTALL) $(HOST_PROGRAM) $(DIST)/bin +endif ifdef WRAP_SYSTEM_INCLUDES export:: \ diff --git a/js/src/config/makefiles/target_export.mk b/js/src/config/makefiles/target_export.mk index cc423238772b..fd3d4e4163fa 100644 --- a/js/src/config/makefiles/target_export.mk +++ b/js/src/config/makefiles/target_export.mk @@ -27,7 +27,7 @@ $(PARALLEL_DIRS_export): %_export: %/Makefile +@$(call SUBMAKE,export,$*) endif -export:: $(SUBMAKEFILES) $(MAKE_DIRS) +export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR)) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) diff --git a/js/src/config/makefiles/xpidl.mk b/js/src/config/makefiles/xpidl.mk new file mode 100644 index 000000000000..ea9d36c8d12b --- /dev/null +++ b/js/src/config/makefiles/xpidl.mk @@ -0,0 +1,60 @@ +# -*- makefile -*- +# vim:set ts=8 sw=8 sts=8 noet: +# +# 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/. +# + +# Always declared, general use by: +# js/xpconnect/tests/idl/Makefile.in:libs +# toolkit/crashreporter/test/Makefile.in +XPIDL_GEN_DIR ?= _xpidlgen +GARBAGE_DIRS += $(XPIDL_GEN_DIR) + + +########################################################################### +## Conditional logic +########################################################################### +ifndef INCLUDED_XPIDL_MK #{ + INCLUDED_XPIDL_MK = 1 + + ifneq (,$(XPIDLSRCS)) #{ + + ifndef NO_DIST_INSTALL #{ + _xpidl-todo_ += xpidl-install-src + _xpidl-todo_ += xpidl-install-headers + endif #} + + endif #} XPIDLSRCS + + export:: $(_xpidl-todo_) + + $(call requiredfunction,mkdir_deps) +endif #} INCLUDED_XPIDL_MK + + +########################################################################### +## processing targets +########################################################################### +ifdef _xpidl-todo_ #{ + +$(call requiredfunction,install_cmd) + +## Logic batch #1 +xpidl-install-src-preqs=\ + $(XPIDLSRCS) \ + $(call mkdir_deps,$(IDL_DIR)) \ + $(NULL) + +xpidl-install-src: $(xpidl-install-src-preqs) + $(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val)))) + +xpidl-install-headers-preqs =\ + $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) \ + $(call mkdir_deps,$(DIST)/include) \ + $(NULL) +xpidl-install-headers: $(xpidl-install-headers-preqs) + $(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val)))) + +endif #} _xpidl-todo_ diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index b6cd5b4aad7c..a2e4584a98bb 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -1159,19 +1159,15 @@ endif ifndef NO_DIST_INSTALL ifneq (,$(EXPORTS)) -EXPORTS_FILES := $(EXPORTS) -EXPORTS_DEST := $(DIST)/include -EXPORTS_TARGET := export -INSTALL_TARGETS += EXPORTS +export:: $(EXPORTS) + $(call install_cmd,$(IFLAGS1) $^ $(DIST)/include) endif endif # NO_DIST_INSTALL define EXPORT_NAMESPACE_RULE ifndef NO_DIST_INSTALL -EXPORTS_$(namespace)_FILES := $$(EXPORTS_$(namespace)) -EXPORTS_$(namespace)_DEST := $$(DIST)/include/$(namespace) -EXPORTS_$(namespace)_TARGET := export -INSTALL_TARGETS += EXPORTS_$(namespace) +export:: $(EXPORTS_$(namespace)) + $(call install_cmd,$(IFLAGS1) $$^ $(DIST)/include/$(namespace)) endif # NO_DIST_INSTALL endef @@ -1207,12 +1203,14 @@ endif # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig ifneq ($(AUTOCFG_JS_EXPORTS),) +$(FINAL_TARGET)/defaults/autoconfig:: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -AUTOCFG_JS_EXPORTS_FILES := $(AUTOCFG_JS_EXPORTS) -AUTOCFG_JS_EXPORTS_DEST := $(FINAL_TARGET)/defaults/autoconfig -AUTOCFG_JS_EXPORTS_TARGET := export -INSTALL_TARGETS += AUTOCFG_JS_EXPORTS +export:: $(AUTOCFG_JS_EXPORTS) $(FINAL_TARGET)/defaults/autoconfig + $(call install_cmd,$(IFLAGS1) $^) endif + endif ################################################################################ @@ -1273,11 +1271,9 @@ $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$( $(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS)) endif # XPIDL_MODULE.xpt != XPIDLSRCS +libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt ifndef NO_DIST_INSTALL -XPIDL_MODULE_FILES := $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt -XPIDL_MODULE_DEST := $(FINAL_TARGET)/components -INSTALL_TARGETS += XPIDL_MODULE - + $(call install_cmd,$(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(FINAL_TARGET)/components) ifndef NO_INTERFACES_MANIFEST libs:: $(call mkdir_deps,$(FINAL_TARGET)/components) @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/interfaces.manifest "interfaces $(XPIDL_MODULE).xpt" @@ -1287,22 +1283,26 @@ endif GARBAGE_DIRS += $(XPIDL_GEN_DIR) -ifndef NO_DIST_INSTALL -XPIDL_HEADERS_FILES := $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) -XPIDL_HEADERS_DEST := $(DIST)/include -XPIDL_HEADERS_TARGET := export -INSTALL_TARGETS += XPIDL_HEADERS - -XPIDLSRCS_FILES := $(XPIDLSRCS) -XPIDLSRCS_DEST := $(IDL_DIR) -XPIDLSRCS_TARGET := export-idl -INSTALL_TARGETS += XPIDLSRCS - -export:: export-idl -endif endif #} XPIDLSRCS + +ifndef INCLUDED_XPIDL_MK + include $(topsrcdir)/config/makefiles/xpidl.mk +endif + + +# General rules for exporting idl files. +$(IDL_DIR): + $(NSINSTALL) -D $@ + export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS) + +ifneq ($(XPIDLSRCS),) +ifndef NO_DIST_INSTALL +export-idl:: $(XPIDLSRCS) $(IDL_DIR) + $(call install_cmd,$(IFLAGS1) $^) +endif +endif $(LOOP_OVER_PARALLEL_DIRS) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) @@ -1320,9 +1320,7 @@ endif ifdef EXTRA_COMPONENTS libs:: $(EXTRA_COMPONENTS) ifndef NO_DIST_INSTALL -EXTRA_COMPONENTS_FILES := $(EXTRA_COMPONENTS) -EXTRA_COMPONENTS_DEST := $(FINAL_TARGET)/components -INSTALL_TARGETS += EXTRA_COMPONENTS + $(call install_cmd,$(IFLAGS1) $^ $(FINAL_TARGET)/components) endif endif @@ -1346,11 +1344,11 @@ endif JS_MODULES_PATH ?= $(FINAL_TARGET)/modules ifdef EXTRA_JS_MODULES +libs:: $(EXTRA_JS_MODULES) ifndef NO_DIST_INSTALL -EXTRA_JS_MODULES_FILES := $(EXTRA_JS_MODULES) -EXTRA_JS_MODULES_DEST := $(JS_MODULES_PATH) -INSTALL_TARGETS += EXTRA_JS_MODULES + $(call install_cmd,$(IFLAGS1) $^ $(JS_MODULES_PATH)) endif + endif ifdef EXTRA_PP_JS_MODULES @@ -1372,10 +1370,9 @@ testmodulesdir = $(DEPTH)/_tests/modules/$(TESTING_JS_MODULE_DIR) GENERATED_DIRS += $(testmodulesdir) +libs:: $(TESTING_JS_MODULES) ifndef NO_DIST_INSTALL -TESTING_JS_MODULES_FILES := $(TESTING_JS_MODULES) -TESTING_JS_MODULES_DEST := $(testmodulesdir) -INSTALL_TARGETS += TESTING_JS_MODULES + $(call install_cmd,$(IFLAGS) $^ $(testmodulesdir)) endif endif @@ -1384,19 +1381,25 @@ endif # SDK ifneq (,$(SDK_LIBRARY)) +$(SDK_LIB_DIR):: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -SDK_LIBRARY_FILES := $(SDK_LIBRARY) -SDK_LIBRARY_DEST := $(SDK_LIB_DIR) -INSTALL_TARGETS += SDK_LIBRARY +libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR) + $(call install_cmd,$(IFLAGS2) $^) endif + endif # SDK_LIBRARY ifneq (,$(strip $(SDK_BINARY))) +$(SDK_BIN_DIR):: + $(NSINSTALL) -D $@ + ifndef NO_DIST_INSTALL -SDK_BINARY_FILES := $(SDK_BINARY) -SDK_BINARY_DEST := $(SDK_BIN_DIR) -INSTALL_TARGETS += SDK_BINARY +libs:: $(SDK_BINARY) $(SDK_BIN_DIR) + $(call install_cmd,$(IFLAGS2) $^) endif + endif # SDK_BINARY ################################################################################ @@ -1532,39 +1535,25 @@ endif # Install/copy rules # # The INSTALL_TARGETS variable contains a list of all install target -# categories. Each category defines a list of files and executables, and an -# install destination, +# categories. Each category defines a list of files, an install destination, +# and whether the files are executables or not. # # FOO_FILES := foo bar # FOO_EXECUTABLES := baz # FOO_DEST := target_path # INSTALL_TARGETS += FOO -# -# Additionally, a FOO_TARGET variable may be added to indicate the target for -# which the files and executables are installed. Default is "libs". - -# If we're using binary nsinstall and it's not built yet, fallback to python nsinstall. -ifneq (,$(filter $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX),$(install_cmd))) -nsinstall_is_usable = $(if $(wildcard $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)),$(eval nsinstall_is_usable := yes)yes) - -define install_cmd_override -$(1): install_cmd = $$(if $$(nsinstall_is_usable),$$(INSTALL),$$(NSINSTALL_PY)) $$(1) -endef -endif - define install_file_template -$(or $(3),libs):: $(2)/$(notdir $(1)) -$(call install_cmd_override,$(2)/$(notdir $(1))) +libs:: $(2)/$(notdir $(1)) $(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) - $$(call install_cmd,$(4) $$< $${@D}) + $(INSTALL) $(3) $$< $${@D} endef $(foreach category,$(INSTALL_TARGETS),\ $(if $($(category)_DEST),,$(error Missing $(category)_DEST))\ $(foreach file,$($(category)_FILES),\ - $(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS1)))\ + $(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS1)))\ )\ $(foreach file,$($(category)_EXECUTABLES),\ - $(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS2)))\ + $(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS2)))\ )\ ) @@ -1578,22 +1567,19 @@ $(foreach category,$(INSTALL_TARGETS),\ # FOO_PATH := target_path # FOO_FLAGS := -Dsome_flag # PP_TARGETS += FOO -# -# Additionally, a FOO_TARGET variable may be added to indicate the target for -# which the files and executables are installed. Default is "libs". # preprocess_file_template defines preprocessing rules. # $(call preprocess_file_template, source_file, target_path, extra_flags) define preprocess_file_template $(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) $$(GLOBAL_DEPS) $$(RM) $$@ - $$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(4) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@ -$(or $(3),libs):: $(2)/$(notdir $(1)) + $$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(3) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@ +libs:: $(2)/$(notdir $(1)) endef $(foreach category,$(PP_TARGETS),\ $(foreach file,$($(category)),\ - $(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_TARGET),$($(category)_FLAGS)))\ + $(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_FLAGS)))\ )\ )