Add a Makefile to build flash stubs.
This commit is contained in:
parent
7372fca2f6
commit
2223a1c925
|
@ -0,0 +1,33 @@
|
|||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
AS = $(CROSS_COMPILE)as
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
HEXDUMP = hexdump
|
||||
|
||||
ifneq ($(V), 1)
|
||||
Q = @
|
||||
endif
|
||||
|
||||
CFLAGS=-mcpu=cortex-m3 -mthumb -I../libopencm3/include
|
||||
ASFLAGS=-mcpu=cortex-m3 -mthumb
|
||||
|
||||
all: lmi.stub stm32.stub stm32f4.stub nrf51.stub
|
||||
|
||||
%.o: %.s
|
||||
$(Q)echo " AS $<"
|
||||
$(Q)$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
%.bin: %.o
|
||||
$(Q)echo " OBJCOPY $@"
|
||||
$(Q)$(OBJCOPY) -O binary $< $@
|
||||
|
||||
%.stub: %.bin
|
||||
$(Q)echo " HEXDUMP $@"
|
||||
$(Q)$(HEXDUMP) -v -e '/2 "0x%04X, "' $< > $@
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
$(Q)echo " CLEAN"
|
||||
-$(Q)rm -f *.o *.bin *.stub
|
||||
|
Loading…
Reference in New Issue