aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-25 08:23:57 +0100
committerLoïc Hoguin <[email protected]>2018-11-25 08:23:57 +0100
commit7ed5a10b44a95c40ad55ee16d2893097e869f006 (patch)
tree67bc0e129d65869b3c83d2ba9846e7c3d83b3ab5
parent40db558812f5e0fee0607baeae0248e3166bc07b (diff)
downloaderlang.mk-7ed5a10b44a95c40ad55ee16d2893097e869f006.tar.gz
erlang.mk-7ed5a10b44a95c40ad55ee16d2893097e869f006.tar.bz2
erlang.mk-7ed5a10b44a95c40ad55ee16d2893097e869f006.zip
Build $(PROJECT).d in a separate $(MAKE) call
This avoids the issue where clean will remove a file that was otherwise generated and won't be regenerated. This might also help with parallel building.
-rw-r--r--core/erlc.mk6
-rw-r--r--test/core_app.mk14
2 files changed, 15 insertions, 5 deletions
diff --git a/core/erlc.mk b/core/erlc.mk
index 39d1553..cf930c9 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -54,10 +54,12 @@ ifneq ($(wildcard src/),)
# Targets.
ifeq ($(wildcard ebin/test),)
-app:: deps $(PROJECT).d
+app:: deps
+ $(verbose) $(MAKE) --no-print-directory $(PROJECT).d
$(verbose) $(MAKE) --no-print-directory app-build
else
-app:: clean deps $(PROJECT).d
+app:: clean deps
+ $(verbose) $(MAKE) --no-print-directory $(PROJECT).d
$(verbose) $(MAKE) --no-print-directory app-build
endif
diff --git a/test/core_app.mk b/test/core_app.mk
index d8832c5..53149fc 100644
--- a/test/core_app.mk
+++ b/test/core_app.mk
@@ -1758,7 +1758,7 @@ endif
[{module, M} = code:load_file(M) || M <- Mods], \
halt()"
-core-app-yrl-normal-to-debug: build clean
+core-app-yrl-test-build-then-normal-build: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -1766,11 +1766,19 @@ core-app-yrl-normal-to-debug: build clean
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Create the parser .yrl file"
- $t echo "Nonterminals top.\nTerminals plus num.\nRootsymbol top.\ntop -> num plus num : {'$1', '$3'}." >$(APP)/src/$(APP)_parser.yrl
+ $t printf "%s\n" \
+ "Nonterminals top." \
+ "Terminals plus num." \
+ "Rootsymbol top." \
+ "top -> num plus num : {'$1', '$3'}." > $(APP)/src/$(APP)_parser.yrl
$i "Create the test suite"
$t mkdir $(APP)/test
- $t echo "-module(test_SUITE).\n-export([all/0, test/1]).\nall() -> [test].\ntest(_) -> 0=0." >$(APP)/test/test_SUITE.erl
+ $t printf "%s\n" \
+ "-module(test_SUITE)." \
+ "-export([all/0, test/1])." \
+ "all() -> [test]." \
+ "test(_) -> 0=0." > $(APP)/test/test_SUITE.erl
$i "Build the application in test mode"
$t $(MAKE) -C $(APP) ct $v