1 INCLUDEPATH=-I/usr/include/c++/4.8.4 2 -I./ 3 -I/home/william/Project/boost_1_59_0 4 SOURCEDIR=./ 5 LIBRARYPATH:= 6 LIBRARY:= 7 SRCS=$(foreach dir,$(SOURCEDIR), $(wildcard $(dir)/*.cpp)) 8 TEMPOUTPUT:=$(foreach dir,$(SOURCEDIR), $(wildcard $(dir)/*.o)) 9 OBJECTS:=$(patsubst %.cpp,%.o,$(SRCS)) 10 TARGETS:=$(notdir $(PWD)) 11 12 .SUFFIXES:.o .cpp 13 %.o:%.cpp 14 $(CXX) $(INCLUDEPATH) -g -c -o [email protected] $< $(LIBRARYPATH) $(LIBRARY) 15 16 all:$(TARGETS) 17 18 $(TARGETS):$(OBJECTS) 19 $(CXX) $(INCLUDEPATH) -g -o [email protected] $^ $(LIBRARYPATH) $(LIBRARY) 20 21 run: 22 ./$(TARGETS) 23 24 clean: 25 rm -rf $(TARGETS) 26 rm -rf $(TEMPOUTPUT)
时间: 2024-10-25 15:38:39