summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 14:24:39 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 14:24:39 +0200
commite43c5e6f856ad583579384e1f9509f66e3e0537e (patch)
treead87e0aaf095c6b86525dcc5a57f129cd0531c49 /Makefile
parent41f947b80f1c03d5451988593d2d16ec69e9b653 (diff)
Add build deps to Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9b7e035..4b43083 100644
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,15 @@ SRC = \
OBJ = $(patsubst %.cc,%.o,$(SRC))
+DEPFILES := $(patsubst %.cc,%.d,$(SRC))
+$(DEPFILES):
+
+include $(wildcard $(DEPFILES))
+
CXXFLAGS = -g -O3 -std=c++17 -I.
%.o: %.cc
- g++ $(CXXFLAGS) -c $< -o $@
+ g++ -MMD $(CXXFLAGS) -c $< -o $@
libcppbuild.a: $(OBJ)
ar rcs $@ $(OBJ)
@@ -23,4 +28,4 @@ cppbuild: cppbuild.cc subdir/cppbuild.cc libcppbuild.a
g++ $(CXXFLAGS) -pthread cppbuild.cc subdir/cppbuild.cc libcppbuild.a -o $@
clean:
- rm -f libcppbuild.a $(OBJ) cppbuild
+ rm -f libcppbuild.a $(OBJ) cppbuild $(DEPFILES)