diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-05-13 19:00:40 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-05-13 19:00:40 +0000 |
commit | 871c2ef40cad876c481d19cf12ad3c852a9c20a2 (patch) | |
tree | 77511f45b0eede6a34c1db06f0dc5f2bb514552c /coreconf | |
parent | b64d495f1531254dd64d16686f9f87444a53348f (diff) | |
download | nss-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
Diffstat (limited to 'coreconf')
-rw-r--r-- | coreconf/rules.mk | 15 |
1 files changed, 14 insertions, 1 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) |