aboutsummaryrefslogtreecommitdiffstats
path: root/core/core.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/core.mk')
-rw-r--r--core/core.mk24
1 files changed, 19 insertions, 5 deletions
diff --git a/core/core.mk b/core/core.mk
index 4b292ee..a9cb808 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -45,7 +45,6 @@ export ERLANG_MK_TMP
ERL = erl +A0 -noinput -boot start_clean
# Platform detection.
-# @todo Add Windows/Cygwin detection eventually.
ifeq ($(PLATFORM),)
UNAME_S := $(shell uname -s)
@@ -64,6 +63,10 @@ else ifeq ($(UNAME_S),NetBSD)
PLATFORM = netbsd
else ifeq ($(UNAME_S),OpenBSD)
PLATFORM = openbsd
+else ifeq ($(UNAME_S),DragonFly)
+PLATFORM = dragonfly
+else ifeq ($(shell uname -o),Msys)
+PLATFORM = msys2
else
$(error Unable to detect platform. Please open a ticket with the output of uname -a.)
endif
@@ -90,7 +93,10 @@ ifneq ($(wildcard erl_crash.dump),)
$(gen_verbose) rm -f erl_crash.dump
endif
-distclean:: clean
+distclean:: clean distclean-tmp
+
+distclean-tmp:
+ $(gen_verbose) rm -rf $(ERLANG_MK_TMP)
help::
$(verbose) printf "%s\n" \
@@ -135,6 +141,12 @@ define erlang
$(ERL) $(2) -pz $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(subst ",\",$(1)))" -- erlang.mk
endef
+ifeq ($(PLATFORM),msys2)
+core_native_path = $(subst \,\\\\,$(shell cygpath -w $1))
+else
+core_native_path = $1
+endif
+
ifeq ($(shell which wget 2>/dev/null | wc -l), 1)
define core_http_get
wget --no-check-certificate -O $(1) $(2)|| rm $(1)
@@ -156,7 +168,7 @@ define core_http_get.erl
endef
define core_http_get
- $(call erlang,$(call core_http_get.erl,$(1),$(2)))
+ $(call erlang,$(call core_http_get.erl,$(call core_native_path,$1),$2))
endef
endif
@@ -171,13 +183,15 @@ core_ls = $(filter-out $(1),$(shell echo $(1)))
# Automated update.
+ERLANG_MK_REPO ?= https://github.com/ninenines/erlang.mk
+ERLANG_MK_COMMIT ?=
ERLANG_MK_BUILD_CONFIG ?= build.config
ERLANG_MK_BUILD_DIR ?= .erlang.mk.build
erlang-mk:
- git clone https://github.com/ninenines/erlang.mk $(ERLANG_MK_BUILD_DIR)
+ git clone $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR)
if [ -f $(ERLANG_MK_BUILD_CONFIG) ]; then cp $(ERLANG_MK_BUILD_CONFIG) $(ERLANG_MK_BUILD_DIR)/build.config; fi
- cd $(ERLANG_MK_BUILD_DIR) && $(MAKE)
+ cd $(ERLANG_MK_BUILD_DIR) && $(if $(ERLANG_MK_COMMIT),git checkout $(ERLANG_MK_COMMIT) &&) $(MAKE)
cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk
rm -rf $(ERLANG_MK_BUILD_DIR)