-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
37 lines (25 loc) · 831 Bytes
/
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
#DEBUG=1
VBYTE_CFLAGS=-mavx # undefine this to compile on non-intel platforms.
# -------------------------------------------------------
.SUFFIXES: .cpp .o .c .h
OBJECTS = vbyte.o varintdecode.o
ifeq ($(DEBUG),1)
CFLAGS = -g -pedantic -DDEBUG=1 -D_GLIBCXX_DEBUG -Wall -Wextra
else
CFLAGS = -g -pedantic -Wall -Wextra -O3
endif #debug
HEADERS= $(shell ls *h)
all: test libvbyte.a
echo "please run unit tests by running ./test"
vbyte.o: vbyte.h vbyte.cc
$(CXX) $(CFLAGS) $(VBYTE_CFLAGS) -c vbyte.cc
varintdecode.o: vbyte.h varintdecode.c
$(CXX) $(CFLAGS) -mavx -c varintdecode.c
vbyte: $(HEADERS) $(OBJECTS)
ar rvs libvbyte.a $(OBJECTS)
test: vbyte $(HEADERS) test.cc
$(CXX) $(CFLAGS) -std=c++11 -o test test.cc libvbyte.a \
-lboost_chrono -lboost_system
clean:
rm -f *.o test
.PHONY: all clean test