diff --git a/ports/minimal/Makefile b/ports/minimal/Makefile index 050c4ddf52..824e54205b 100644 --- a/ports/minimal/Makefile +++ b/ports/minimal/Makefile @@ -26,9 +26,14 @@ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -fsingl CFLAGS += $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) LDFLAGS += -nostdlib -T stm32f405.ld -Map=$@.map --cref --gc-sections else +UNAME_S := $(shell uname -s) LD = $(CC) CFLAGS += $(INC) -Wall -Werror -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT) +ifeq ($(UNAME_S),Linux) LDFLAGS += -Wl,-Map=$@.map,--cref -Wl,--gc-sections +else ifeq ($(UNAME_S),Darwin) +LDFLAGS += -Wl,-map,$@.map -Wl,-dead_strip +endif endif CSUPEROPT = -Os # save some code space diff --git a/ports/minimal/mpconfigport.h b/ports/minimal/mpconfigport.h index 56bef165fa..87287cbc6f 100644 --- a/ports/minimal/mpconfigport.h +++ b/ports/minimal/mpconfigport.h @@ -33,7 +33,7 @@ typedef long mp_off_t; #define MICROPY_HW_BOARD_NAME "minimal" #define MICROPY_HW_MCU_NAME "unknown-cpu" -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) #define MICROPY_MIN_USE_STDOUT (1) #define MICROPY_HEAP_SIZE (25600) // heap size 25 kilobytes #endif