summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2007-09-14 10:31:10 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-09-14 10:31:10 -0400
commitf6f922953798e6d2f5a864b48b4f37d998bb3a6d (patch)
tree46369dc8cc6fcd02cc2f76683bea29c61c3ad50c /Makefile
parentddcaa0171a677a76078c6e0ad54c2f8033110a6f (diff)
Add per-file dependency tracking
The dependency archive ".depend" is only created once. Changing a C file's dependencies does not remake .depend, so make will recompile either too few or too many things. Use of per-.c file dependencies that are created and update during compile solve this.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 4 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index cf1b6f9e..02c7961f 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
#
CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
-Wuninitialized -Wshadow -Wundef
+DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
INSTALL= install
prefix ?= /usr/local
@@ -22,16 +23,11 @@ endif
.c.o:
$(check) $<
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(DEPFLAGS) $(CFLAGS) -c $<
all: $(progs)
-$(progs): depend
-
-depend:
- @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
-
btrfsctl: btrfsctl.o
gcc $(CFLAGS) -o btrfsctl btrfsctl.o
@@ -51,12 +47,10 @@ quick-test: $(objects) quick-test.o
gcc $(CFLAGS) -o quick-test $(objects) quick-test.o
clean :
- rm -f $(progs) cscope.out *.o .depend
+ rm -f $(progs) cscope.out *.o .*.d
install: $(progs)
$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
$(INSTALL) $(progs) $(DESTDIR)$(bindir)
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+-include .*.d