Fix checking if we are compiling for Linux.

pull/3240/head
Seppo Takalo 2016-04-07 17:05:50 +03:00
parent 49cb83fab3
commit 8bb0f54ae9
1 changed files with 8 additions and 1 deletions

View File

@ -1,8 +1,15 @@
ifeq ($(shell uname -s),Linux)
# Check if we are compiling for Linux using GCC
ifneq (,$(findstring gcc,$(CC)))
TARGET_IS_LINUX := $(shell $(CC) -dM -E - < /dev/null | grep __linux >/dev/null && echo "yes" || echo "no")
endif
ifeq (yes,$(TARGET_IS_LINUX))
SRCS := $(wildcard linux/*)
else
SRCS := $(wildcard source/*)
endif
LIB := librand.a
EXPORT_HEADERS := mbed-client-randlib