summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-10-11 17:50:54 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-10-11 17:50:54 -0800
commit4e158e155327d09868453ae9759a58284245175a (patch)
tree1c4b33602957da52a4e8df028c697b4cb2551b39
parent8957361d8ff14c5efd585e2ac02c2e348a6bae31 (diff)
add dependency generation to make file
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
2 files changed, 5 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index c24cd99..e9dd6ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ bcache
probe-bcache
.*
*.o
+*.d
*.a
tags
cscope*
diff --git a/Makefile b/Makefile
index b27c412..5c5ea5f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
PREFIX=/usr
INSTALL=install
-CFLAGS+=-std=gnu99 -O2 -Wall -g -D_FILE_OFFSET_BITS=64 -I.
+CFLAGS+=-std=gnu99 -O2 -Wall -g -MMD -D_FILE_OFFSET_BITS=64 -I.
LDFLAGS+=-static
PKGCONFIG_LIBS="blkid uuid"
@@ -26,6 +26,8 @@ libccan.a: $(CCANOBJS)
bcache-objs = bcache.o bcache-assemble.o bcache-device.o bcache-format.o\
bcache-fs.o bcache-run.o bcache-key.o libbcache.o crypto.o util.o
+-include $(bcache-objs:.o=.d)
+
bcache: $(bcache-objs) libccan.a
.PHONY: install
@@ -38,7 +40,7 @@ install: bcache
.PHONY: clean
clean:
- $(RM) bcache *.o *.a
+ $(RM) bcache *.o *.d *.a
.PHONY: deb
deb: all