aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-06-29 16:49:38 +0530
committerSudar <sudar@sudarmuthu.com>2013-06-29 20:33:58 +0530
commit96deb9cd06be8b90e57d141b79881c3bb24e11df (patch)
treeffe29395175d2c411f6ac38f42c88ec774c23afa /arduino-mk
parentbf4177567623dee3e274e59162afa4b2bacedaf5 (diff)
Add CURRENT_OS macro which has the current os
Right now CURRENT_OS can have one of the following values - WINDOWS - LINUX - MAC
Diffstat (limited to 'arduino-mk')
-rw-r--r--arduino-mk/Arduino.mk20
1 files changed, 19 insertions, 1 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 16f7d66..4943af0 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -195,7 +195,6 @@
#
#
########################################################################
-
# Useful functions
# Returns the first argument (typically a directory), if the file or directory
# named by concatenating the first and optionally second argument
@@ -231,6 +230,25 @@ show_separator = $(call arduino_output,-------------------------)
$(call show_separator)
$(call arduino_output,Arduino.mk Configuration:)
+########################################################################
+#
+# Detect OS
+ifeq ($(OS),Windows_NT)
+ CURRENT_OS = WINDOWS
+else
+ UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Linux)
+ CURRENT_OS = LINUX
+ endif
+ ifeq ($(UNAME_S),Darwin)
+ CURRENT_OS = MAC
+ endif
+endif
+$(call show_config_variable,CURRENT_OS,[AUTODETECTED])
+
+########################################################################
+#
+# Arduino Directory
ifndef ARDUINO_DIR
AUTO_ARDUINO_DIR := $(firstword \
$(call dir_if_exists,/usr/share/arduino) \