From c40a117a521c1d69d1ba0da30bfa8aa3414e7291 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Thu, 7 May 2020 12:48:54 -0500 Subject: [PATCH 1/5] Makefile: Set linker script globally --- Makefile | 58 +------------------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/Makefile b/Makefile index 567181b..a3bb351 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ ASFLAGS = -Wa,-adhlns=$(BUILDDIR)/$(<:.s=.lst)#,--g$(DEBUG) LDFLAGS = -nostartfiles -Wl,-Map=$(TARGET).map,--cref,--gc-sections LDFLAGS += -lc -lgcc - +LDFLAGS += -T$(ST_LIB)/c_only_md_high_density.ld # Define programs and commands. @@ -144,9 +144,6 @@ smart-v2: begin clean gccversion build_smart-v2 sizeafter finished copy_smart-v build: elf bin lss sym build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI $(DEFINES) -# Set the linker script -build_maple-mini: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld - build_maple-mini: elf bin lss sym copy_maple_mini: @echo @@ -156,9 +153,6 @@ copy_maple_mini: @echo build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3 $(DEFINES) -# Set the linker script -build_maple-rev3: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld - build_maple-rev3: elf bin lss sym copy_maple-rev3: @echo @@ -168,8 +162,6 @@ copy_maple-rev3: @echo build_maple-rev5: TARGETFLAGS= -DTARGET_MAPLE_REV5 $(DEFINES) -# Set the linker script -build_maple-rev5: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_maple-rev5: elf bin lss sym copy_maple-rev5: @echo @@ -179,8 +171,6 @@ copy_maple-rev5: @echo build_generic-none: TARGETFLAGS= -DTARGET_GENERIC_F103_NONE $(DEFINES) -# Set the linker script -build_generic-none: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-none: elf bin lss sym copy_generic-none: @echo @@ -191,8 +181,6 @@ copy_generic-none: build_generic-pc13: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13 $(DEFINES) -# Set the linker script -build_generic-pc13: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pc13: elf bin lss sym copy_generic-pc13: @echo @@ -202,8 +190,6 @@ copy_generic-pc13: @echo build_generic-pg15: TARGETFLAGS= -DTARGET_GENERIC_F103_PG15 $(DEFINES) -# Set the linker script -build_generic-pg15: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pg15: elf bin lss sym copy_generic-pg15: @echo @@ -214,8 +200,6 @@ copy_generic-pg15: build_generic-pd2: TARGETFLAGS= -DTARGET_GENERIC_F103_PD2 $(DEFINES) -# Set the linker script -build_generic-pd2: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pd2: elf bin lss sym copy_generic-pd2: @echo @@ -226,8 +210,6 @@ copy_generic-pd2: build_generic-pd1: TARGETFLAGS= -DTARGET_GENERIC_F103_PD1 $(DEFINES) -# Set the linker script -build_generic-pd1: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pd1: elf bin lss sym copy_generic-pd1: @echo @@ -237,8 +219,6 @@ copy_generic-pd1: @echo build_generic-pa1: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1 $(DEFINES) -# Set the linker script -build_generic-pa1: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pa1: elf bin lss sym copy_generic-pa1: @echo @@ -248,8 +228,6 @@ copy_generic-pa1: @echo build_generic-pa1-button-pa8: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 $(DEFINES) -# Set the linker script -build_generic-pa1-button-pa8: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pa1-button-pa8: elf bin lss sym copy_generic-pa1-button-pa8: @echo @@ -259,8 +237,6 @@ copy_generic-pa1-button-pa8: @echo build_generic-pb9: TARGETFLAGS= -DTARGET_GENERIC_F103_PB9 $(DEFINES) -# Set the linker script -build_generic-pb9: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pb9: elf bin lss sym copy_generic-pb9: @echo @@ -271,8 +247,6 @@ copy_generic-pb9: build_generic-pe2: TARGETFLAGS= -DTARGET_GENERIC_F103_PE2 $(DEFINES) -# Set the linker script -build_generic-pe2: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pe2: elf bin lss sym copy_generic-pe2: @echo @@ -283,8 +257,6 @@ copy_generic-pe2: build_generic-pa9: TARGETFLAGS= -DTARGET_GENERIC_F103_PA9 $(DEFINES) -# Set the linker script -build_generic-pa9: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pa9: elf bin lss sym copy_generic-pa9: @echo @@ -295,8 +267,6 @@ copy_generic-pa9: build_generic-pe5: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5 $(DEFINES) -# Set the linker script -build_generic-pe5: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pe5: elf bin lss sym copy_generic-pe5: @echo @@ -307,8 +277,6 @@ copy_generic-pe5: build_generic-pe5-button-pa0: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 $(DEFINES) -# Set the linker script -build_generic-pe5-button-pa0: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pe5-button-pa0: elf bin lss sym copy_generic-pe5-button-pa0: @echo @@ -319,8 +287,6 @@ copy_generic-pe5-button-pa0: build_generic-pb7: TARGETFLAGS= -DTARGET_GENERIC_F103_PB7 $(DEFINES) -# Set the linker script -build_generic-pb7: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pb7: elf bin lss sym copy_generic-pb7: @echo @@ -330,8 +296,6 @@ copy_generic-pb7: @echo build_generic-pb0: TARGETFLAGS= -DTARGET_GENERIC_F103_PB0 $(DEFINES) -# Set the linker script -build_generic-pb0: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pb0: elf bin lss sym copy_generic-pb0: @echo @@ -342,8 +306,6 @@ copy_generic-pb0: build_stbee: TARGETFLAGS= -DTARGET_STBEE $(DEFINES) -# Set the linker script -build_stbee: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_stbee: elf bin lss sym copy_stbee: @echo @@ -353,8 +315,6 @@ copy_stbee: @echo build_naze32: TARGETFLAGS= -DTARGET_NAZE32 $(DEFINES) -# Set the linker script -build_naze32: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_naze32: elf bin lss sym copy_naze32: @echo @@ -364,8 +324,6 @@ copy_naze32: @echo build_generic-pb12: TARGETFLAGS= -DTARGET_GENERIC_F103_PB12 $(DEFINES) -# Set the linker script -build_generic-pb12: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pb12: elf bin lss sym copy_generic-pb12: @echo @@ -375,8 +333,6 @@ copy_generic-pb12: @echo build_hytiny-stm32f103t: TARGETFLAGS= -DTARGET_HYTINY_STM32F103T $(DEFINES) -# Set the linker script -build_hytiny-stm32f103t: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_hytiny-stm32f103t: elf bin lss sym copy_hytiny-stm32f103t: @echo @@ -386,8 +342,6 @@ copy_hytiny-stm32f103t: @echo build_dso138: TARGETFLAGS= -DTARGET_DSO138 $(DEFINES) -# Set the linker script -build_dso138: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_dso138: elf bin lss sym copy_dso138: @echo @@ -397,8 +351,6 @@ copy_dso138: @echo build_gd32f1-generic-pc13: TARGETFLAGS= -DTARGET_GD32F1_GENERIC_F103_PC13 $(DEFINES) -# Set the linker script -build_gd32f1-generic-pc13: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_gd32f1-generic-pc13: elf bin lss sym copy_gd32f1-generic-pc13: @echo @@ -408,8 +360,6 @@ copy_gd32f1-generic-pc13: @echo build_gd32f1-frankenmaple: TARGETFLAGS= -DTARGET_GD32F1_FRANKENMAPLE $(DEFINES) -# Set the linker script -build_gd32f1-frankenmaple: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_gd32f1-frankenmaple: elf bin lss sym copy_gd32f1-frankenmaple: @echo @@ -419,8 +369,6 @@ copy_gd32f1-frankenmaple: @echo build_cc3d: TARGETFLAGS= -DTARGET_CC3D -# Set the linker script -build_cc3d: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_cc3d: elf bin lss sym copy_cc3d: @echo @@ -430,8 +378,6 @@ copy_cc3d: @echo build_generic-pc13-fastboot: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13_FASTBOOT $(DEFINES) -# Set the linker script -build_generic-pc13-fastboot: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_generic-pc13-fastboot: elf bin lss sym copy_generic-pc13-fastboot: @echo @@ -441,8 +387,6 @@ copy_generic-pc13-fastboot: @echo build_smart-v2: TARGETFLAGS= -DTARGET_STM32_SMART_V20 $(DEFINES) -# Set the linker script -build_smart-v2: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld build_smart-v2: elf bin lss sym copy_smart-v2: @echo From 7a8b67dd2d0130cf1dfd58c6693c16059f3d1107 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Thu, 7 May 2020 15:56:16 -0500 Subject: [PATCH 2/5] Makefile: Use common copy command --- Makefile | 235 +++++++++++++++---------------------------------------- 1 file changed, 63 insertions(+), 172 deletions(-) diff --git a/Makefile b/Makefile index a3bb351..03a7be4 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ THUMB_IW = -mthumb-interwork # Target file name (without extension). BUILDDIR = build +BINDIR = bootloader_only_binaries TARGET = $(BUILDDIR)/maple_boot ST_LIB = stm32_lib @@ -145,255 +146,138 @@ build: elf bin lss sym build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI $(DEFINES) build_maple-mini: elf bin lss sym -copy_maple_mini: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/maple_mini_boot20.bin - @echo +copy_maple_mini: BINFILE=maple_mini_boot20.bin +copy_maple_mini: copy build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3 $(DEFINES) build_maple-rev3: elf bin lss sym -copy_maple-rev3: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/maple_rev3_boot20.bin - @echo +copy_maple-rev3: BINFILE=/maple_rev3_boot20.bin +copy_maple-rev3: copy build_maple-rev5: TARGETFLAGS= -DTARGET_MAPLE_REV5 $(DEFINES) build_maple-rev5: elf bin lss sym -copy_maple-rev5: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/maple_rev5_boot20.bin - @echo +copy_maple-rev5: BINFILE=maple_rev5_boot20.bin +copy_maple-rev5: copy build_generic-none: TARGETFLAGS= -DTARGET_GENERIC_F103_NONE $(DEFINES) build_generic-none: elf bin lss sym -copy_generic-none: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic-none_bootloader.bin - @echo - +copy_generic-none: BINFILE=generic-none_bootloader.bin +copy_generic-none: copy build_generic-pc13: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13 $(DEFINES) build_generic-pc13: elf bin lss sym -copy_generic-pc13: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pc13.bin - @echo +copy_generic-pc13: BINFILE=generic_boot20_pc13.bin +copy_generic-pc13: copy build_generic-pg15: TARGETFLAGS= -DTARGET_GENERIC_F103_PG15 $(DEFINES) build_generic-pg15: elf bin lss sym -copy_generic-pg15: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pg15.bin - @echo - +copy_generic-pg15: BINFILE=generic_boot20_pg15.bin +copy_generic-pg15: copy build_generic-pd2: TARGETFLAGS= -DTARGET_GENERIC_F103_PD2 $(DEFINES) build_generic-pd2: elf bin lss sym -copy_generic-pd2: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pd2.bin - @echo - +copy_generic-pd2: BINFILE=generic_boot20_pd2.bin +copy_generic-pd2: copy build_generic-pd1: TARGETFLAGS= -DTARGET_GENERIC_F103_PD1 $(DEFINES) build_generic-pd1: elf bin lss sym -copy_generic-pd1: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pd1.bin - @echo +copy_generic-pd1: BINFILE=generic_boot20_pd1.bin +copy_generic-pd1: copy build_generic-pa1: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1 $(DEFINES) build_generic-pa1: elf bin lss sym -copy_generic-pa1: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pa1.bin - @echo +copy_generic-pa1: BINFILE=generic_boot20_pa1.bin +copy_generic-pa1: copy build_generic-pa1-button-pa8: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 $(DEFINES) build_generic-pa1-button-pa8: elf bin lss sym -copy_generic-pa1-button-pa8: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pa1_button_pa8.bin - @echo +copy_generic-pa1-button-pa8: BINFILE=generic_boot20_pa1_button_pa8.bin +copy_generic-pa1-button-pa8: copy build_generic-pb9: TARGETFLAGS= -DTARGET_GENERIC_F103_PB9 $(DEFINES) build_generic-pb9: elf bin lss sym -copy_generic-pb9: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb9.bin - @echo - +copy_generic-pb9: BINFILE=generic_boot20_pb9.bin +copy_generic-pb9: copy build_generic-pe2: TARGETFLAGS= -DTARGET_GENERIC_F103_PE2 $(DEFINES) build_generic-pe2: elf bin lss sym -copy_generic-pe2: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pe2.bin - @echo - +copy_generic-pe2: BINFILE=generic_boot20_pe2.bin +copy_generic-pe2: copy build_generic-pa9: TARGETFLAGS= -DTARGET_GENERIC_F103_PA9 $(DEFINES) build_generic-pa9: elf bin lss sym -copy_generic-pa9: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pa9.bin - @echo - +copy_generic-pa9: BINFILE=generic_boot20_pa9.bin +copy_generic-pa9: copy build_generic-pe5: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5 $(DEFINES) build_generic-pe5: elf bin lss sym -copy_generic-pe5: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pe5.bin - @echo - +copy_generic-pe5: BINFILE=generic_boot20_pe5.bin +copy_generic-pe5: copy build_generic-pe5-button-pa0: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 $(DEFINES) build_generic-pe5-button-pa0: elf bin lss sym -copy_generic-pe5-button-pa0: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pe5_button_pa0.bin - @echo - +copy_generic-pe5-button-pa0: BINFILE=generic_boot20_pe5_button_pa0.bin +copy_generic-pe5-button-pa0: copy build_generic-pb7: TARGETFLAGS= -DTARGET_GENERIC_F103_PB7 $(DEFINES) build_generic-pb7: elf bin lss sym -copy_generic-pb7: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb7.bin - @echo +copy_generic-pb7: BINFILE=generic_boot20_pb7.bin +copy_generic-pb7: copy build_generic-pb0: TARGETFLAGS= -DTARGET_GENERIC_F103_PB0 $(DEFINES) build_generic-pb0: elf bin lss sym -copy_generic-pb0: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb0.bin - @echo - +copy_generic-pb0: BINFILE=generic_boot20_pb0.bin +copy_generic-pb0: copy build_stbee: TARGETFLAGS= -DTARGET_STBEE $(DEFINES) build_stbee: elf bin lss sym -copy_stbee: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/stbee_boot20.bin - @echo +copy_stbee: BINFILE=stbee_boot20.bin +copy_stbee: copy build_naze32: TARGETFLAGS= -DTARGET_NAZE32 $(DEFINES) build_naze32: elf bin lss sym -copy_naze32: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/naze32_boot20.bin - @echo +copy_naze32: BINFILE=naze32_boot20.bin +copy_naze32: copy build_generic-pb12: TARGETFLAGS= -DTARGET_GENERIC_F103_PB12 $(DEFINES) build_generic-pb12: elf bin lss sym -copy_generic-pb12: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb12.bin - @echo +copy_generic-pb12: BINFILE=generic_boot20_pb12.bin +copy_generic-pb12: copy build_hytiny-stm32f103t: TARGETFLAGS= -DTARGET_HYTINY_STM32F103T $(DEFINES) build_hytiny-stm32f103t: elf bin lss sym -copy_hytiny-stm32f103t: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_hytiny.bin - @echo +copy_hytiny-stm32f103t: BINFILE=generic_boot20_hytiny.bin +copy_hytiny-stm32f103t: copy build_dso138: TARGETFLAGS= -DTARGET_DSO138 $(DEFINES) build_dso138: elf bin lss sym -copy_dso138: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/dso138_boot20.bin - @echo +copy_dso138: BINFILE=dso138_boot20.bin +copy_dso138: copy build_gd32f1-generic-pc13: TARGETFLAGS= -DTARGET_GD32F1_GENERIC_F103_PC13 $(DEFINES) build_gd32f1-generic-pc13: elf bin lss sym -copy_gd32f1-generic-pc13: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/gd32f1_generic_boot20_pc13.bin - @echo +copy_gd32f1-generic-pc13: BINFILE=gd32f1_generic_boot20_pc13.bin +copy_gd32f1-generic-pc13: copy build_gd32f1-frankenmaple: TARGETFLAGS= -DTARGET_GD32F1_FRANKENMAPLE $(DEFINES) build_gd32f1-frankenmaple: elf bin lss sym -copy_gd32f1-frankenmaple: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/gd32f1_frankenmaple.bin - @echo +copy_gd32f1-frankenmaple: BINFILE=gd32f1_frankenmaple.bin +copy_gd32f1-frankenmaple: copy build_cc3d: TARGETFLAGS= -DTARGET_CC3D build_cc3d: elf bin lss sym -copy_cc3d: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/cc3d.bin - @echo +copy_cc3d: BINFILE=cc3d.bin +copy_cc3d: copy build_generic-pc13-fastboot: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13_FASTBOOT $(DEFINES) build_generic-pc13-fastboot: elf bin lss sym -copy_generic-pc13-fastboot: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pc13_fastboot.bin - @echo +copy_generic-pc13-fastboot: BINFILE=generic_boot20_pc13_fastboot.bin +copy_generic-pc13-fastboot: copy build_smart-v2: TARGETFLAGS= -DTARGET_STM32_SMART_V20 $(DEFINES) build_smart-v2: elf bin lss sym -copy_smart-v2: - @echo - @echo "Copying to binaries folder" - @echo - cp $(TARGET).bin bootloader_only_binaries/smart-v2.bin - @echo +copy_smart-v2: BINFILE=smart-v2.bin +copy_smart-v2: copy bin: $(TARGET).bin elf: $(TARGET).elf @@ -402,6 +286,13 @@ sym: $(TARGET).sym dfu: $(TARGET).bin sudo dfu-util -d 0110:1001 -a 0 -D $(TARGET).bin +copy: + @echo + @echo "Copying to binaries folder" + @echo + cp $(TARGET).bin $(BINDIR)/$(BINFILE) + @echo + begin: mkdir -p build/stm32_lib mkdir -p build/usb_lib @@ -521,7 +412,7 @@ clean_list : # Listing of phony targets. .PHONY : all begin finish tags end sizeafter gccversion \ -build elf hex bin lss sym clean clean_list program cscope +build elf hex bin lss sym copy clean clean_list program cscope cscope: rm -rf *.cscope From c745164cdf3c284d24422a7ca95e887a5f2d2fe5 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Thu, 7 May 2020 15:05:05 -0500 Subject: [PATCH 3/5] Makefile: Clean up flags --- Makefile | 73 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 03a7be4..8822cc4 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ DEBUG = INCDIRS = ./$(ST_LIB) ./$(ST_USB) +# Compiler Flags CFLAGS = $(DEBUG) CFLAGS += -O$(OPT) CFLAGS += -ffunction-sections -fdata-sections @@ -33,10 +34,16 @@ CFLAGS += -Wpointer-arith -Wswitch CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused CFLAGS += -Wa,-adhlns=$(BUILDDIR)/$(subst $(suffix $<),.lst,$<) CFLAGS += $(patsubst %,-I%,$(INCDIRS)) +CFLAGS += -MD -MP -MF .dep/$(@F).d +CFLAGS += -g -mcpu=$(MCU) $(THUMB_IW) -I. +CFLAGS += $(THUMB) # Assembler Flags ASFLAGS = -Wa,-adhlns=$(BUILDDIR)/$(<:.s=.lst)#,--g$(DEBUG) +ASFLAGS += -g -mcpu=$(MCU) $(THUMB_IW) -I. -x assembler-with-cpp +ASFLAGS += $(THUMB) +# Linker Flags LDFLAGS = -nostartfiles -Wl,-Map=$(TARGET).map,--cref,--gc-sections LDFLAGS += -lc -lgcc LDFLAGS += -T$(ST_LIB)/c_only_md_high_density.ld @@ -71,12 +78,6 @@ MSG_COMPILING = Compiling C: MSG_ASSEMBLING = Assembling: MSG_CLEANING = Cleaning project: -# Combine all necessary flags and optional flags. -# Add target processor to flags. -GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d -ALL_CFLAGS = -g -mcpu=$(MCU) $(THUMB_IW) -I. $(CFLAGS) $(TARGETFLAGS) $(GENDEPFLAGS) -ALL_ASFLAGS = -g -mcpu=$(MCU) $(THUMB_IW) -I. -x assembler-with-cpp $(ASFLAGS) - # --------------------------------------------- # # file management ASRC = $(ST_LIB)/c_only_startup.s $(ST_LIB)/cortexm3_macro.s @@ -144,137 +145,137 @@ smart-v2: begin clean gccversion build_smart-v2 sizeafter finished copy_smart-v build: elf bin lss sym -build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI $(DEFINES) +build_maple-mini: CFLAGS += -DTARGET_MAPLE_MINI build_maple-mini: elf bin lss sym copy_maple_mini: BINFILE=maple_mini_boot20.bin copy_maple_mini: copy -build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3 $(DEFINES) +build_maple-rev3: CFLAGS += -DTARGET_MAPLE_REV3 build_maple-rev3: elf bin lss sym copy_maple-rev3: BINFILE=/maple_rev3_boot20.bin copy_maple-rev3: copy -build_maple-rev5: TARGETFLAGS= -DTARGET_MAPLE_REV5 $(DEFINES) +build_maple-rev5: CFLAGS += -DTARGET_MAPLE_REV5 build_maple-rev5: elf bin lss sym copy_maple-rev5: BINFILE=maple_rev5_boot20.bin copy_maple-rev5: copy -build_generic-none: TARGETFLAGS= -DTARGET_GENERIC_F103_NONE $(DEFINES) +build_generic-none: CFLAGS += -DTARGET_GENERIC_F103_NONE build_generic-none: elf bin lss sym copy_generic-none: BINFILE=generic-none_bootloader.bin copy_generic-none: copy -build_generic-pc13: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13 $(DEFINES) +build_generic-pc13: CFLAGS += -DTARGET_GENERIC_F103_PC13 build_generic-pc13: elf bin lss sym copy_generic-pc13: BINFILE=generic_boot20_pc13.bin copy_generic-pc13: copy -build_generic-pg15: TARGETFLAGS= -DTARGET_GENERIC_F103_PG15 $(DEFINES) +build_generic-pg15: CFLAGS += -DTARGET_GENERIC_F103_PG15 build_generic-pg15: elf bin lss sym copy_generic-pg15: BINFILE=generic_boot20_pg15.bin copy_generic-pg15: copy -build_generic-pd2: TARGETFLAGS= -DTARGET_GENERIC_F103_PD2 $(DEFINES) +build_generic-pd2: CFLAGS += -DTARGET_GENERIC_F103_PD2 build_generic-pd2: elf bin lss sym copy_generic-pd2: BINFILE=generic_boot20_pd2.bin copy_generic-pd2: copy -build_generic-pd1: TARGETFLAGS= -DTARGET_GENERIC_F103_PD1 $(DEFINES) +build_generic-pd1: CFLAGS += -DTARGET_GENERIC_F103_PD1 build_generic-pd1: elf bin lss sym copy_generic-pd1: BINFILE=generic_boot20_pd1.bin copy_generic-pd1: copy -build_generic-pa1: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1 $(DEFINES) +build_generic-pa1: CFLAGS += -DTARGET_GENERIC_F103_PA1 build_generic-pa1: elf bin lss sym copy_generic-pa1: BINFILE=generic_boot20_pa1.bin copy_generic-pa1: copy -build_generic-pa1-button-pa8: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 $(DEFINES) +build_generic-pa1-button-pa8: CFLAGS += -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 build_generic-pa1-button-pa8: elf bin lss sym copy_generic-pa1-button-pa8: BINFILE=generic_boot20_pa1_button_pa8.bin copy_generic-pa1-button-pa8: copy -build_generic-pb9: TARGETFLAGS= -DTARGET_GENERIC_F103_PB9 $(DEFINES) +build_generic-pb9: CFLAGS += -DTARGET_GENERIC_F103_PB9 build_generic-pb9: elf bin lss sym copy_generic-pb9: BINFILE=generic_boot20_pb9.bin copy_generic-pb9: copy -build_generic-pe2: TARGETFLAGS= -DTARGET_GENERIC_F103_PE2 $(DEFINES) +build_generic-pe2: CFLAGS += -DTARGET_GENERIC_F103_PE2 build_generic-pe2: elf bin lss sym copy_generic-pe2: BINFILE=generic_boot20_pe2.bin copy_generic-pe2: copy -build_generic-pa9: TARGETFLAGS= -DTARGET_GENERIC_F103_PA9 $(DEFINES) +build_generic-pa9: CFLAGS += -DTARGET_GENERIC_F103_PA9 build_generic-pa9: elf bin lss sym copy_generic-pa9: BINFILE=generic_boot20_pa9.bin copy_generic-pa9: copy -build_generic-pe5: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5 $(DEFINES) +build_generic-pe5: CFLAGS += -DTARGET_GENERIC_F103_PE5 build_generic-pe5: elf bin lss sym copy_generic-pe5: BINFILE=generic_boot20_pe5.bin copy_generic-pe5: copy -build_generic-pe5-button-pa0: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 $(DEFINES) +build_generic-pe5-button-pa0: CFLAGS += -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 build_generic-pe5-button-pa0: elf bin lss sym copy_generic-pe5-button-pa0: BINFILE=generic_boot20_pe5_button_pa0.bin copy_generic-pe5-button-pa0: copy -build_generic-pb7: TARGETFLAGS= -DTARGET_GENERIC_F103_PB7 $(DEFINES) +build_generic-pb7: CFLAGS += -DTARGET_GENERIC_F103_PB7 build_generic-pb7: elf bin lss sym copy_generic-pb7: BINFILE=generic_boot20_pb7.bin copy_generic-pb7: copy -build_generic-pb0: TARGETFLAGS= -DTARGET_GENERIC_F103_PB0 $(DEFINES) +build_generic-pb0: CFLAGS += -DTARGET_GENERIC_F103_PB0 build_generic-pb0: elf bin lss sym copy_generic-pb0: BINFILE=generic_boot20_pb0.bin copy_generic-pb0: copy -build_stbee: TARGETFLAGS= -DTARGET_STBEE $(DEFINES) +build_stbee: CFLAGS += -DTARGET_STBEE build_stbee: elf bin lss sym copy_stbee: BINFILE=stbee_boot20.bin copy_stbee: copy -build_naze32: TARGETFLAGS= -DTARGET_NAZE32 $(DEFINES) +build_naze32: CFLAGS += -DTARGET_NAZE32 build_naze32: elf bin lss sym copy_naze32: BINFILE=naze32_boot20.bin copy_naze32: copy -build_generic-pb12: TARGETFLAGS= -DTARGET_GENERIC_F103_PB12 $(DEFINES) +build_generic-pb12: CFLAGS += -DTARGET_GENERIC_F103_PB12 build_generic-pb12: elf bin lss sym copy_generic-pb12: BINFILE=generic_boot20_pb12.bin copy_generic-pb12: copy -build_hytiny-stm32f103t: TARGETFLAGS= -DTARGET_HYTINY_STM32F103T $(DEFINES) +build_hytiny-stm32f103t: CFLAGS += -DTARGET_HYTINY_STM32F103T build_hytiny-stm32f103t: elf bin lss sym copy_hytiny-stm32f103t: BINFILE=generic_boot20_hytiny.bin copy_hytiny-stm32f103t: copy -build_dso138: TARGETFLAGS= -DTARGET_DSO138 $(DEFINES) +build_dso138: CFLAGS += -DTARGET_DSO138 build_dso138: elf bin lss sym copy_dso138: BINFILE=dso138_boot20.bin copy_dso138: copy -build_gd32f1-generic-pc13: TARGETFLAGS= -DTARGET_GD32F1_GENERIC_F103_PC13 $(DEFINES) +build_gd32f1-generic-pc13: CFLAGS += -DTARGET_GD32F1_GENERIC_F103_PC13 build_gd32f1-generic-pc13: elf bin lss sym copy_gd32f1-generic-pc13: BINFILE=gd32f1_generic_boot20_pc13.bin copy_gd32f1-generic-pc13: copy -build_gd32f1-frankenmaple: TARGETFLAGS= -DTARGET_GD32F1_FRANKENMAPLE $(DEFINES) +build_gd32f1-frankenmaple: CFLAGS += -DTARGET_GD32F1_FRANKENMAPLE build_gd32f1-frankenmaple: elf bin lss sym copy_gd32f1-frankenmaple: BINFILE=gd32f1_frankenmaple.bin copy_gd32f1-frankenmaple: copy -build_cc3d: TARGETFLAGS= -DTARGET_CC3D +build_cc3d: CFLAGS += -DTARGET_CC3D build_cc3d: elf bin lss sym copy_cc3d: BINFILE=cc3d.bin copy_cc3d: copy -build_generic-pc13-fastboot: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13_FASTBOOT $(DEFINES) +build_generic-pc13-fastboot: CFLAGS += -DTARGET_GENERIC_F103_PC13_FASTBOOT build_generic-pc13-fastboot: elf bin lss sym copy_generic-pc13-fastboot: BINFILE=generic_boot20_pc13_fastboot.bin copy_generic-pc13-fastboot: copy -build_smart-v2: TARGETFLAGS= -DTARGET_STM32_SMART_V20 $(DEFINES) +build_smart-v2: CFLAGS += -DTARGET_STM32_SMART_V20 build_smart-v2: elf bin lss sym copy_smart-v2: BINFILE=smart-v2.bin copy_smart-v2: copy @@ -369,19 +370,19 @@ run: $(TARGET).bin %.elf: $(COBJ) $(AOBJ) @echo @echo $(MSG_LINKING) $@ - $(CC) $(THUMB) $(ALL_CFLAGS) $(AOBJ) $(COBJ) --output $@ $(LDFLAGS) + $(CC) $(CFLAGS) $(AOBJ) $(COBJ) --output $@ $(LDFLAGS) # Compile: create object files from C source files. ARM/Thumb $(COBJ) : $(BUILDDIR)/%.o : %.c @echo @echo $(MSG_COMPILING) $< - $(CC) -c $(THUMB) $(ALL_CFLAGS) $< -o $@ + $(CC) -c $(CFLAGS) $< -o $@ # Assemble: create object files from assembler source files. ARM/Thumb $(AOBJ) : $(BUILDDIR)/%.o : %.s @echo @echo $(MSG_ASSEMBLING) $< - $(CC) -c $(THUMB) $(ALL_ASFLAGS) $< -o $@ + $(CC) -c $(ASFLAGS) $< -o $@ clean: begin clean_list finished end From 93bf94ed3f2b73323e1388187b42c346159186e6 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Thu, 7 May 2020 13:26:14 -0500 Subject: [PATCH 4/5] Makefile: Use board makefiles --- Makefile | 19 +++++++++++++++-- boards/cc3d.mk | 1 + boards/dso138_boot20.mk | 1 + boards/gd32f1_frankenmaple.mk | 1 + boards/gd32f1_generic_boot20_pc13.mk | 1 + boards/generic-none_bootloader.mk | 1 + boards/generic_boot20_hytiny.mk | 1 + boards/generic_boot20_pa1.mk | 1 + boards/generic_boot20_pa1_button_pa8.mk | 1 + boards/generic_boot20_pa9.mk | 1 + boards/generic_boot20_pb0.mk | 1 + boards/generic_boot20_pb12.mk | 1 + boards/generic_boot20_pb7.mk | 1 + boards/generic_boot20_pb9.mk | 1 + boards/generic_boot20_pc13.mk | 1 + boards/generic_boot20_pc13_fastboot.mk | 1 + boards/generic_boot20_pd1.mk | 1 + boards/generic_boot20_pd2.mk | 1 + boards/generic_boot20_pe2.mk | 1 + boards/generic_boot20_pe5.mk | 1 + boards/generic_boot20_pe5_button_pa0.mk | 1 + boards/generic_boot20_pg15.mk | 1 + boards/maple_mini_boot20.mk | 1 + boards/maple_rev3_boot20.mk | 1 + boards/maple_rev5_boot20.mk | 1 + boards/naze32_boot20.mk | 1 + boards/smart-v2.mk | 1 + boards/stbee_boot20.mk | 1 + make_all.bat | 27 ------------------------- 29 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 boards/cc3d.mk create mode 100644 boards/dso138_boot20.mk create mode 100644 boards/gd32f1_frankenmaple.mk create mode 100644 boards/gd32f1_generic_boot20_pc13.mk create mode 100644 boards/generic-none_bootloader.mk create mode 100644 boards/generic_boot20_hytiny.mk create mode 100644 boards/generic_boot20_pa1.mk create mode 100644 boards/generic_boot20_pa1_button_pa8.mk create mode 100644 boards/generic_boot20_pa9.mk create mode 100644 boards/generic_boot20_pb0.mk create mode 100644 boards/generic_boot20_pb12.mk create mode 100644 boards/generic_boot20_pb7.mk create mode 100644 boards/generic_boot20_pb9.mk create mode 100644 boards/generic_boot20_pc13.mk create mode 100644 boards/generic_boot20_pc13_fastboot.mk create mode 100644 boards/generic_boot20_pd1.mk create mode 100644 boards/generic_boot20_pd2.mk create mode 100644 boards/generic_boot20_pe2.mk create mode 100644 boards/generic_boot20_pe5.mk create mode 100644 boards/generic_boot20_pe5_button_pa0.mk create mode 100644 boards/generic_boot20_pg15.mk create mode 100644 boards/maple_mini_boot20.mk create mode 100644 boards/maple_rev3_boot20.mk create mode 100644 boards/maple_rev5_boot20.mk create mode 100644 boards/naze32_boot20.mk create mode 100644 boards/smart-v2.mk create mode 100644 boards/stbee_boot20.mk delete mode 100644 make_all.bat diff --git a/Makefile b/Makefile index 8822cc4..d2ee5ef 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ THUMB_IW = -mthumb-interwork # Target file name (without extension). BUILDDIR = build BINDIR = bootloader_only_binaries +BOARDSDIR = boards TARGET = $(BUILDDIR)/maple_boot ST_LIB = stm32_lib @@ -112,8 +113,22 @@ LST = $(patsubst %, $(BUILDDIR)/%,$(_LST)) HEXSIZE = $(SIZE) --target=binary $(TARGET).hex ELFSIZE = $(SIZE) -A $(TARGET).elf +BOARDS = $(notdir $(basename $(wildcard $(BOARDSDIR)/*.mk))) + +# If $(MAKECMDGOALS) is in the list of $(BOARDS): +ifneq ($(filter $(MAKECMDGOALS),$(BOARDS)),) +include $(BOARDSDIR)/$(MAKECMDGOALS).mk +BINFILE = $(MAKECMDGOALS).bin +endif + # go! -all: begin gccversion build sizeafter finished end +all: + set -e ;\ + for board in $(BOARDS) ; do \ + make $$board ;\ + done + +$(BOARDS): begin clean gccversion build sizeafter finished copy end maple-mini: begin clean gccversion build_maple-mini sizeafter finished copy_maple_mini end maple-rev3: begin clean gccversion build_maple-rev3 sizeafter finished copy_maple-rev3 end @@ -413,7 +428,7 @@ clean_list : # Listing of phony targets. .PHONY : all begin finish tags end sizeafter gccversion \ -build elf hex bin lss sym copy clean clean_list program cscope +build elf hex bin lss sym copy clean clean_list program cscope $(BOARDS) cscope: rm -rf *.cscope diff --git a/boards/cc3d.mk b/boards/cc3d.mk new file mode 100644 index 0000000..a2ba800 --- /dev/null +++ b/boards/cc3d.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_CC3D diff --git a/boards/dso138_boot20.mk b/boards/dso138_boot20.mk new file mode 100644 index 0000000..a5e0b86 --- /dev/null +++ b/boards/dso138_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_DSO138 diff --git a/boards/gd32f1_frankenmaple.mk b/boards/gd32f1_frankenmaple.mk new file mode 100644 index 0000000..b111718 --- /dev/null +++ b/boards/gd32f1_frankenmaple.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GD32F1_FRANKENMAPLE diff --git a/boards/gd32f1_generic_boot20_pc13.mk b/boards/gd32f1_generic_boot20_pc13.mk new file mode 100644 index 0000000..559fb6a --- /dev/null +++ b/boards/gd32f1_generic_boot20_pc13.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GD32F1_GENERIC_F103_PC13 diff --git a/boards/generic-none_bootloader.mk b/boards/generic-none_bootloader.mk new file mode 100644 index 0000000..aaea50e --- /dev/null +++ b/boards/generic-none_bootloader.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_NONE diff --git a/boards/generic_boot20_hytiny.mk b/boards/generic_boot20_hytiny.mk new file mode 100644 index 0000000..d211e99 --- /dev/null +++ b/boards/generic_boot20_hytiny.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_HYTINY_STM32F103T diff --git a/boards/generic_boot20_pa1.mk b/boards/generic_boot20_pa1.mk new file mode 100644 index 0000000..580a9aa --- /dev/null +++ b/boards/generic_boot20_pa1.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PA1 diff --git a/boards/generic_boot20_pa1_button_pa8.mk b/boards/generic_boot20_pa1_button_pa8.mk new file mode 100644 index 0000000..25d7d3c --- /dev/null +++ b/boards/generic_boot20_pa1_button_pa8.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 diff --git a/boards/generic_boot20_pa9.mk b/boards/generic_boot20_pa9.mk new file mode 100644 index 0000000..a08f01a --- /dev/null +++ b/boards/generic_boot20_pa9.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PA9 diff --git a/boards/generic_boot20_pb0.mk b/boards/generic_boot20_pb0.mk new file mode 100644 index 0000000..fce0f60 --- /dev/null +++ b/boards/generic_boot20_pb0.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PB0 diff --git a/boards/generic_boot20_pb12.mk b/boards/generic_boot20_pb12.mk new file mode 100644 index 0000000..f0d91e3 --- /dev/null +++ b/boards/generic_boot20_pb12.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PB12 diff --git a/boards/generic_boot20_pb7.mk b/boards/generic_boot20_pb7.mk new file mode 100644 index 0000000..8495599 --- /dev/null +++ b/boards/generic_boot20_pb7.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PB7 diff --git a/boards/generic_boot20_pb9.mk b/boards/generic_boot20_pb9.mk new file mode 100644 index 0000000..860f2f4 --- /dev/null +++ b/boards/generic_boot20_pb9.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PB9 diff --git a/boards/generic_boot20_pc13.mk b/boards/generic_boot20_pc13.mk new file mode 100644 index 0000000..9fdb399 --- /dev/null +++ b/boards/generic_boot20_pc13.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PC13 diff --git a/boards/generic_boot20_pc13_fastboot.mk b/boards/generic_boot20_pc13_fastboot.mk new file mode 100644 index 0000000..40c4d5c --- /dev/null +++ b/boards/generic_boot20_pc13_fastboot.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PC13_FASTBOOT diff --git a/boards/generic_boot20_pd1.mk b/boards/generic_boot20_pd1.mk new file mode 100644 index 0000000..608c171 --- /dev/null +++ b/boards/generic_boot20_pd1.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PD1 diff --git a/boards/generic_boot20_pd2.mk b/boards/generic_boot20_pd2.mk new file mode 100644 index 0000000..a2554a2 --- /dev/null +++ b/boards/generic_boot20_pd2.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PD2 diff --git a/boards/generic_boot20_pe2.mk b/boards/generic_boot20_pe2.mk new file mode 100644 index 0000000..bca9cd5 --- /dev/null +++ b/boards/generic_boot20_pe2.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PE2 diff --git a/boards/generic_boot20_pe5.mk b/boards/generic_boot20_pe5.mk new file mode 100644 index 0000000..7dbe7fc --- /dev/null +++ b/boards/generic_boot20_pe5.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PE5 diff --git a/boards/generic_boot20_pe5_button_pa0.mk b/boards/generic_boot20_pe5_button_pa0.mk new file mode 100644 index 0000000..0bd1324 --- /dev/null +++ b/boards/generic_boot20_pe5_button_pa0.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 diff --git a/boards/generic_boot20_pg15.mk b/boards/generic_boot20_pg15.mk new file mode 100644 index 0000000..425ddc5 --- /dev/null +++ b/boards/generic_boot20_pg15.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_GENERIC_F103_PG15 diff --git a/boards/maple_mini_boot20.mk b/boards/maple_mini_boot20.mk new file mode 100644 index 0000000..ca259ec --- /dev/null +++ b/boards/maple_mini_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_MAPLE_MINI diff --git a/boards/maple_rev3_boot20.mk b/boards/maple_rev3_boot20.mk new file mode 100644 index 0000000..45721fe --- /dev/null +++ b/boards/maple_rev3_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_MAPLE_REV3 diff --git a/boards/maple_rev5_boot20.mk b/boards/maple_rev5_boot20.mk new file mode 100644 index 0000000..cf5fb5d --- /dev/null +++ b/boards/maple_rev5_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_MAPLE_REV5 diff --git a/boards/naze32_boot20.mk b/boards/naze32_boot20.mk new file mode 100644 index 0000000..331858c --- /dev/null +++ b/boards/naze32_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_NAZE32 diff --git a/boards/smart-v2.mk b/boards/smart-v2.mk new file mode 100644 index 0000000..136634e --- /dev/null +++ b/boards/smart-v2.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_STM32_SMART_V20 diff --git a/boards/stbee_boot20.mk b/boards/stbee_boot20.mk new file mode 100644 index 0000000..8310e53 --- /dev/null +++ b/boards/stbee_boot20.mk @@ -0,0 +1 @@ +CFLAGS += -DTARGET_STBEE diff --git a/make_all.bat b/make_all.bat deleted file mode 100644 index 9980bdf..0000000 --- a/make_all.bat +++ /dev/null @@ -1,27 +0,0 @@ -make maple-mini -make maple-rev3 -make maple-rev5 -make generic-none -make generic-pc13 -make generic-pg15 -make generic-pd2 -make generic-pd1 -make generic-pa1 -make generic-pa1-button-pa8 -make generic-pb9 -make generic-pe2 -make generic-pa9 -make generic-pe5 -make generic-pe5-button-pa0 -make generic-pb7 -make generic-pb0 -make stbee -make naze32 -make generic-pb12 -make hytiny-stm32f103t -make dso138 -make gd32f1-generic-pc13 -make gd32f1-frankenmaple -make cc3d -make generic-pc13-fastboot -make smart-v2 From 50175b7e90cea64eaa95b4988f6a780b4093a545 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Thu, 7 May 2020 15:17:16 -0500 Subject: [PATCH 5/5] Makefile: Remove old rules --- Makefile | 163 ------------------------------------------------------- 1 file changed, 163 deletions(-) diff --git a/Makefile b/Makefile index d2ee5ef..740bd09 100644 --- a/Makefile +++ b/Makefile @@ -130,171 +130,8 @@ all: $(BOARDS): begin clean gccversion build sizeafter finished copy end -maple-mini: begin clean gccversion build_maple-mini sizeafter finished copy_maple_mini end -maple-rev3: begin clean gccversion build_maple-rev3 sizeafter finished copy_maple-rev3 end -maple-rev5: begin clean gccversion build_maple-rev5 sizeafter finished copy_maple-rev5 end -generic-none: begin clean gccversion build_generic-none sizeafter finished copy_generic-none end -generic-pc13: begin clean gccversion build_generic-pc13 sizeafter finished copy_generic-pc13 end -generic-pg15: begin clean gccversion build_generic-pg15 sizeafter finished copy_generic-pg15 end -generic-pd2: begin clean gccversion build_generic-pd2 sizeafter finished copy_generic-pd2 end -generic-pd1: begin clean gccversion build_generic-pd1 sizeafter finished copy_generic-pd1 end -generic-pa1: begin clean gccversion build_generic-pa1 sizeafter finished copy_generic-pa1 end -generic-pa1-button-pa8: begin clean gccversion build_generic-pa1-button-pa8 sizeafter finished copy_generic-pa1-button-pa8 end -generic-pb9: begin clean gccversion build_generic-pb9 sizeafter finished copy_generic-pb9 end -generic-pe2: begin clean gccversion build_generic-pe2 sizeafter finished copy_generic-pe2 end -generic-pa9: begin clean gccversion build_generic-pa9 sizeafter finished copy_generic-pa9 end -generic-pe5: begin clean gccversion build_generic-pe5 sizeafter finished copy_generic-pe5 end -generic-pe5-button-pa0: begin clean gccversion build_generic-pe5-button-pa0 sizeafter finished copy_generic-pe5-button-pa0 end -generic-pb7: begin clean gccversion build_generic-pb7 sizeafter finished copy_generic-pb7 end -generic-pb0: begin clean gccversion build_generic-pb0 sizeafter finished copy_generic-pb0 end -stbee : begin clean gccversion build_stbee sizeafter finished copy_stbee end -naze32: begin clean gccversion build_naze32 sizeafter finished copy_naze32 end -generic-pb12: begin clean gccversion build_generic-pb12 sizeafter finished copy_generic-pb12 end -hytiny-stm32f103t: begin clean gccversion build_hytiny-stm32f103t sizeafter finished copy_hytiny-stm32f103t end -dso138: begin clean gccversion build_dso138 sizeafter finished copy_dso138 end -gd32f1-generic-pc13: begin clean gccversion build_gd32f1-generic-pc13 sizeafter finished copy_gd32f1-generic-pc13 end -gd32f1-frankenmaple: begin clean gccversion build_gd32f1-frankenmaple sizeafter finished copy_gd32f1-frankenmaple end -cc3d: begin clean gccversion build_cc3d sizeafter finished copy_cc3d end -generic-pc13-fastboot: begin clean gccversion build_generic-pc13-fastboot sizeafter finished copy_generic-pc13-fastboot end -smart-v2: begin clean gccversion build_smart-v2 sizeafter finished copy_smart-v2 end - build: elf bin lss sym -build_maple-mini: CFLAGS += -DTARGET_MAPLE_MINI -build_maple-mini: elf bin lss sym -copy_maple_mini: BINFILE=maple_mini_boot20.bin -copy_maple_mini: copy - -build_maple-rev3: CFLAGS += -DTARGET_MAPLE_REV3 -build_maple-rev3: elf bin lss sym -copy_maple-rev3: BINFILE=/maple_rev3_boot20.bin -copy_maple-rev3: copy - -build_maple-rev5: CFLAGS += -DTARGET_MAPLE_REV5 -build_maple-rev5: elf bin lss sym -copy_maple-rev5: BINFILE=maple_rev5_boot20.bin -copy_maple-rev5: copy - -build_generic-none: CFLAGS += -DTARGET_GENERIC_F103_NONE -build_generic-none: elf bin lss sym -copy_generic-none: BINFILE=generic-none_bootloader.bin -copy_generic-none: copy - -build_generic-pc13: CFLAGS += -DTARGET_GENERIC_F103_PC13 -build_generic-pc13: elf bin lss sym -copy_generic-pc13: BINFILE=generic_boot20_pc13.bin -copy_generic-pc13: copy - -build_generic-pg15: CFLAGS += -DTARGET_GENERIC_F103_PG15 -build_generic-pg15: elf bin lss sym -copy_generic-pg15: BINFILE=generic_boot20_pg15.bin -copy_generic-pg15: copy - -build_generic-pd2: CFLAGS += -DTARGET_GENERIC_F103_PD2 -build_generic-pd2: elf bin lss sym -copy_generic-pd2: BINFILE=generic_boot20_pd2.bin -copy_generic-pd2: copy - -build_generic-pd1: CFLAGS += -DTARGET_GENERIC_F103_PD1 -build_generic-pd1: elf bin lss sym -copy_generic-pd1: BINFILE=generic_boot20_pd1.bin -copy_generic-pd1: copy - -build_generic-pa1: CFLAGS += -DTARGET_GENERIC_F103_PA1 -build_generic-pa1: elf bin lss sym -copy_generic-pa1: BINFILE=generic_boot20_pa1.bin -copy_generic-pa1: copy - -build_generic-pa1-button-pa8: CFLAGS += -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 -build_generic-pa1-button-pa8: elf bin lss sym -copy_generic-pa1-button-pa8: BINFILE=generic_boot20_pa1_button_pa8.bin -copy_generic-pa1-button-pa8: copy - -build_generic-pb9: CFLAGS += -DTARGET_GENERIC_F103_PB9 -build_generic-pb9: elf bin lss sym -copy_generic-pb9: BINFILE=generic_boot20_pb9.bin -copy_generic-pb9: copy - -build_generic-pe2: CFLAGS += -DTARGET_GENERIC_F103_PE2 -build_generic-pe2: elf bin lss sym -copy_generic-pe2: BINFILE=generic_boot20_pe2.bin -copy_generic-pe2: copy - -build_generic-pa9: CFLAGS += -DTARGET_GENERIC_F103_PA9 -build_generic-pa9: elf bin lss sym -copy_generic-pa9: BINFILE=generic_boot20_pa9.bin -copy_generic-pa9: copy - -build_generic-pe5: CFLAGS += -DTARGET_GENERIC_F103_PE5 -build_generic-pe5: elf bin lss sym -copy_generic-pe5: BINFILE=generic_boot20_pe5.bin -copy_generic-pe5: copy - -build_generic-pe5-button-pa0: CFLAGS += -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 -build_generic-pe5-button-pa0: elf bin lss sym -copy_generic-pe5-button-pa0: BINFILE=generic_boot20_pe5_button_pa0.bin -copy_generic-pe5-button-pa0: copy - -build_generic-pb7: CFLAGS += -DTARGET_GENERIC_F103_PB7 -build_generic-pb7: elf bin lss sym -copy_generic-pb7: BINFILE=generic_boot20_pb7.bin -copy_generic-pb7: copy - -build_generic-pb0: CFLAGS += -DTARGET_GENERIC_F103_PB0 -build_generic-pb0: elf bin lss sym -copy_generic-pb0: BINFILE=generic_boot20_pb0.bin -copy_generic-pb0: copy - -build_stbee: CFLAGS += -DTARGET_STBEE -build_stbee: elf bin lss sym -copy_stbee: BINFILE=stbee_boot20.bin -copy_stbee: copy - -build_naze32: CFLAGS += -DTARGET_NAZE32 -build_naze32: elf bin lss sym -copy_naze32: BINFILE=naze32_boot20.bin -copy_naze32: copy - -build_generic-pb12: CFLAGS += -DTARGET_GENERIC_F103_PB12 -build_generic-pb12: elf bin lss sym -copy_generic-pb12: BINFILE=generic_boot20_pb12.bin -copy_generic-pb12: copy - -build_hytiny-stm32f103t: CFLAGS += -DTARGET_HYTINY_STM32F103T -build_hytiny-stm32f103t: elf bin lss sym -copy_hytiny-stm32f103t: BINFILE=generic_boot20_hytiny.bin -copy_hytiny-stm32f103t: copy - -build_dso138: CFLAGS += -DTARGET_DSO138 -build_dso138: elf bin lss sym -copy_dso138: BINFILE=dso138_boot20.bin -copy_dso138: copy - -build_gd32f1-generic-pc13: CFLAGS += -DTARGET_GD32F1_GENERIC_F103_PC13 -build_gd32f1-generic-pc13: elf bin lss sym -copy_gd32f1-generic-pc13: BINFILE=gd32f1_generic_boot20_pc13.bin -copy_gd32f1-generic-pc13: copy - -build_gd32f1-frankenmaple: CFLAGS += -DTARGET_GD32F1_FRANKENMAPLE -build_gd32f1-frankenmaple: elf bin lss sym -copy_gd32f1-frankenmaple: BINFILE=gd32f1_frankenmaple.bin -copy_gd32f1-frankenmaple: copy - -build_cc3d: CFLAGS += -DTARGET_CC3D -build_cc3d: elf bin lss sym -copy_cc3d: BINFILE=cc3d.bin -copy_cc3d: copy - -build_generic-pc13-fastboot: CFLAGS += -DTARGET_GENERIC_F103_PC13_FASTBOOT -build_generic-pc13-fastboot: elf bin lss sym -copy_generic-pc13-fastboot: BINFILE=generic_boot20_pc13_fastboot.bin -copy_generic-pc13-fastboot: copy - -build_smart-v2: CFLAGS += -DTARGET_STM32_SMART_V20 -build_smart-v2: elf bin lss sym -copy_smart-v2: BINFILE=smart-v2.bin -copy_smart-v2: copy - bin: $(TARGET).bin elf: $(TARGET).elf lss: $(TARGET).lss