aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-21 12:25:42 +0200
committerLoïc Hoguin <[email protected]>2015-09-21 12:25:42 +0200
commitca113c784849d7fe8541a23c3b9b0e557c3b9c02 (patch)
tree8955f939b5aa87b7f75b9ee89748628edcd3cf0d /test/core_deps.mk
parentd41ce3032c53f38e8b2adccb81f8879d027fe633 (diff)
downloaderlang.mk-ca113c784849d7fe8541a23c3b9b0e557c3b9c02.tar.gz
erlang.mk-ca113c784849d7fe8541a23c3b9b0e557c3b9c02.tar.bz2
erlang.mk-ca113c784849d7fe8541a23c3b9b0e557c3b9c02.zip
Add a second C build dependency
This one is for testing on Windows. It's simple enough to compile and run without having to deal with installing too many dependencies.
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk36
1 files changed, 34 insertions, 2 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 1a1729d..09d5f42 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1,6 +1,6 @@
# Core: Packages and dependencies.
-CORE_DEPS_CASES = build-c pkg search
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs pkg search
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -13,7 +13,8 @@ $(CORE_DEPS_CLEAN_TARGETS):
core-deps: $(CORE_DEPS_TARGETS)
-core-deps-build-c: build clean-core-deps-build-c
+ifneq ($(PLATFORM),msys2)
+core-deps-build-c-8cc: build clean-core-deps-build-c-8cc
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -41,6 +42,37 @@ dep_8cc = git https://github.com/rui314/8cc master\
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member('8cc', Deps), \
halt()"
+endif
+
+core-deps-build-c-imagejs: build clean-core-deps-build-c-imagejs
+
+ $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 "Add imagejs to the list of build dependencies"
+ $t sed -i.bak '2i\
+BUILD_DEPS = imagejs\
+dep_imagejs = git https://github.com/jklmnn/imagejs master\
+' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/deps/imagejs
+
+ $i "Check that imagejs works"
+ $t $(APP)/deps/imagejs/imagejs bmp $(APP)/deps/imagejs/Makefile
+ $t test -f $(APP)/deps/imagejs/Makefile.bmp
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ [ok = application:load(App) || App <- [$(APP)]], \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ false = lists:member(imagejs, Deps), \
+ halt()"
core-deps-pkg: build clean-core-deps-pkg