Bug 739710 - Makefile.in edits to use mkdir_deps function: file batch #2. r=ted
authorJoey Armstrong <joey@mozilla.com>
Thu, 03 May 2012 06:22:33 -0400
changeset 92986 054b137b9dc216d579eb15d2fa1f23408189a3f5
parent 92985 e8f2963571b483be2cd22ca98b83f208704d2bdc
child 92987 b9f8ed5624e034d0cd4c464ec8ece431fbcbf8b8
push idunknown
push userunknown
push dateunknown
reviewersted
bugs739710
milestone15.0a1
Bug 739710 - Makefile.in edits to use mkdir_deps function: file batch #2. r=ted
browser/app/Makefile.in
config/makefiles/autotargets.mk
ipc/app/Makefile.in
ipc/chromium/Makefile.in
js/src/config/makefiles/autotargets.mk
mobile/android/app/Makefile.in
mobile/android/base/Makefile.in
testing/mochitest/specialpowers/Makefile.in
tools/update-packaging/Makefile.in
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -196,20 +196,24 @@ clean clobber repackage::
 	$(RM) -r $(dist_dest)
 
 ifdef LIBXUL_SDK
 APPFILES = Resources
 else
 APPFILES = MacOS
 endif
 
-libs repackage:: $(PROGRAM)
-	$(MKDIR) -p $(dist_dest)/Contents/MacOS
+libs-preqs = \
+  $(call mkdir_deps,$(dist_dest)/Contents/MacOS) \
+  $(call mkdir_deps,$(dist_dest)/Contents/Resources/$(AB).lproj) \
+  $(NULL)
+
+.PHONY: repackage
+libs repackage:: $(PROGRAM) $(libs-preqs)
 	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj
-	$(MKDIR) -p $(dist_dest)/Contents/Resources/$(AB).lproj
 	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj
 	sed -e "s/%APP_VERSION%/$(MOZ_APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(dist_dest)/Contents/Info.plist
 	sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings
 	rsync -a $(DIST)/bin/ $(dist_dest)/Contents/$(APPFILES)
 ifdef LIBXUL_SDK
 	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(dist_dest)/Contents/MacOS/firefox
 else
 	$(RM) $(dist_dest)/Contents/MacOS/$(PROGRAM)
--- a/config/makefiles/autotargets.mk
+++ b/config/makefiles/autotargets.mk
@@ -1,50 +1,53 @@
 # -*- 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/.
 #
 
+ifndef INCLUDED_AUTOTARGETS_MK #{
+
+# Conditional does not wrap the entire file so multiple
+# includes will be able to accumulate dependencies.
+
 ###########################################################################
 #      AUTO_DEPS - A list of deps/targets drived from other macros.
-#         *_DEPS - Make dependencies derived from a given macro.
 ###########################################################################
 
 MKDIR ?= mkdir -p
 TOUCH ?= touch
 
 ###########################################################################
 # Threadsafe directory creation
 # GENERATED_DIRS - Automated creation of these directories.
 ###########################################################################
 mkdir_deps =$(foreach dir,$(getargv),$(dir)/.mkdir.done)
 
-ifneq (,$(GENERATED_DIRS))
-  tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
-  GENERATED_DIRS_DEPS +=$(tmpauto)
-  GARBAGE_DIRS        +=$(tmpauto)
-endif
-
-## Only define rules once
-ifndef INCLUDED_AUTOTARGETS_MK
-
 %/.mkdir.done: # mkdir -p -p => mkdir -p
 	$(subst $(SPACE)-p,$(null),$(MKDIR)) -p $(dir $@)
 	@$(TOUCH) $@
 
 # A handful of makefiles are attempting "mkdir dot".  Likely not intended
 # or stale logic so add a stub target to handle the request and warn for now.
 .mkdir.done:
 	@echo "WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)"
 	@$(TOUCH) $@
 
 INCLUDED_AUTOTARGETS_MK = 1
+endif #}
+
+
+## Accumulate deps and cleanup
+ifneq (,$(GENERATED_DIRS))
+  tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
+  GENERATED_DIRS_DEPS +=$(tmpauto)
+  GARBAGE_DIRS        +=$(tmpauto)
 endif
 
 #################################################################
 # One ring/dep to rule them all:
 #   config/rules.mk::all target is available by default
 #   Add $(AUTO_DEPS) as an explicit target dependency when needed.
 #################################################################
 
--- a/ipc/app/Makefile.in
+++ b/ipc/app/Makefile.in
@@ -42,22 +42,19 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = ipc
 
 include $(topsrcdir)/ipc/app/defs.mk
 PROGRAM = $(MOZ_CHILD_PROCESS_NAME)
 
-$(PROGRAM): $(dir $(PROGRAM))
-
-$(dir $(PROGRAM)):
-	mkdir $@
-
-GARBAGE_DIRS += $(dir $(PROGRAM))
+ifneq ($(dir $(PROGRAM)),./)
+  GENERATED_DIRS = $(dir $(PROGRAM))
+endif
 
 CPPSRCS = \
   MozillaRuntimeMain.cpp \
   $(NULL)
 
 ifeq (Android,$(OS_TARGET))
 WRAP_LDFLAGS =
 CPPSRCS = MozillaRuntimeMainAndroid.cpp
--- a/ipc/chromium/Makefile.in
+++ b/ipc/chromium/Makefile.in
@@ -326,12 +326,17 @@ endif # }
 endif # }
 endif # }
 
 OS_CXXFLAGS += $(TK_CFLAGS)
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_NATIVE_LIBEVENT # {
-export::
-	mkdir -p $(DIST)/third_party/libevent
+
+export-preqs = \
+  $(call mkdir_deps,$(DIST)/third_party/libevent) \
+  $(NULL)
+
+export:: $(export-preqs)
 	echo "#include <event.h>" > $(DIST)/third_party/libevent/event.h
+
 endif # }
--- a/js/src/config/makefiles/autotargets.mk
+++ b/js/src/config/makefiles/autotargets.mk
@@ -1,50 +1,53 @@
 # -*- 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/.
 #
 
+ifndef INCLUDED_AUTOTARGETS_MK #{
+
+# Conditional does not wrap the entire file so multiple
+# includes will be able to accumulate dependencies.
+
 ###########################################################################
 #      AUTO_DEPS - A list of deps/targets drived from other macros.
-#         *_DEPS - Make dependencies derived from a given macro.
 ###########################################################################
 
 MKDIR ?= mkdir -p
 TOUCH ?= touch
 
 ###########################################################################
 # Threadsafe directory creation
 # GENERATED_DIRS - Automated creation of these directories.
 ###########################################################################
 mkdir_deps =$(foreach dir,$(getargv),$(dir)/.mkdir.done)
 
-ifneq (,$(GENERATED_DIRS))
-  tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
-  GENERATED_DIRS_DEPS +=$(tmpauto)
-  GARBAGE_DIRS        +=$(tmpauto)
-endif
-
-## Only define rules once
-ifndef INCLUDED_AUTOTARGETS_MK
-
 %/.mkdir.done: # mkdir -p -p => mkdir -p
 	$(subst $(SPACE)-p,$(null),$(MKDIR)) -p $(dir $@)
 	@$(TOUCH) $@
 
 # A handful of makefiles are attempting "mkdir dot".  Likely not intended
 # or stale logic so add a stub target to handle the request and warn for now.
 .mkdir.done:
 	@echo "WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)"
 	@$(TOUCH) $@
 
 INCLUDED_AUTOTARGETS_MK = 1
+endif #}
+
+
+## Accumulate deps and cleanup
+ifneq (,$(GENERATED_DIRS))
+  tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
+  GENERATED_DIRS_DEPS +=$(tmpauto)
+  GARBAGE_DIRS        +=$(tmpauto)
 endif
 
 #################################################################
 # One ring/dep to rule them all:
 #   config/rules.mk::all target is available by default
 #   Add $(AUTO_DEPS) as an explicit target dependency when needed.
 #################################################################
 
--- a/mobile/android/app/Makefile.in
+++ b/mobile/android/app/Makefile.in
@@ -121,20 +121,24 @@ clean clobber repackage::
 	$(RM) -r $(dist_dest)
 
 ifdef LIBXUL_SDK
 APPFILES = Resources
 else
 APPFILES = MacOS
 endif
 
-libs repackage::
-	mkdir -p $(dist_dest)/Contents/MacOS
+libs-preqs = \
+  $(call mkdir_deps,$(dist_dest)/Contents/MacOS) \
+  $(call mkdir_deps,$(dist_dest)/Contents/Resources/$(AB).lproj) \
+  $(NULL)
+
+.PHONY: repackage
+libs repackage:: $(libs-preqs)
 	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj
-	mkdir -p $(dist_dest)/Contents/Resources/$(AB).lproj
 	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj
 	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%APP_BINARY%/$(APP_BINARY)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(dist_dest)/Contents/Info.plist
 	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings
 	rsync -a $(DIST)/bin/ $(dist_dest)/Contents/$(APPFILES)
 	$(RM) $(dist_dest)/Contents/$(APPFILES)/mangle $(dist_dest)/Contents/$(APPFILES)/shlibsign
 ifdef LIBXUL_SDK
 	cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(dist_dest)/Contents/MacOS/$(APP_BINARY)
 	rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -686,18 +686,30 @@ PP_RES_XML= \
 # This is kinda awful; if any of the source files change, we remake them all.
 $(PP_RES_XML): $(patsubst res/%,$(srcdir)/resources/%.in,$(PP_RES_XML))
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
              $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $(subst res,$(srcdir)/resources,$@).in > $@
 
 # AndroidManifest.xml includes these files, so they need to be marked as dependencies.
 SYNC_MANIFEST_FRAGMENTS = $(wildcard $(topsrcdir)/mobile/android/sync/manifests/*.in)
 
-AndroidManifest.xml $(FENNEC_PP_JAVA_FILES) $(SYNC_PP_JAVA_FILES) package-name.txt: % : %.in Makefile.in $(SYNC_MANIFEST_FRAGMENTS)
-	mkdir -p db sync/repositories/android
+android-tgts = \
+  AndroidManifest.xml \
+  $(FENNEC_PP_JAVA_FILES) \
+  $(SYNC_PP_JAVA_FILES) \
+  package-name.txt \
+  $(NULL)
+
+android-preqs = \
+  Makefile.in \
+  $(call mkdir_deps,db,sync/repositories/android) \
+  $(SYNC_MANIFEST_FRAGMENTS) \
+  $(NULL)
+
+$(android-tgts): % : %.in $(android-preqs)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
              $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
 
 res/drawable/icon.png: $(MOZ_APP_ICON)
 	$(NSINSTALL) -D res/drawable
 	cp $(ICON_PATH) $@
 
 res/drawable-hdpi/icon.png: $(MOZ_APP_ICON)
--- a/testing/mochitest/specialpowers/Makefile.in
+++ b/testing/mochitest/specialpowers/Makefile.in
@@ -56,11 +56,14 @@ XPI_NAME=specialpowers
 
 # Used in install.rdf
 USE_EXTENSION_MANIFEST=1
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 include $(topsrcdir)/config/rules.mk
 
-libs::
-	$(MKDIR) -p $(TEST_EXTENSIONS_DIR)
+libs-preqs = \
+  $(call mkdir_deps,$(TEST_EXTENSIONS_DIR)) \
+  $(NULL)
+
+libs:: $(libs-preqs)
 	(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/tools/update-packaging/Makefile.in
+++ b/tools/update-packaging/Makefile.in
@@ -83,33 +83,33 @@ include $(topsrcdir)/toolkit/mozapps/ins
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
 # We can't use signcode on mar files
 MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT))
 MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT)
 endif
 
-complete-patch::
+dir-stage := $(call mkdir_deps,$(STAGE_DIR))
+
+complete-patch:: $(dir-stage)
 ifeq ($(OS_TARGET), WINNT)
 	test -f $(UNPACKAGE)
 	$(RM) -rf "$(PACKAGE_DIR)"
 	cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE)
 endif
-	mkdir -p $(STAGE_DIR)
 	MAR=$(MAR_BIN) \
 	  $(srcdir)/make_full_update.sh \
 	  "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).complete.mar" \
 	  "$(PACKAGE_DIR)"
 ifdef MOZ_SIGN_PACKAGE_CMD
 	$(MOZ_SIGN_PACKAGE_CMD) "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).complete.mar"
 endif
 
-partial-patch::
-	mkdir -p $(STAGE_DIR)
+partial-patch:: $(dir-stage)
 	MAR=$(MAR_BIN) \
 	MBSDIFF=$(MBSDIFF_BIN) \
 	  $(srcdir)/make_incremental_update.sh \
 	  "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar" \
 	  "$(SRC_BUILD)" \
 	  "$(DST_BUILD)"
 ifdef MOZ_SIGN_PACKAGE_CMD
 	$(MOZ_SIGN_PACKAGE_CMD) "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar"