Add automatic dependencies

This commit is contained in:
Nero 2018-01-29 00:48:12 +00:00 committed by Nero
parent 294553ee84
commit 24ee77720d
3 changed files with 16 additions and 2 deletions

View file

@ -16,8 +16,10 @@ default: $(PROG).hex
clean:
rm -rf *.o drivers/*.o *.elf *.lst *.hex *.bin *.asm
# dependencies
blink.elf: drivers/led.o
# automatic dependencies
include deps.mk
deps.mk: *.c drivers/*.c
for i in *.c; do echo $${i%.c}.elf: $$(./finddeps.sh "$$i"); echo; done > deps.mk
# generic rules
%.o: %.c