2015-03-08 18:50:37 +00:00
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
|
|
|
AS = $(CROSS_COMPILE)as
|
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
|
|
HEXDUMP = hexdump
|
|
|
|
|
|
|
|
ifneq ($(V), 1)
|
|
|
|
Q = @
|
|
|
|
endif
|
|
|
|
|
2015-06-22 08:03:03 +00:00
|
|
|
CFLAGS=-Os -std=gnu99 -mcpu=cortex-m0 -mthumb -I../libopencm3/include
|
2015-03-08 18:50:37 +00:00
|
|
|
ASFLAGS=-mcpu=cortex-m3 -mthumb
|
|
|
|
|
2015-08-21 14:57:10 +00:00
|
|
|
all: lmi.stub stm32f4.stub stm32l4.stub nrf51.stub stm32f1.stub
|
2015-03-08 20:35:07 +00:00
|
|
|
|
2015-12-01 10:45:37 +00:00
|
|
|
stm32f1.o: CFLAGS += -DSTM32F1
|
|
|
|
stm32f4.o: CFLAGS += -DSTM32F4
|
2015-03-09 05:43:12 +00:00
|
|
|
|
2015-12-01 10:45:37 +00:00
|
|
|
%.o: %.c
|
2015-08-21 14:57:10 +00:00
|
|
|
$(Q)echo " CC $<"
|
|
|
|
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
2015-03-08 18:50:37 +00:00
|
|
|
%.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
|
|
|
|
|