该模版只要把g++改成gcc,cpp改成c就可以支持gcc模版,非常好用。
INC_DIR = ./inc
DEBUG = -g #-pg
INCLUDE = -I$(INC_DIR)
CFLAGS = -pipe -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
CFLAGS += -O6
CFLAGS += $(shell if [ -d /usr/include/mysql ]; then echo "-I/usr/include/mysql"; fi)
CFLAGS += $(shell if [ -d /usr/local/include/mysql ]; then echo "-I/usr/local/include/mysql"; fi)
LIBS = -L/usr/lib64/mysql -lmysqlclient -lpthread -ldl -L/usr/local/lib -levent
HEADS = $(wildcard $(INC_DIR)/*.h)
SOURCES = $(wildcard ./src/*.cpp)
OBJS = $(SOURCES:.cpp=.o)
TARGET = pic_server
CC=gcc
all: ${TARGET}
${TARGET}: $(OBJS)
g++ -o $@ -rdynamic $(OBJS) $(LIBS)
clean:
rm -f ./src/*.o ${TARGET}
阅读(1833) | 评论(0) | 转发(0) |