From b3b454ee770d708cc0035c2768387cc21aedc1db Mon Sep 17 00:00:00 2001 From: Hans Insulander Date: Mon, 5 Nov 2012 22:48:09 +0100 Subject: [PATCH 1/2] Generate header dependencies and use them in Makefile --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 58a4d9d..f0e7f41 100755 --- a/Makefile +++ b/Makefile @@ -49,6 +49,7 @@ all: grbl.hex .c.o: $(COMPILE) -c $< -o $@ + @$(COMPILE) -MM $< > $*.d .S.o: $(COMPILE) -x assembler-with-cpp -c $< -o $@ @@ -74,7 +75,7 @@ load: all bootloadHID grbl.hex clean: - rm -f grbl.hex main.elf $(OBJECTS) + rm -f grbl.hex main.elf $(OBJECTS) $(OBJECTS:.o=.d) # file targets: main.elf: $(OBJECTS) @@ -93,3 +94,7 @@ disasm: main.elf cpp: $(COMPILE) -E main.c + +# include generated header dependencies +-include $(OBJECTS:.o=.d) + From 8a09e2c9c4245a6b6cf0531faed2f831dd070f58 Mon Sep 17 00:00:00 2001 From: Hans Insulander Date: Mon, 5 Nov 2012 22:55:49 +0100 Subject: [PATCH 2/2] Ignore dependency files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7ad1a0e..844cd7a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.o *.elf *.DS_Store +*.d