标签:makefile -o logs sub pat src ++ targe efi
1 INCLUDEPATH=-I/usr/include/c++/4.8.4 2 -I./ 3 SOURCEDIR=./ 4 LIBRARYPATH:= 5 LIBRARY:= 6 SRCS=$(foreach dir,$(SOURCEDIR), $(wildcard $(dir)/*.cpp)) 7 TEMPOUTPUT:=$(foreach dir,$(SOURCEDIR), $(wildcard $(dir)/*.o)) 8 OBJECTS:=$(patsubst %.cpp,%.o,$(SRCS)) 9 TARGETS:=$(notdir $(PWD)) 10 11 .SUFFIXES:.o .cpp 12 %.o:%.cpp 13 $(CXX) $(INCLUDEPATH) -g -c -o $@ $< $(LIBRARYPATH) $(LIBRARY) 14 15 all:$(TARGETS) 16 17 $(TARGETS):$(OBJECTS) 18 $(CXX) $(INCLUDEPATH) -g -o $@ $^ $(LIBRARYPATH) $(LIBRARY) 19 20 run: 21 ./$(TARGETS) 22 23 clean: 24 rm -rf $(TARGETS) 25 rm -rf $(TEMPOUTPUT)
标签:makefile -o logs sub pat src ++ targe efi
原文地址:http://www.cnblogs.com/ILoveOCT/p/6597228.html