Skip to content

Commit

Permalink
build: Header file dependency tracking
Browse files Browse the repository at this point in the history
This patch changes the build system to track header files required to build an
object file. Now you don't need to do make clean if you change a header file!

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Pekka Enberg committed Feb 9, 2009
1 parent b74ceff commit 67a3c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.*
*.o
*.class
*.d

#
# Generated symbolic links
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ monoburg:
%.o: %.c
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $< -o $@
$(Q) $(CC) -MM $(CFLAGS) -MT $@ $*.c -o $*.d

%.o: %.S
$(E) " AS " $@
Expand Down Expand Up @@ -213,6 +214,7 @@ clean:
$(Q) - rm -f $(PROGRAM)
$(Q) - rm -f $(CLASSPATH_CONFIG)
$(Q) - rm -f $(OBJS)
$(Q) - rm -f $(OBJS:.o=.d)
$(Q) - rm -f $(LIBHARNESS_OBJS)
$(Q) - rm -f $(ARCH_TEST_OBJS)
$(Q) - rm -f arch/$(ARCH)/insn-selector.c
Expand All @@ -236,3 +238,5 @@ PHONY += FORCE
FORCE:

include scripts/build/common.mk

-include $(OBJS:.o=.d)

0 comments on commit 67a3c38

Please sign in to comment.