PROJECTNAME=ymake SRC=main.cpp ymake.cpp Builder.cpp ProcessRunner.cpp file.cpp OBJ=$(SRC:.cpp=.o) YSCAN=yscan YSCAN_SRC=yscan-main.cpp yscan.cpp file.cpp YSCAN_OBJ=$(YSCAN_SRC:.cpp=.o) TEST=test-ymake TEST_SRC=test-ymake.cpp TEST_OBJ=$(TEST_SRC:.cpp=.o) all: $(PROJECTNAME) $(YSCAN) LDLIBS += -lreichwein -lfmt CXXFLAGS += \ -std=c++17 \ -I/usr/src/googletest/googletest/include \ -I/usr/src/googletest/googlemock/include \ -I/usr/src/googletest/googletest \ -I/usr/src/googletest/googlemock $(PROJECTNAME): $(OBJ) $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@ $(YSCAN): $(YSCAN_OBJ) $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@ $(TEST): libgmock.a $(TEST_OBJ) $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@ %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ libgmock.a: $(CXX) $(CXXFLAGS) -c /usr/src/googletest/googletest/src/gtest-all.cc $(CXX) $(CXXFLAGS) -c /usr/src/googletest/googlemock/src/gmock-all.cc $(CXX) $(CXXFLAGS) -c /usr/src/googletest/googlemock/src/gmock_main.cc ar -rv libgmock.a gmock-all.o gtest-all.o gmock_main.o test: $(TEST) ./$(TEST) install: mkdir -p $(DESTDIR)/usr/bin cp $(PROJECTNAME) $(DESTDIR)/usr/bin/ cp $(YSCAN) $(DESTDIR)/usr/bin/ clean: -rm -f *.o $(PROJECTNAME) $(YSCAN) $(TEST) -dh_clean deb: dpkg-buildpackage -rfakeroot .PHONY: clean install all deb