mongoose/examples/nxp/frdm-mcxn947-make-baremetal-builtin/Makefile

46 lines
1.7 KiB
Makefile
Raw Normal View History

2024-04-25 21:23:43 +08:00
CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion
CFLAGS += -Wformat-truncation -fno-common # -Wconversion is not SDK-friendly
CFLAGS += -g3 -Os -ffunction-sections -fdata-sections
2024-05-08 01:28:35 +08:00
CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_mcu/devices/MCXN947/
CFLAGS += -Icmsis_mcu/devices/MCXN947/drivers
2024-04-25 21:23:43 +08:00
CFLAGS += -DCPU_MCXN947VDF -DCPU_MCXN947VDF_cm33 -DCPU_MCXN947VDF_cm33_core0
2024-05-08 01:28:35 +08:00
CFLAGS += -mcpu=cortex-m33 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 $(CFLAGS_EXTRA)
CFLAGS += -Wno-old-style-declaration -Wno-unused-parameter # due to NXP FSL code
2024-04-25 21:23:43 +08:00
LDSCRIPT = link.ld
LDFLAGS ?= -T$(LDSCRIPT) -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map
SOURCES = main.c hal.c
SOURCES += startup.c
2024-05-08 01:28:35 +08:00
SOURCES += cmsis_mcu/devices/MCXN947/drivers/fsl_clock.c cmsis_mcu/devices/MCXN947/drivers/fsl_spc.c cmsis_mcu/devices/MCXN947/drivers/fsl_common_arm.c # NXP support files
2024-04-25 21:23:43 +08:00
2024-05-08 01:28:35 +08:00
# Mongoose options are defined in mongoose_config.h
SOURCES += mongoose.c net.c packed_fs.c
2024-04-25 21:23:43 +08:00
# Example specific build options. See README.md
CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" -DHTTPS_URL=\"https://0.0.0.0/\"
ifeq ($(OS),Windows_NT)
RM = cmd /C del /Q /F /S
else
RM = rm -rf
endif
all build example: firmware.bin
firmware.bin: firmware.elf
arm-none-eabi-objcopy -O binary $< $@
2024-05-08 01:28:35 +08:00
firmware.elf: cmsis_core cmsis_mcu $(SOURCES) hal.h link.ld Makefile
2024-04-25 21:23:43 +08:00
arm-none-eabi-gcc $(SOURCES) $(CFLAGS) $(LDFLAGS) -o $@
arm-none-eabi-size $@
cmsis_core: # ARM CMSIS core headers
git clone -q --depth 1 -b 5.9.0 https://github.com/ARM-software/CMSIS_5 $@
2024-05-08 01:28:35 +08:00
cmsis_mcu:
2024-04-25 21:23:43 +08:00
wget -O $@.zip https://mcuxpresso.nxp.com/cmsis_pack/repo/NXP.MCXN947_DFP.17.0.0.pack
mkdir $@ && cd $@ && unzip -q ../$@.zip
clean:
2024-05-08 01:28:35 +08:00
$(RM) firmware.* *.su cmsis_core cmsis_mcu *.zip
2024-04-25 21:23:43 +08:00