From 9cfe72af4ad94d1ef2f2485e11d6d22a3374e28a Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 9 Nov 2023 14:40:12 -0300 Subject: [PATCH] standardize build options --- .../nxp/rt1020-evk-make-baremetal-builtin/Makefile | 8 ++------ .../mongoose_custom.h | 12 ++++++++++++ .../nxp/rt1020-evk-make-freertos-builtin/Makefile | 4 ++-- .../mongoose_custom.h | 1 + .../nxp/rt1060-evk-make-baremetal-builtin/Makefile | 8 ++------ .../mongoose_custom.h | 12 ++++++++++++ .../nxp/rt1060-evk-make-freertos-builtin/Makefile | 4 ++-- .../mongoose_custom.h | 1 + 8 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 examples/nxp/rt1020-evk-make-baremetal-builtin/mongoose_custom.h create mode 100644 examples/nxp/rt1060-evk-make-baremetal-builtin/mongoose_custom.h diff --git a/examples/nxp/rt1020-evk-make-baremetal-builtin/Makefile b/examples/nxp/rt1020-evk-make-baremetal-builtin/Makefile index bd0a7431..d94926d6 100644 --- a/examples/nxp/rt1020-evk-make-baremetal-builtin/Makefile +++ b/examples/nxp/rt1020-evk-make-baremetal-builtin/Makefile @@ -2,19 +2,15 @@ CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_mcu/devices/MIMXRT1021 #-DCPU_MIMXRT1021DAG5A -CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 +CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 $(CFLAGS_EXTRA) LDFLAGS ?= -Tlink_ram.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map SOURCES = main.c syscalls.c sysinit.c SOURCES += cmsis_mcu/devices/MIMXRT1021/gcc/startup_MIMXRT1021.S # NXP startup file. Compiler-dependent! CFLAGS += -D__ATOLLIC__ -D__STARTUP_CLEAR_BSS # Make startup code work as expected -# Mongoose-specific. See https://mongoose.ws/documentation/#build-options +# Mongoose options are defined in mongoose_custom.h SOURCES += mongoose.c -CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_CUSTOM_MILLIS=1 -CFLAGS += -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_DRIVER_RT1020=1 - -CFLAGS += $(CFLAGS_EXTRA) # Example specific build options. See README.md CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" -DHTTPS_URL=\"https://0.0.0.0/\" diff --git a/examples/nxp/rt1020-evk-make-baremetal-builtin/mongoose_custom.h b/examples/nxp/rt1020-evk-make-baremetal-builtin/mongoose_custom.h new file mode 100644 index 00000000..e689a258 --- /dev/null +++ b/examples/nxp/rt1020-evk-make-baremetal-builtin/mongoose_custom.h @@ -0,0 +1,12 @@ +#pragma once + +// See https://mongoose.ws/documentation/#build-options +#define MG_ARCH MG_ARCH_NEWLIB + +#define MG_ENABLE_TCPIP 1 +#define MG_ENABLE_DRIVER_RT1020 1 +#define MG_IO_SIZE 256 +#define MG_ENABLE_CUSTOM_MILLIS 1 +#define MG_ENABLE_CUSTOM_RANDOM 1 +#define MG_ENABLE_PACKED_FS 1 + diff --git a/examples/nxp/rt1020-evk-make-freertos-builtin/Makefile b/examples/nxp/rt1020-evk-make-freertos-builtin/Makefile index db7f9b45..6fdeeaa9 100644 --- a/examples/nxp/rt1020-evk-make-freertos-builtin/Makefile +++ b/examples/nxp/rt1020-evk-make-freertos-builtin/Makefile @@ -2,7 +2,7 @@ CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_mcu/devices/MIMXRT1021 #-DCPU_MIMXRT1021DAG5A -CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 +CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 $(CFLAGS_EXTRA) LDFLAGS ?= -Tlink_ram.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map SOURCES = main.c syscalls.c sysinit.c @@ -15,8 +15,8 @@ SOURCES += FreeRTOS-Kernel/portable/GCC/ARM_CM4F/port.c CFLAGS += -IFreeRTOS-Kernel/include CFLAGS += -IFreeRTOS-Kernel/portable/GCC/ARM_CM4F -Wno-conversion +# Mongoose options are defined in mongoose_custom.h SOURCES += mongoose.c -CFLAGS += $(CFLAGS_EXTRA) # Mongoose options are defined in mongoose_custom.h # Example specific build options. See README.md CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" diff --git a/examples/nxp/rt1020-evk-make-freertos-builtin/mongoose_custom.h b/examples/nxp/rt1020-evk-make-freertos-builtin/mongoose_custom.h index 799afa2b..0b082ec7 100644 --- a/examples/nxp/rt1020-evk-make-freertos-builtin/mongoose_custom.h +++ b/examples/nxp/rt1020-evk-make-freertos-builtin/mongoose_custom.h @@ -4,6 +4,7 @@ // See https://mongoose.ws/documentation/#build-options #define MG_ARCH MG_ARCH_FREERTOS + #define MG_ENABLE_TCPIP 1 #define MG_ENABLE_DRIVER_RT1020 1 #define MG_IO_SIZE 256 diff --git a/examples/nxp/rt1060-evk-make-baremetal-builtin/Makefile b/examples/nxp/rt1060-evk-make-baremetal-builtin/Makefile index ce0571b0..846dd2f5 100644 --- a/examples/nxp/rt1060-evk-make-baremetal-builtin/Makefile +++ b/examples/nxp/rt1060-evk-make-baremetal-builtin/Makefile @@ -2,19 +2,15 @@ CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_mcu/devices/MIMXRT1062 #-DCPU_MIMXRT1062DVL6B -CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 +CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 $(CFLAGS_EXTRA) LDFLAGS ?= -Tlink_ram.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map SOURCES = main.c syscalls.c sysinit.c SOURCES += cmsis_mcu/devices/MIMXRT1062/gcc/startup_MIMXRT1062.S # NXP startup file. Compiler-dependent! CFLAGS += -D__ATOLLIC__ -D__STARTUP_CLEAR_BSS # Make startup code work as expected -# Mongoose-specific. See https://mongoose.ws/documentation/#build-options +# Mongoose options are defined in mongoose_custom.h SOURCES += mongoose.c net.c packed_fs.c -CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_CUSTOM_MILLIS=1 -CFLAGS += -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_DRIVER_RT1020=1 - -CFLAGS += $(CFLAGS_EXTRA) # Example specific build options. See README.md CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" -DHTTPS_URL=\"https://0.0.0.0/\" diff --git a/examples/nxp/rt1060-evk-make-baremetal-builtin/mongoose_custom.h b/examples/nxp/rt1060-evk-make-baremetal-builtin/mongoose_custom.h new file mode 100644 index 00000000..e689a258 --- /dev/null +++ b/examples/nxp/rt1060-evk-make-baremetal-builtin/mongoose_custom.h @@ -0,0 +1,12 @@ +#pragma once + +// See https://mongoose.ws/documentation/#build-options +#define MG_ARCH MG_ARCH_NEWLIB + +#define MG_ENABLE_TCPIP 1 +#define MG_ENABLE_DRIVER_RT1020 1 +#define MG_IO_SIZE 256 +#define MG_ENABLE_CUSTOM_MILLIS 1 +#define MG_ENABLE_CUSTOM_RANDOM 1 +#define MG_ENABLE_PACKED_FS 1 + diff --git a/examples/nxp/rt1060-evk-make-freertos-builtin/Makefile b/examples/nxp/rt1060-evk-make-freertos-builtin/Makefile index 06cbac13..4e431984 100644 --- a/examples/nxp/rt1060-evk-make-freertos-builtin/Makefile +++ b/examples/nxp/rt1060-evk-make-freertos-builtin/Makefile @@ -2,7 +2,7 @@ CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_mcu/devices/MIMXRT1062 #-DCPU_MIMXRT1062DVL6B -CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 +CFLAGS += -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 $(CFLAGS_EXTRA) LDFLAGS ?= -Tlink_ram.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map SOURCES = main.c syscalls.c sysinit.c @@ -15,8 +15,8 @@ SOURCES += FreeRTOS-Kernel/portable/GCC/ARM_CM4F/port.c CFLAGS += -IFreeRTOS-Kernel/include CFLAGS += -IFreeRTOS-Kernel/portable/GCC/ARM_CM4F -Wno-conversion +# Mongoose options are defined in mongoose_custom.h SOURCES += mongoose.c net.c packed_fs.c -CFLAGS += $(CFLAGS_EXTRA) # Mongoose options are defined in mongoose_custom.h # Example specific build options. See README.md CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" diff --git a/examples/nxp/rt1060-evk-make-freertos-builtin/mongoose_custom.h b/examples/nxp/rt1060-evk-make-freertos-builtin/mongoose_custom.h index 799afa2b..0b082ec7 100644 --- a/examples/nxp/rt1060-evk-make-freertos-builtin/mongoose_custom.h +++ b/examples/nxp/rt1060-evk-make-freertos-builtin/mongoose_custom.h @@ -4,6 +4,7 @@ // See https://mongoose.ws/documentation/#build-options #define MG_ARCH MG_ARCH_FREERTOS + #define MG_ENABLE_TCPIP 1 #define MG_ENABLE_DRIVER_RT1020 1 #define MG_IO_SIZE 256