diff options
| author | hathach <[email protected]> | 2023-11-23 11:44:14 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-11-23 11:44:14 +0700 |
| commit | 51312f70fde779f59dcc48b41132291c10d3ad0b (patch) | |
| tree | abf7ea5c2fbd6bfddd66930f3fefc88fd1a3bf5b /tools/make | |
| parent | 08f9ed67c92421cbd0bc09270d2f363886681866 (diff) | |
move make to examples/build_system
add -Wl,--no-warn-rwx-segment for gcc 12+
Diffstat (limited to 'tools/make')
| -rw-r--r-- | tools/make/cpu/arm1176.mk | 9 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-a53.mk | 12 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-a72.mk | 12 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m0.mk | 14 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m0plus.mk | 14 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m3.mk | 17 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m33.mk | 19 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m4.mk | 13 | ||||
| -rw-r--r-- | tools/make/cpu/cortex-m7.mk | 19 | ||||
| -rw-r--r-- | tools/make/toolchain/arm_gcc.mk | 71 | ||||
| -rw-r--r-- | tools/make/toolchain/arm_gcc_rules.mk | 79 | ||||
| -rw-r--r-- | tools/make/toolchain/arm_iar.mk | 11 | ||||
| -rw-r--r-- | tools/make/toolchain/arm_iar_rules.mk | 44 |
13 files changed, 0 insertions, 334 deletions
diff --git a/tools/make/cpu/arm1176.mk b/tools/make/cpu/arm1176.mk deleted file mode 100644 index 022ccf7ad..000000000 --- a/tools/make/cpu/arm1176.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mcpu=arm1176jzf-s \ - -else ifeq ($(TOOLCHAIN),iar) - #CFLAGS += --cpu cortex-a53 - #ASFLAGS += --cpu cortex-a53 - -endif diff --git a/tools/make/cpu/cortex-a53.mk b/tools/make/cpu/cortex-a53.mk deleted file mode 100644 index 42e522ecf..000000000 --- a/tools/make/cpu/cortex-a53.mk +++ /dev/null @@ -1,12 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mcpu=cortex-a53 \ - -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-a53 \ - - ASFLAGS += \ - --cpu cortex-a53 \ - -endif diff --git a/tools/make/cpu/cortex-a72.mk b/tools/make/cpu/cortex-a72.mk deleted file mode 100644 index 1b3d8da4a..000000000 --- a/tools/make/cpu/cortex-a72.mk +++ /dev/null @@ -1,12 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mcpu=cortex-a72 \ - -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-a72 \ - - ASFLAGS += \ - --cpu cortex-a72 \ - -endif diff --git a/tools/make/cpu/cortex-m0.mk b/tools/make/cpu/cortex-m0.mk deleted file mode 100644 index feb0f395b..000000000 --- a/tools/make/cpu/cortex-m0.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m0 \ - -mfloat-abi=soft \ - -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m0 - ASFLAGS += --cpu cortex-m0 -endif - -# For freeRTOS port source -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM0 diff --git a/tools/make/cpu/cortex-m0plus.mk b/tools/make/cpu/cortex-m0plus.mk deleted file mode 100644 index b416b7a4a..000000000 --- a/tools/make/cpu/cortex-m0plus.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m0plus \ - -mfloat-abi=soft \ - -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m0+ - ASFLAGS += --cpu cortex-m0+ -endif - -# For freeRTOS port source -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM0 diff --git a/tools/make/cpu/cortex-m3.mk b/tools/make/cpu/cortex-m3.mk deleted file mode 100644 index 7a34b9e04..000000000 --- a/tools/make/cpu/cortex-m3.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m3 \ - -mfloat-abi=soft \ - -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += \ - --cpu cortex-m3 \ - - ASFLAGS += \ - --cpu cortex-m3 -endif - -# For freeRTOS port source -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM3 diff --git a/tools/make/cpu/cortex-m33.mk b/tools/make/cpu/cortex-m33.mk deleted file mode 100644 index fe5b7b380..000000000 --- a/tools/make/cpu/cortex-m33.mk +++ /dev/null @@ -1,19 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m33 \ - -mfloat-abi=hard \ - -mfpu=fpv5-sp-d16 \ - -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m33 \ - --fpu VFPv5-SP \ - - ASFLAGS += \ - --cpu cortex-m33 \ - --fpu VFPv5-SP \ - -endif - -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM33_NTZ/non_secure diff --git a/tools/make/cpu/cortex-m4.mk b/tools/make/cpu/cortex-m4.mk deleted file mode 100644 index d8776b5d8..000000000 --- a/tools/make/cpu/cortex-m4.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m4 \ - -mfloat-abi=hard \ - -mfpu=fpv4-sp-d16 \ - -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += --cpu cortex-m4 --fpu VFPv4 - ASFLAGS += --cpu cortex-m4 --fpu VFPv4 -endif - -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM4F diff --git a/tools/make/cpu/cortex-m7.mk b/tools/make/cpu/cortex-m7.mk deleted file mode 100644 index 0e3461787..000000000 --- a/tools/make/cpu/cortex-m7.mk +++ /dev/null @@ -1,19 +0,0 @@ -ifeq ($(TOOLCHAIN),gcc) - CFLAGS += \ - -mthumb \ - -mcpu=cortex-m7 \ - -mfloat-abi=hard \ - -mfpu=fpv5-d16 \ - -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_D16 \ - - ASFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_D16 \ - -endif - -FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM7/r0p1 diff --git a/tools/make/toolchain/arm_gcc.mk b/tools/make/toolchain/arm_gcc.mk deleted file mode 100644 index bba0607df..000000000 --- a/tools/make/toolchain/arm_gcc.mk +++ /dev/null @@ -1,71 +0,0 @@ -# makefile for arm gcc toolchain - -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -AS = $(CC) -x assembler-with-cpp -LD = $(CC) - -GDB = $(CROSS_COMPILE)gdb -OBJCOPY = $(CROSS_COMPILE)objcopy -SIZE = $(CROSS_COMPILE)size - -# --------------------------------------- -# Compiler Flags -# --------------------------------------- -CFLAGS += \ - -MD \ - -ggdb \ - -fdata-sections \ - -ffunction-sections \ - -fsingle-precision-constant \ - -fno-strict-aliasing \ - -Wall \ - -Wextra \ - -Werror \ - -Wfatal-errors \ - -Wdouble-promotion \ - -Wstrict-prototypes \ - -Wstrict-overflow \ - -Werror-implicit-function-declaration \ - -Wfloat-equal \ - -Wundef \ - -Wshadow \ - -Wwrite-strings \ - -Wsign-compare \ - -Wmissing-format-attribute \ - -Wunreachable-code \ - -Wcast-align \ - -Wcast-function-type \ - -Wcast-qual \ - -Wnull-dereference \ - -Wuninitialized \ - -Wunused \ - -Wreturn-type \ - -Wredundant-decls \ - -# conversion is too strict for most mcu driver, may be disable sign/int/arith-conversion -# -Wconversion - -# Size Optimization as default -CFLAGS_OPTIMIZED ?= -Os - -# Debugging/Optimization -ifeq ($(DEBUG), 1) - CFLAGS += -O0 - NO_LTO = 1 -else - CFLAGS += $(CFLAGS_OPTIMIZED) -endif - -# --------------------------------------- -# Linker Flags -# --------------------------------------- -LDFLAGS += \ - -Wl,[email protected] \ - -Wl,-cref \ - -Wl,-gc-sections \ - -# Some toolchain such as renesas rx does not support --print-memory-usage flags -ifneq ($(FAMILY),rx) -LDFLAGS += -Wl,--print-memory-usage -endif diff --git a/tools/make/toolchain/arm_gcc_rules.mk b/tools/make/toolchain/arm_gcc_rules.mk deleted file mode 100644 index b76d4aec3..000000000 --- a/tools/make/toolchain/arm_gcc_rules.mk +++ /dev/null @@ -1,79 +0,0 @@ -SRC_S += $(SRC_S_GCC) - -# Assembly files can be name with upper case .S, convert it to .s -SRC_S := $(SRC_S:.S=.s) - -# Due to GCC LTO bug https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966 -# assembly file should be placed first in linking order -# '_asm' suffix is added to object of assembly file -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o)) -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o)) - -CFLAGS += $(CFLAGS_GCC) -MD - -# LTO makes it difficult to analyze map file for optimizing size purpose -# We will run this option in ci -ifeq ($(NO_LTO),1) -CFLAGS := $(filter-out -flto,$(CFLAGS)) -endif - -ifneq ($(CFLAGS_SKIP),) -CFLAGS := $(filter-out $(CFLAGS_SKIP),$(CFLAGS)) -endif - -LDFLAGS += $(CFLAGS) $(LDFLAGS_GCC) - -ifdef LD_FILE -LDFLAGS += -Wl,-T,$(TOP)/$(LD_FILE) -endif - -ifdef LD_FILE_GCC -LDFLAGS += -Wl,-T,$(TOP)/$(LD_FILE_GCC) -endif - -ifneq ($(SKIP_NANOLIB), 1) -LDFLAGS += --specs=nosys.specs --specs=nano.specs -endif - -ASFLAGS += $(CFLAGS) - -LIBS_GCC ?= -lgcc -lm -lnosys - -# libc -LIBS += $(LIBS_GCC) - -ifneq ($(BOARD), spresense) -LIBS += -lc -endif - -# --------------------------------------- -# Rules -# --------------------------------------- - -# Compile .c file -$(BUILD)/obj/%.o: %.c - @echo CC $(notdir $@) - @$(CC) $(CFLAGS) -c -o $@ $< - -# ASM sources lower case .s -$(BUILD)/obj/%_asm.o: %.s - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -# ASM sources upper case .S -$(BUILD)/obj/%_asm.o: %.S - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -OBJCOPY_BIN_OPTION ?= -$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - $(OBJCOPY) -O binary $(OBJCOPY_BIN_OPTION) $^ $@ - -$(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - @$(OBJCOPY) -O ihex $^ $@ - -$(BUILD)/$(PROJECT).elf: $(OBJ) - @echo LINK $@ - @$(LD) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group diff --git a/tools/make/toolchain/arm_iar.mk b/tools/make/toolchain/arm_iar.mk deleted file mode 100644 index 04c9f22b3..000000000 --- a/tools/make/toolchain/arm_iar.mk +++ /dev/null @@ -1,11 +0,0 @@ -# makefile for arm iar toolchain -AS = iasmarm -LD = ilinkarm -OBJCOPY = ielftool --silent -SIZE = size - -# Enable extension mode (gcc compatible) -CFLAGS += -e --debug --silent - -# silent mode -ASFLAGS += -S $(addprefix -I,$(INC)) diff --git a/tools/make/toolchain/arm_iar_rules.mk b/tools/make/toolchain/arm_iar_rules.mk deleted file mode 100644 index 2c066f6da..000000000 --- a/tools/make/toolchain/arm_iar_rules.mk +++ /dev/null @@ -1,44 +0,0 @@ -SRC_S += $(SRC_S_IAR) - -# Assembly files can be name with upper case .S, convert it to .s -SRC_S := $(SRC_S:.S=.s) - -# Due to GCC LTO bug https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966 -# assembly file should be placed first in linking order -# '_asm' suffix is added to object of assembly file -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o)) -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o)) - -# Linker script -LDFLAGS += --config $(TOP)/$(LD_FILE_IAR) - -# --------------------------------------- -# Rules -# --------------------------------------- - -# Compile .c file -$(BUILD)/obj/%.o: %.c - @echo CC $(notdir $@) - @$(CC) $(CFLAGS) -c -o $@ $< - -# ASM sources lower case .s -$(BUILD)/obj/%_asm.o: %.s - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -# ASM sources upper case .S -$(BUILD)/obj/%_asm.o: %.S - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - @$(OBJCOPY) --bin $^ $@ - -$(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - @$(OBJCOPY) --ihex $^ $@ - -$(BUILD)/$(PROJECT).elf: $(OBJ) - @echo LINK $@ - @$(LD) -o $@ $(LDFLAGS) $^ |
