all: libcppbuild.a cppbuild SRC = \ libcppbuild.cc \ task_cc.cc \ task_ld.cc \ task_ar.cc \ task_so.cc \ task.cc \ execute.cc \ OBJ = $(patsubst %.cc,%.o,$(SRC)) DEPFILES := $(patsubst %.cc,%.d,$(SRC)) $(DEPFILES): include $(wildcard $(DEPFILES)) CXXFLAGS = -g -O3 -std=c++17 -I. %.o: %.cc g++ -MMD $(CXXFLAGS) -c $< -o $@ libcppbuild.a: $(OBJ) ar rcs $@ $(OBJ) 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 $(DEPFILES)