diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |