From 1eac78b1c8bd8096c7a8c4c175119f47924cbb6e Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Fri, 6 Mar 2015 14:36:24 -0800 Subject: [PATCH] Move targets to make bin and hex files to toplevel makefile. --- src/Makefile | 6 ++++++ src/platforms/f4discovery/Makefile.inc | 3 --- src/platforms/launchpad-icdi/Makefile.inc | 2 -- src/platforms/native/Makefile.inc | 8 -------- src/platforms/stlink/Makefile.inc | 15 --------------- src/platforms/swlink/Makefile.inc | 9 --------- 6 files changed, 6 insertions(+), 37 deletions(-) diff --git a/src/Makefile b/src/Makefile index 3a29b7b..5295576 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,6 +47,12 @@ OBJ = $(SRC:.c=.o) blackmagic: $(OBJ) $(CC) -o $@ $^ $(LDFLAGS) +%.bin: % + $(OBJCOPY) -O binary $^ $@ + +%.hex: % + $(OBJCOPY) -O ihex $^ $@ + .PHONY: clean host_clean all_platforms clean: host_clean diff --git a/src/platforms/f4discovery/Makefile.inc b/src/platforms/f4discovery/Makefile.inc index d8f7754..01b3f61 100644 --- a/src/platforms/f4discovery/Makefile.inc +++ b/src/platforms/f4discovery/Makefile.inc @@ -24,8 +24,5 @@ SRC += cdcacm.c \ all: blackmagic.bin -blackmagic.bin: blackmagic - $(OBJCOPY) -O binary $^ $@ - host_clean: -rm blackmagic.bin diff --git a/src/platforms/launchpad-icdi/Makefile.inc b/src/platforms/launchpad-icdi/Makefile.inc index 8a0f9a3..e46b727 100644 --- a/src/platforms/launchpad-icdi/Makefile.inc +++ b/src/platforms/launchpad-icdi/Makefile.inc @@ -19,5 +19,3 @@ SRC += cdcacm.c \ all: blackmagic.bin -blackmagic.bin: blackmagic - $(OBJCOPY) -O binary $^ $@ diff --git a/src/platforms/native/Makefile.inc b/src/platforms/native/Makefile.inc index 8b76a53..b5c5c33 100644 --- a/src/platforms/native/Makefile.inc +++ b/src/platforms/native/Makefile.inc @@ -23,17 +23,9 @@ SRC += cdcacm.c \ all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex -blackmagic.bin: blackmagic - $(OBJCOPY) -O binary $^ $@ - blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o $(CC) $^ -o $@ $(LDFLAGS_BOOT) -blackmagic_dfu.bin: blackmagic_dfu - $(OBJCOPY) -O binary $^ $@ - -blackmagic_dfu.hex: blackmagic_dfu - $(OBJCOPY) -O ihex $^ $@ host_clean: -rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex diff --git a/src/platforms/stlink/Makefile.inc b/src/platforms/stlink/Makefile.inc index f2ebce5..5b2e61f 100644 --- a/src/platforms/stlink/Makefile.inc +++ b/src/platforms/stlink/Makefile.inc @@ -22,27 +22,12 @@ SRC += cdcacm.c \ all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade.bin dfu_upgrade.hex -blackmagic.bin: blackmagic - $(OBJCOPY) -O binary $^ $@ - blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o $(CC) $^ -o $@ $(LDFLAGS_BOOT) -blackmagic_dfu.bin: blackmagic_dfu - $(OBJCOPY) -O binary $^ $@ - -blackmagic_dfu.hex: blackmagic_dfu - $(OBJCOPY) -O ihex $^ $@ - dfu_upgrade: dfu_upgrade.o dfucore.o dfu_f1.o $(CC) $^ -o $@ $(LDFLAGS) -dfu_upgrade.bin: dfu_upgrade - $(OBJCOPY) -O binary $^ $@ - -dfu_upgrade.hex: dfu_upgrade - $(OBJCOPY) -O ihex $^ $@ - host_clean: -rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade dfu_upgrade.bin dfu_upgrade.hex diff --git a/src/platforms/swlink/Makefile.inc b/src/platforms/swlink/Makefile.inc index f891cb0..c415ecd 100644 --- a/src/platforms/swlink/Makefile.inc +++ b/src/platforms/swlink/Makefile.inc @@ -22,18 +22,9 @@ SRC += cdcacm.c \ all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex -blackmagic.bin: blackmagic - $(OBJCOPY) -O binary $^ $@ - blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o $(CC) $^ -o $@ $(LDFLAGS_BOOT) -blackmagic_dfu.bin: blackmagic_dfu - $(OBJCOPY) -O binary $^ $@ - -blackmagic_dfu.hex: blackmagic_dfu - $(OBJCOPY) -O ihex $^ $@ - host_clean: -rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex