mirror of
git://git.code.sf.net/p/openocd/code
synced 2025-07-19 08:38:14 +10:00
Avoid special rules to generate array at compile time by shipping the generated file. Convert to Makefile build like the other loaders. Change-Id: I5a05edddcfaff3d395086cd3aa33120f8a7aa9dc Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3864 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
34 lines
554 B
Makefile
34 lines
554 B
Makefile
BIN2C = ../../../../src/helper/bin2char.sh
|
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
|
|
|
CC=$(CROSS_COMPILE)gcc
|
|
OBJCOPY=$(CROSS_COMPILE)objcopy
|
|
OBJDUMP=$(CROSS_COMPILE)objdump
|
|
|
|
CFLAGS = -static -nostartfiles -mlittle-endian -Wa,-EL
|
|
LDFLAGS = -Tdebug_handler.ld
|
|
|
|
all: debug_handler.inc
|
|
|
|
.PHONY: clean
|
|
|
|
.INTERMEDIATE: debug_handler.elf
|
|
|
|
debug_handler.elf: protocol.h
|
|
|
|
%.elf: %.S
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
|
|
|
|
%.lst: %.elf
|
|
$(OBJDUMP) -S $< > $@
|
|
|
|
%.bin: %.elf
|
|
$(OBJCOPY) -Obinary $< $@
|
|
|
|
%.inc: %.bin
|
|
$(BIN2C) < $< > $@
|
|
|
|
clean:
|
|
-rm -f *.elf *.lst *.bin *.inc
|