-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
57 lines (45 loc) · 1.58 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
###############################################################################
#
# A smart Makefile template for GNU/LINUX programming
#
# Author: PRC ([email protected])
# Date: 2013/08/29
#
# Usage:
# $ make Compile and link (or archive)
# $ make clean Clean the objectives and target.
###############################################################################
CXXFLAGS := -DPIC -fpic -fPIC -Wno-deprecated -m64 -D_LINUX -I..
# -D_UNIX if you compile it on unix
EXTRA_CFLAGS := -Wall -Wno-format -Wdeprecated-declarations
ifeq ($(STD),1)
EXTRA_CFLAGS += -std=c++0x -D__CXX_11__
endif
LDFLAGS += -shared -pthread -Wl,-rpath,/usr/local/lib
#-lsocket if you compile on unix.
#-Wl,-rpath,/usr/local/lib if you have self-installed gcc compiler.
ifeq ($(DEBUG),1)
EXTRA_CFLAGS += -g
else
EXTRA_CFLAGS += -O2
endif
TESTCAPI_OBJS = ./test/testcapi.o
XDELTA_OBJS = capi.o \
xdeltalib.o \
tinythread.o \
rollsum.o \
md4.o \
platform.o \
rw.o \
CXX := g++
all: xdelta test
%.o:%.cpp
$(CXX) -I. $(CXXFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
xdelta: $(XDELTA_OBJS)
$(CXX) $(LDFLAGS) -o libxdelta.so $^
test:xdelta $(TESTCAPI_OBJS)
$(CXX) -Wl,-rpath,. -o testcapi $(TESTCAPI_OBJS) $(CXXFLAGS) $(EXTRA_CFLAGS) \
-Wno-deprecated -L. -lxdelta $(TEST_LD_FLAGS)
clean:
rm -f *.o libxdelta.so* server client testcapi similarity $(SERVER_OBJS) $(CLIENT_OBJS) \
$(TESTCAPI_OBJS) $(SIMILARITY_OBJS) $(DIFF_CALLBACK) diffcb