51 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Makefile
		
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Makefile
		
	
	
######################################
 | 
						||
#
 | 
						||
######################################
 | 
						||
#source file
 | 
						||
#源文件,自动找所有.c和.cpp文件,并将目标定义为同名.o文件
 | 
						||
SOURCE  := $(wildcard *.c) $(wildcard *.cpp)
 | 
						||
OBJS    := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))
 | 
						||
 | 
						||
#target you can change test to what you want
 | 
						||
#目标文件名,输入任意你想要的执行文件名
 | 
						||
TARGET  := commonAction
 | 
						||
 | 
						||
#compile and lib parameter
 | 
						||
#编译参数
 | 
						||
CC      := g++
 | 
						||
CXX     := g++
 | 
						||
LIBS    := -L/usr/local/lib -lhv -lsqlite3 -lpthread -ldl -static -lcgicc
 | 
						||
LDFLAGS :=
 | 
						||
DEFINES :=
 | 
						||
INCLUDE := -I. -I/usr/local/include
 | 
						||
CFLAGS  := -g -Wall -O3 $(DEFINES) $(INCLUDE) -std=c++11
 | 
						||
CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H
 | 
						||
 | 
						||
#i think you should do anything here
 | 
						||
#下面的基本上不需要做任何改动了
 | 
						||
.PHONY : everything objs clean veryclean rebuild
 | 
						||
 | 
						||
 | 
						||
everything : $(TARGET) 
 | 
						||
 | 
						||
all : $(TARGET)
 | 
						||
 | 
						||
 | 
						||
objs : $(OBJS)
 | 
						||
 | 
						||
 | 
						||
rebuild: veryclean everything
 | 
						||
 | 
						||
 | 
						||
clean :
 | 
						||
	rm -fr *.so *.a
 | 
						||
	rm -fr *.o
 | 
						||
 | 
						||
 | 
						||
veryclean : clean
 | 
						||
	rm -fr $(TARGET)
 | 
						||
 | 
						||
 | 
						||
$(TARGET) : $(OBJS)
 | 
						||
	$(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
 |