forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·60 lines (44 loc) · 1.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
CXX = g++
CXXFLAGS = -Wall -W -DDEBUG -g -O0 -D__XDEBUG__ -fPIC -Wno-unused-function
OBJECT = tick
SRC_DIR = ./src
THIRD_PATH = ./third/
OUTPUT = ./output
INCLUDE_PATH = -I./include/ \
-I./src/ \
-I$(THIRD_PATH)/glog-0.3.3/src/ \
-I$(THIRD_PATH)/leveldb/include/
LIB_PATH = -L./ \
-L$(THIRD_PATH)/glog-0.3.3/ \
-L/usr/local/lib/ \
-L$(THIRD_PATH)/leveldb/
LIBS = -lpthread \
-lprotobuf \
-lleveldb
DYNAMIC_LIBS = -lglog
.PHONY: all clean
BASE_OBJS := $(wildcard $(SRC_DIR)/*.cc)
BASE_OBJS += $(wildcard $(SRC_DIR)/*.c)
BASE_OBJS += $(wildcard $(SRC_DIR)/*.cpp)
OBJS = $(patsubst %.cc,%.o,$(BASE_OBJS))
all: $(OBJECT)
rm -rf $(OUTPUT)
mkdir $(OUTPUT)
mkdir $(OUTPUT)/bin
mkdir $(OUTPUT)/log
mkdir $(OUTPUT)/third
cp -r ./conf $(OUTPUT)/
cp $(OBJECT) $(OUTPUT)/bin/
cp -r ./third/ $(OUTPUT)/
rm -rf $(OBJECT)
@echo "Success, go, go, go..."
$(OBJECT): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(INCLUDE_PATH) $(LIB_PATH) -Wl,-Bdynamic $(LIBS) $(DYNAMIC_LIBS)
$(OBJS): %.o : %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@ $(INCLUDE_PATH)
$(TOBJS): %.o : %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@ $(INCLUDE_PATH)
clean:
rm -rf $(SRC_DIR)/*.o
rm -rf $(OUTPUT)/*
rm -rf $(OUTPUT)