1 # This file should allow ACE to be built on Windows, using the IAR compiler.
3 MQX_CPU = PSP_CPU_MK70F120M
7 $(error Please set MQX_ROOT to the toplevel directory of the MQX code.)
10 MQX_CONFIG_COMMON_DIR ?= "$(MQX_ROOT)/config/common"
12 ifndef MQX_USER_CONFIG_DIR
13 $(error Please set MQX_USER_CONFIG_DIR to the directory containing the MQX user_config.h.)
16 ACE_PLATFORM_CONFIG ?= config-mqx.h
21 gruntimelibselect ?= 1
26 AR.cc.override = $(RM) $@; echo $(filter %.o, $^) | xargs $(AR) $(ARFLAGS) $@ $(AREXTRA)
32 CC = icc$(IAR_PLATFORM)
33 CXX = icc$(IAR_PLATFORM) --c++
36 CXX_VERSION := $(shell $(CXX) --version)
39 no_hidden_visibility ?= 1
42 CPPFLAGS += --no_inline
45 ifeq ($(gruntimelibselect),1)
46 CFLAGS += --dlib_config DLib_Config_Normal.h
48 ifeq ($(gruntimelibselect),2)
49 CFLAGS += --dlib_config DLib_Config_Full.h -DACE_MQX_DLIB_FULL
51 ifeq ($(gruntimelibselect),3)
52 CFLAGS += --dlib_config $(DLIB_CONFIG)
55 CFLAGS += -I$(MQX_CONFIG_COMMON_DIR) -I$(MQX_USER_CONFIG_DIR)
56 MQX_IO_DIR=$(MQX_ROOT)/mqx/source/io
57 CFLAGS += -DMQX_CPU=$(MQX_CPU) --enable_restrict -I$(MQX_ROOT)/mqx/source/include -I$(MQX_ROOT)/mqx/source/psp/$(MQX_CPU_INC) -I$(MQX_ROOT)/mqx/source/psp/$(MQX_CPU_INC)/cpu -I$(MQX_ROOT)/mqx/source/psp/$(MQX_CPU_INC)/compiler/iar -I$(MQX_ROOT)/rtcs/source/include -I$(MQX_ROOT)/mqx/source/bsp/twrk70f120m -I$(MQX_IO_DIR)/adc -I$(MQX_IO_DIR)/asrc -I$(MQX_IO_DIR)/can -I$(MQX_IO_DIR)/cm -I$(MQX_IO_DIR)/core_mutex -I$(MQX_IO_DIR)/dcu4 -I$(MQX_IO_DIR)/debug -I$(MQX_IO_DIR)/dma -I$(MQX_IO_DIR)/enet -I$(MQX_IO_DIR)/esai -I$(MQX_IO_DIR)/esdhc -I$(MQX_IO_DIR)/fbdev -I$(MQX_IO_DIR)/flashx -I$(MQX_IO_DIR)/flextimer -I$(MQX_IO_DIR)/ftm -I$(MQX_IO_DIR)/gpio -I$(MQX_IO_DIR)/hmi -I$(MQX_IO_DIR)/hwtimer -I$(MQX_IO_DIR)/i2c -I$(MQX_IO_DIR)/i2s -I$(MQX_IO_DIR)/imxrt -I$(MQX_IO_DIR)/int_ctrl -I$(MQX_IO_DIR)/io_expander -I$(MQX_IO_DIR)/io_mem -I$(MQX_IO_DIR)/io_null -I$(MQX_IO_DIR)/lcd -I$(MQX_IO_DIR)/lpm -I$(MQX_IO_DIR)/lpm_mcore -I$(MQX_IO_DIR)/lwadc -I$(MQX_IO_DIR)/lwgpio -I$(MQX_IO_DIR)/mcg -I$(MQX_IO_DIR)/mu -I$(MQX_IO_DIR)/nandflash -I$(MQX_IO_DIR)/pcb -I$(MQX_IO_DIR)/pccard -I$(MQX_IO_DIR)/pcflash -I$(MQX_IO_DIR)/pipe -I$(MQX_IO_DIR)/qspi -I$(MQX_IO_DIR)/rnga -I$(MQX_IO_DIR)/rtc -I$(MQX_IO_DIR)/sai -I$(MQX_IO_DIR)/sdcard -I$(MQX_IO_DIR)/sdram -I$(MQX_IO_DIR)/sensor -I$(MQX_IO_DIR)/serial -I$(MQX_IO_DIR)/sim -I$(MQX_IO_DIR)/spi -I$(MQX_IO_DIR)/spi_legacy -I$(MQX_IO_DIR)/spi_slave -I$(MQX_IO_DIR)/tchres -I$(MQX_IO_DIR)/tfs -I$(MQX_IO_DIR)/timer -I$(MQX_IO_DIR)/usb -I$(MQX_IO_DIR)/usb_dcd -I$(MQX_IO_DIR)/gpio/kgpio -I$(MQX_IO_DIR)/sdcard/sdcard_spi -I$(MQX_IO_DIR)/sdcard/sdcard_esdhc -I$(MQX_IO_DIR)/flashx/freescale -I$(MQX_IO_DIR)/enet/macnet -I$(MQX_IO_DIR)/adc/kadc -I$(MQX_ROOT)/mfs/source/include -I$(MQX_ROOT)/posix/source/include
60 CPPFLAGS += -D_REENTRANT
68 MQX_LIB_DIR ?= $(MQX_ROOT)/lib/twrk70f120m.iar/debug
70 LDFLAGS += --config $(MQX_LIB_DIR)/bsp/intflash_sramdata.icf --redirect __iar_dlmalloc=malloc \
71 --redirect __iar_dlcalloc=calloc --redirect __iar_dlfree=free --manual_dynamic_initialization
72 SYSTEM_LIBS = -L$(MQX_LIB_DIR)/bsp bsp.a \
73 -L$(MQX_LIB_DIR)/psp psp.a \
74 -L$(MQX_LIB_DIR)/mfs mfs.a \
75 -L$(MQX_LIB_DIR)/rtcs rtcs.a \
76 -L$(MQX_LIB_DIR)/posix posix.a
78 LINK.cc.override = $(PURELINK) $(PRELINK) $(LD) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $(SYSTEM_LIBS) $(filter-out %.a,$^) $(VLDLIBS) $(POSTLINK)
83 # Disable all optimizing in code
87 SOFLAGS += $(CPPFLAGS) -shared
88 SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $<; \
89 $(SOLINK.cc) -o $@ $(LDFLAGS) $(VSHDIR)$*.o