Skip to content

Commit 8bb0f54

Browse files
author
Seppo Takalo
committed
Fix checking if we are compiling for Linux.
1 parent 49cb83f commit 8bb0f54

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
ifeq ($(shell uname -s),Linux)
1+
2+
# Check if we are compiling for Linux using GCC
3+
ifneq (,$(findstring gcc,$(CC)))
4+
TARGET_IS_LINUX := $(shell $(CC) -dM -E - < /dev/null | grep __linux >/dev/null && echo "yes" || echo "no")
5+
endif
6+
7+
ifeq (yes,$(TARGET_IS_LINUX))
28
SRCS := $(wildcard linux/*)
39
else
410
SRCS := $(wildcard source/*)
511
endif
12+
613
LIB := librand.a
714
EXPORT_HEADERS := mbed-client-randlib
815

0 commit comments

Comments
 (0)