Makefile.include: Generate dependency files before build (#225)

* Makefile.include: Generate .d files before build

* Makefile.include: Generate .small.d files before build
This commit is contained in:
Saleem Rashid 2017-10-10 19:54:21 +01:00 committed by Pavol Rusnak
parent 5831e53854
commit d006ef6bf7
2 changed files with 8 additions and 10 deletions

View File

@ -134,10 +134,16 @@ $(NAME).elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/libopencm3_stm32f2.a $(TOP
$(AS) $(CPUFLAGS) -o $@ $<
%.o: %.c Makefile
$(CC) $(CFLAGS) -MMD -o $@ -c $<
$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
%.small.o: %.c Makefile
$(CC) $(CFLAGS) -MMD -o $@ -c $<
$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
%.d: %.c Makefile
@$(CC) $(CFLAGS) -MM -MP -MG -o $@ $<
%.small.d: %.c Makefile
@$(CC) $(CFLAGS) -MM -MP -MG -o $@ $<
clean::
rm -f $(OBJS)

View File

@ -101,14 +101,6 @@ bootloader.o: ../fastflash/bootloader.bin
--rename-section .data=.rodata \
$< $@
# ensure header files are generated prior to compiling sources
coins.c crypto.c fsm.c transaction.c: coins_count.h
coins.c: coins_array.h
nem2.c layout2.c fsm.c: nem_mosaics.h
#################
# Code Generation
coins_count.h: coins-gen.py coins.json
./$< count > $@