59 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Makefile
		
	
	
		
		
			
		
	
	
			59 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Makefile
		
	
	
| 
								 | 
							
								######################################
							 | 
						|||
| 
								 | 
							
								#
							 | 
						|||
| 
								 | 
							
								######################################
							 | 
						|||
| 
								 | 
							
								#source file
							 | 
						|||
| 
								 | 
							
								#Դ<>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.c<><63>.cpp<70>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>궨<EFBFBD><EAB6A8>Ϊͬ<CEAA><CDAC>.o<>ļ<EFBFBD>
							 | 
						|||
| 
								 | 
							
								SOURCE  := $(wildcard *.c) $(wildcard *.cpp)
							 | 
						|||
| 
								 | 
							
								OBJS    := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								#target you can change test to what you want
							 | 
						|||
| 
								 | 
							
								#Ŀ<><C4BF><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ִ<EFBFBD><D6B4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
							 | 
						|||
| 
								 | 
							
								TARGET  := datahubs
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								#compile and lib parameter
							 | 
						|||
| 
								 | 
							
								#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
							 | 
						|||
| 
								 | 
							
								CC      := g++
							 | 
						|||
| 
								 | 
							
								LIBS    := -L/usr/local/lib -lhv -lsqlite3 -lopdb -lpthread -liconv -ldl -lz
							 | 
						|||
| 
								 | 
							
								LDFLAGS :=
							 | 
						|||
| 
								 | 
							
								DEFINES :=
							 | 
						|||
| 
								 | 
							
								INCLUDE := -I. -I/usr/local/include
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								CFLAGS  := -Wall -O3 $(DEFINES) $(INCLUDE) -std=c++11
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								# <20><><EFBFBD><EFBFBD> DEBUG <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
							 | 
						|||
| 
								 | 
							
								ifeq ($(DEBUG), 1)
							 | 
						|||
| 
								 | 
							
								    CFLAGS += -g -D_DEBUG
							 | 
						|||
| 
								 | 
							
								else ifeq ($(debug),1)
							 | 
						|||
| 
								 | 
							
								    CFLAGS += -g -D_DEBUG
							 | 
						|||
| 
								 | 
							
								endif
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								#i think you should do anything here
							 | 
						|||
| 
								 | 
							
								#<23><><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>κθĶ<CEB8><C4B6><EFBFBD>
							 | 
						|||
| 
								 | 
							
								.PHONY : everything objs clean veryclean rebuild
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								everything : $(TARGET) 
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								all : $(TARGET)
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								objs : $(OBJS)
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								rebuild: veryclean everything
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								clean :
							 | 
						|||
| 
								 | 
							
									rm -fr *.so
							 | 
						|||
| 
								 | 
							
									rm -fr *.o
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								veryclean : clean
							 | 
						|||
| 
								 | 
							
									rm -fr $(TARGET)
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								$(TARGET) : $(OBJS)
							 | 
						|||
| 
								 | 
							
									$(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
							 |