aboutsummaryrefslogtreecommitdiffstats
path: root/core/core.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-14 13:53:25 +0300
committerLoïc Hoguin <[email protected]>2015-05-14 13:53:25 +0300
commit22f9e544248ad52ffb5756d697b2c3d0be08c630 (patch)
treef3c73dce87167b16fda2a87768fc24f387a58172 /core/core.mk
parent1493e9394c9a44bb381cd687485f7eab128b040d (diff)
downloaderlang.mk-22f9e544248ad52ffb5756d697b2c3d0be08c630.tar.gz
erlang.mk-22f9e544248ad52ffb5756d697b2c3d0be08c630.tar.bz2
erlang.mk-22f9e544248ad52ffb5756d697b2c3d0be08c630.zip
Get rid of the autopatch hack for proper
Diffstat (limited to 'core/core.mk')
-rw-r--r--core/core.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/core.mk b/core/core.mk
index 473013f..a2afe0d 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -32,6 +32,33 @@ gen_verbose = $(gen_verbose_$(V))
ERL = erl +A0 -noinput -boot start_clean
+# Platform detection.
+# @todo Add Windows/Cygwin detection eventually.
+
+ifeq ($(PLATFORM),)
+UNAME_S := $(shell uname -s)
+
+ifeq ($(UNAME_S),Linux)
+PLATFORM = linux
+else ifeq ($(UNAME_S),Darwin)
+PLATFORM = darwin
+else ifeq ($(UNAME_S),SunOS)
+PLATFORM = solaris
+else ifeq ($(UNAME_S),GNU)
+PLATFORM = gnu
+else ifeq ($(UNAME_S),FreeBSD)
+PLATFORM = freebsd
+else ifeq ($(UNAME_S),NetBSD)
+PLATFORM = netbsd
+else ifeq ($(UNAME_S),OpenBSD)
+PLATFORM = openbsd
+else
+$(error Unable to detect platform. Please open a ticket with the output of uname -a.)
+endif
+
+export PLATFORM
+endif
+
# Core targets.
ifneq ($(words $(MAKECMDGOALS)),1)