aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-02-06 12:18:38 +0100
committerLoïc Hoguin <[email protected]>2020-02-07 15:58:57 +0100
commitb6b3111b338b7e1d3ad9a1476e90ea106b7d73ef (patch)
tree0ba44b5fbc1d2407a4430ce091d2352e5a266c7e
parentca9f4949fa84b1c0ff6d37e172df12b531b1a5c7 (diff)
downloaderlang.mk-b6b3111b338b7e1d3ad9a1476e90ea106b7d73ef.tar.gz
erlang.mk-b6b3111b338b7e1d3ad9a1476e90ea106b7d73ef.tar.bz2
erlang.mk-b6b3111b338b7e1d3ad9a1476e90ea106b7d73ef.zip
Copy src/$(PROJECT).appup to ebin/ on build if any
-rw-r--r--core/erlc.mk3
-rw-r--r--test/core_app.mk25
2 files changed, 28 insertions, 0 deletions
diff --git a/core/erlc.mk b/core/erlc.mk
index d102cd0..12f69e2 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -331,6 +331,9 @@ else
| sed "s/{id,[[:space:]]*\"git\"}/{id, \"$(subst /,\/,$(GITDESCRIBE))\"}/" \
> ebin/$(PROJECT).app
endif
+ifneq ($(wildcard src/$(PROJECT).appup),)
+ $(verbose) cp src/$(PROJECT).appup ebin/
+endif
clean:: clean-app
diff --git a/test/core_app.mk b/test/core_app.mk
index 3ab6c72..553f331 100644
--- a/test/core_app.mk
+++ b/test/core_app.mk
@@ -27,6 +27,31 @@ core-app-appsrc-change: init
$t rm $(APP)/EXPECT
endif
+core-app-appup: init
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Generate a .appup file"
+ $t touch $(APP)/src/$(APP).appup
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that the appup file was copied into ebin/"
+ $t test -f $(APP)/ebin/$(APP).appup
+
+ $i "Clean the application"
+ $t $(MAKE) -C $(APP) clean $v
+
+ $i "Check that the source file still exists"
+ $t test -f $(APP)/src/$(APP).appup
+
+ $i "Check that the file copied into ebin/ was removed"
+ $t test ! -e $(APP)/ebin/$(APP).appup
+
core-app-asn1: init
$i "Bootstrap a new OTP library named $(APP)"