Build firmware executables as *.elf file
This commit is contained in:
parent
dd022fcb44
commit
a09104c281
|
@ -16,4 +16,5 @@ tags
|
|||
*.b#*
|
||||
blackmagic_upgrade
|
||||
*.exe
|
||||
*.elf
|
||||
.vscode
|
||||
|
|
14
src/Makefile
14
src/Makefile
|
@ -67,7 +67,11 @@ CFLAGS += $(OPT_FLAGS)
|
|||
LDFLAGS += $(OPT_FLAGS)
|
||||
|
||||
ifndef TARGET
|
||||
TARGET=blackmagic
|
||||
ifdef PC_HOSTED
|
||||
TARGET = blackmagic
|
||||
else
|
||||
TARGET = blackmagic.elf
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NO_OWN_LL
|
||||
|
@ -96,19 +100,21 @@ $(TARGET): include/version.h $(OBJ)
|
|||
@echo " AS $<"
|
||||
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.bin: %
|
||||
ifndef PC_HOSTED
|
||||
%.bin: %.elf
|
||||
@echo " OBJCOPY $@"
|
||||
$(Q)$(OBJCOPY) -O binary $^ $@
|
||||
|
||||
%.hex: %
|
||||
%.hex: %.elf
|
||||
@echo " OBJCOPY $@"
|
||||
$(Q)$(OBJCOPY) -O ihex $^ $@
|
||||
endif
|
||||
|
||||
.PHONY: clean host_clean all_platforms FORCE
|
||||
|
||||
clean: host_clean
|
||||
$(Q)echo " CLEAN"
|
||||
-$(Q)$(RM) *.o *.d *~ blackmagic $(HOSTFILES)
|
||||
-$(Q)$(RM) *.o *.d *.elf *~ $(TARGET) $(HOSTFILES)
|
||||
-$(Q)$(RM) platforms/*/*.o platforms/*/*.d mapfile include/version.h
|
||||
|
||||
all_platforms:
|
||||
|
|
|
@ -30,7 +30,7 @@ SRC += cdcacm.c \
|
|||
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o
|
||||
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
|
|
|
@ -37,18 +37,18 @@ SRC += cdcacm.c \
|
|||
stlink_common.c \
|
||||
|
||||
ifeq ($(ST_BOOTLOADER), 1)
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
all: blackmagic.bin
|
||||
else
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade.bin dfu_upgrade.hex
|
||||
endif
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o stlink_common.o
|
||||
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o stlink_common.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
dfu_upgrade: dfu_upgrade.o dfucore.o dfu_f1.o stlink_common.o
|
||||
dfu_upgrade.elf: dfu_upgrade.o dfucore.o dfu_f1.o stlink_common.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
host_clean:
|
||||
-$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade dfu_upgrade.bin dfu_upgrade.hex
|
||||
-$(Q)$(RM) *.bin *elf *hex
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ SRC += cdcacm.c \
|
|||
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade.bin dfu_upgrade.hex
|
||||
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o platform_common.o
|
||||
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o platform_common.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
dfu_upgrade: dfu_upgrade.o dfucore.o dfu_f1.o platform_common.o
|
||||
dfu_upgrade.elf: dfu_upgrade.o dfucore.o dfu_f1.o platform_common.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
|
|
Loading…
Reference in New Issue