flashstub: factor Makefile rules

Use target-specific variables
This commit is contained in:
Laurent Bonnans 2015-12-01 11:45:37 +01:00
parent 1f62fa4909
commit ff748e8fa1
1 changed files with 3 additions and 8 deletions

View File

@ -13,15 +13,10 @@ ASFLAGS=-mcpu=cortex-m3 -mthumb
all: lmi.stub stm32f4.stub stm32l4.stub nrf51.stub stm32f1.stub all: lmi.stub stm32f4.stub stm32l4.stub nrf51.stub stm32f1.stub
stm32f1.o: stm32f1.c stm32f1.o: CFLAGS += -DSTM32F1
$(Q)echo " CC $<" stm32f4.o: CFLAGS += -DSTM32F4
$(Q)$(CC) $(CFLAGS) -DSTM32F1 -o $@ -c $<
stm32f4.o: stm32f4.c %.o: %.c
$(Q)echo " CC $<"
$(Q)$(CC) $(CFLAGS) -DSTM32F4 -o $@ -c $<
stm32l4.o: stm32l4.c
$(Q)echo " CC $<" $(Q)echo " CC $<"
$(Q)$(CC) $(CFLAGS) -o $@ -c $< $(Q)$(CC) $(CFLAGS) -o $@ -c $<