summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-05-13 19:00:40 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2020-05-13 19:00:40 +0000
commit871c2ef40cad876c481d19cf12ad3c852a9c20a2 (patch)
tree77511f45b0eede6a34c1db06f0dc5f2bb514552c
parentb64d495f1531254dd64d16686f9f87444a53348f (diff)
downloadnss-hg-871c2ef40cad876c481d19cf12ad3c852a9c20a2.tar.gz
Bug 1637083 Replace pre-dependency with shell hack r=rrelyea
Originally I tried multiple variants using make's conditionals to limit DIRS and enforce building the parent directory before the sub-directory. None of them worked for me, most resulting in an infinite recursion, so I used the current pre-depends workaround to fulfill the real dependency. Now I remembered that automake can handle this case for SUBDIRS specifying "." as a directory. The generated Makefile handles it via shell scripting; not nice, but it works. So this gets rid of the workaround, replacing it with a small shell test. Differential Revision: https://phabricator.services.mozilla.com/D74855
-rw-r--r--coreconf/rules.mk15
-rw-r--r--lib/ckfw/builtins/manifest.mn4
-rw-r--r--lib/ckfw/manifest.mn4
-rw-r--r--manifest.mn6
4 files changed, 20 insertions, 9 deletions
diff --git a/coreconf/rules.mk b/coreconf/rules.mk
index 1bdf08145..dc72e9cef 100644
--- a/coreconf/rules.mk
+++ b/coreconf/rules.mk
@@ -31,10 +31,21 @@ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
USE_NT_C_SYNTAX=1
endif
+# For whatever reason, "." can't be handled using make conditionals.
+# Based on automake's SUBDIRS "." handling.
ifdef DIRS
ifndef IGNORE_DIRS
+ifneq (,$(filter .,$(DIRS)))
+TARGETS = $(NULL)
+ALL_TRASH = $(NULL)
+endif
+
$(DIRS):
- $(IGNORE_ERROR)@$(MAKE) -C $@ $(MAKECMDGOALS)
+ $(IGNORE_ERROR)@if [ "$@" != "." ]; then \
+ $(MAKE) -C $@ $(MAKECMDGOALS) ; \
+ else \
+ IGNORE_DIRS=1 $(MAKE) -C $@ $(MAKECMDGOALS) ; \
+ fi
@$(CLICK_STOPWATCH)
endif
endif
@@ -73,7 +84,9 @@ endif
check: $(DIRS)
clean clobber: $(DIRS)
+ifneq (,$(ALL_TRASH))
rm -rf $(ALL_TRASH)
+endif
realclean clobber_all: $(DIRS)
rm -rf $(wildcard *.OBJ) dist $(ALL_TRASH)
diff --git a/lib/ckfw/builtins/manifest.mn b/lib/ckfw/builtins/manifest.mn
index 88e5237ce..74718dbab 100644
--- a/lib/ckfw/builtins/manifest.mn
+++ b/lib/ckfw/builtins/manifest.mn
@@ -5,7 +5,9 @@
CORE_DEPTH = ../../..
-DIRS = testlib
+DIRS = . testlib
+
+testlib: .
MODULE = nss
diff --git a/lib/ckfw/manifest.mn b/lib/ckfw/manifest.mn
index 8991495e4..f0395b38f 100644
--- a/lib/ckfw/manifest.mn
+++ b/lib/ckfw/manifest.mn
@@ -5,7 +5,9 @@
CORE_DEPTH = ../..
-DIRS = builtins
+DIRS = . builtins
+
+builtins: .
PRIVATE_EXPORTS = \
ck.h \
diff --git a/manifest.mn b/manifest.mn
index 4cd1ea5ee..dada8abab 100644
--- a/manifest.mn
+++ b/manifest.mn
@@ -23,12 +23,6 @@ prepare_build:
# no real way to encode these in any sensible way
$(MAKE) -C coreconf/nsinstall program
$(MAKE) export
- # pre-build child dir -> parent dir dependencies
- # ckfw/builtins -> ckfw
- IGNORE_DIRS=1 $(MAKE) -C lib/ckfw libs
- # ckfw/builtins/testlib -> ckfw/builtins + base
- $(MAKE) -C lib/base libs
- IGNORE_DIRS=1 $(MAKE) -C lib/ckfw/builtins libs
all: prepare_build
$(MAKE) libs