写过的一个项目的makefile,demo2

#author: wanguofeng
#date:   2014-02-27

vpath %.cpp sites
#vpath %.h inc sites

SRC1 = $(wildcard *.cpp ) \
      $(wildcard sites/*.cpp)

SRC=$(notdir $(SRC1))

OBJ=$(patsubst %.cpp,%.o,$(SRC))

CXXFLAGS += -I inc -I sites

LDFLAGS += -lcurl\
      -ljson\
          -lpcre

ALL: TuziParser

TuziParser:$(OBJ)
   $(CXX) $(OBJ) -o $@ $(LDFLAGS)

.PHONY:clean

clean:
   rm -f $(OBJ) TuziParser

你可能感兴趣的:(makefile,demo2)