-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
executable file
·43 lines (34 loc) · 1.31 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
#-O3 produces not debug info! Should be used for performance measurments
#CXXFLAGS = -O3 -Wall -fmessage-length=0 -D_FILE_OFFSET_BITS=64 -std=c++1y
#-ggdb produces lots of debug info; useful ful backtraces and debugging
CXXFLAGS = -ggdb -g -Wall -fmessage-length=0 -D_FILE_OFFSET_BITS=64 -std=c++1y
CXXSOURCES = $(wildcard src/*.cpp)
OBJS = $(CXXSOURCES:%.cpp=%.o)
#defines
DEFINES=
#Includes
LFLAGS=-Ilib/logger
CXXFLAGS+= $(LFLAGS)
#Libraries
LD = -L/usr/local/lib
CXXFLAGS+=$(LD)
#if PROFILE is enabled them -lprofiler should be include and gperftools should be installed
#LIBS = -lpthread -lfuse -lSwift -lPocoNet -lPocoFoundation -lzookeeper_mt -lpfring -lnuma -lgfapi -ltcmalloc -lprofiler
#No profiler
LIBS = -lpthread -lfuse -lSwift -lPocoFoundation -lPocoNet -lzookeeper_mt -lpfring -lnuma -lgfapi -ltcmalloc
TARGET = BFS
#CXX=clang++
$(TARGET): $(OBJS)
$(CXX) $(DEFINES) $(CXXFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
#gksudo setcap cap_net_admin+eip $(TARGET)
$(OBJS):
$(CXX) -MMD $(CXXFLAGS) -c -o $@ $(@:.o=.cpp) $(LIBS)
@mv -f $(@:.o=.d) $(@:.o=.d.tmp)
@sed -e 's|.*:|$@:|' < $(@:.o=.d.tmp) > $(@:.o=.d)
@sed -e 's/.*://' -e 's/\\$$//' < $(@:.o=.d.tmp) | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(@:.o=.d)
@rm -f $(@:.o=.d.tmp)
all: $(TARGET)
-include $(OBJS:.o=.d)
clean:
rm -f $(OBJS) $(TARGET) $(OBJS:.o=.d)