coolnn 发表于 2013-07-07 00:37

makefile

求个makefile模板。求求求……

weishuo1999 发表于 2013-07-16 17:13

INCLUDE =-I./ \
         -I../\
         -I../mysql\
         $(shell mysql_config --include) \
         -I/apps/lib/libevent-2.0.15-stable/include/ \
   
LIB = -L./ \
      -L/apps/lib/libevent-2.0.15-stable/lib \
      -levent\
      $(shell mysql_config --libs)


VPATH = ../thrift \
      ../thrift/async \
      ../thrift/concurrency \
      ../thrift/processor \
      ../thrift/protocol \
      ../thrift/qt \
      ../thrift/server \
      ../thrift/transport \
      ../mysql\



OUTPUT= id_maker

OBJS    = IdMaker_server.skeleton.o \
                IdMaker.o \
                idmaker_constants.o\
                idmaker_types.o\
                TServerSocket.o\
                TThreadPoolServer.o\
                Thrift.o\
                TBufferTransports.o\
                TApplicationException.o\
                TSocket.o\
                Mutex.o\
                Util.o\
                TimerManager.o\
                Monitor.o\
                PosixThreadFactory.o\
                ThreadManager.o\
                db_operator_mysql.o\
                mysqlresultset.o \
                mysqlstorage.o \




all:$(OUTPUT)

.SUFFIXES: .o .cpp
.cpp.o:
      $(CXX) $(CFLAGS) $(INCLUDE) -c $^

.o:
      $(CXX) $(CFLAGS) $(INCLUDE) -o $@ $^

$(OUTPUT): $(OBJS)
      $(CXX) $(CFLAGS) -o $@ $^ ${LIB}

clean:
      rm -f *.o *.~ *.bak
      rm -f $(OUTPUT)

dep:
      mkdep $(INCLUDE) $(SOURCES) > .depend

ifneq ($(wildcard .depend),)
include .depend
endif
页: [1]
查看完整版本: makefile