aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon McGregor2014-02-14 16:37:37 -0600
committerGordon McGregor2014-02-14 16:38:05 -0600
commit3890ec48e7b69132cbc15b0fca837c8b760d186a (patch)
treecfaa48db2fc81fb363ba86992a2a4d249233774b
parent76f8cedb52613e27d4d5a031899154e31e00b045 (diff)
OS X compatible -map syntax for LDFLAGS
-rw-r--r--unix/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/unix/Makefile b/unix/Makefile
index 7bca495c2..37583149c 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -12,7 +12,13 @@ include ../py/py.mk
# compiler settings
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT)
-LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
+
+UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Darwin)
+ LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-map,$@.map
+else
+ LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
+ endif
ifeq ($(MICROPY_MOD_TIME),1)
CFLAGS_MOD += -DMICROPY_MOD_TIME=1