Add CURRENT_OS macro which has the current os
Right now CURRENT_OS can have one of the following values - WINDOWS - LINUX - MAC
This commit is contained in:
parent
bf41775676
commit
96deb9cd06
1 changed files with 19 additions and 1 deletions
|
@ -195,7 +195,6 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
# Useful functions
|
# Useful functions
|
||||||
# Returns the first argument (typically a directory), if the file or directory
|
# Returns the first argument (typically a directory), if the file or directory
|
||||||
# named by concatenating the first and optionally second argument
|
# named by concatenating the first and optionally second argument
|
||||||
|
@ -231,6 +230,25 @@ show_separator = $(call arduino_output,-------------------------)
|
||||||
$(call show_separator)
|
$(call show_separator)
|
||||||
$(call arduino_output,Arduino.mk Configuration:)
|
$(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
|
ifndef ARDUINO_DIR
|
||||||
AUTO_ARDUINO_DIR := $(firstword \
|
AUTO_ARDUINO_DIR := $(firstword \
|
||||||
$(call dir_if_exists,/usr/share/arduino) \
|
$(call dir_if_exists,/usr/share/arduino) \
|
||||||
|
|
Loading…
Reference in a new issue