-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
92 lines (63 loc) · 2.89 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# minimalist makefile
.SUFFIXES:
#
.SUFFIXES: .cpp .o .c .h
PROCESSOR:=$(shell uname -m)
ifeq ($(PROCESSOR), aarch64)
# for 64-bit ARM processors (e.g., Linux), they may fail to defined __ARM_NEON__
CFLAGS = -fPIC -std=c99 -O3 -Wall -Wextra -pedantic -Wshadow -D__ARM_NEON__
else
CFLAGS = -fPIC -std=c99 -O3 -Wall -Wextra -pedantic -Wshadow
endif
LDFLAGS = -shared
LIBNAME=libstreamvbyte.so.0.0.1
LNLIBNAME=libstreamvbyte.so
all: unit $(LIBNAME)
test:
./unit
dyntest: dynunit $(LNLIBNAME)
LD_LIBRARY_PATH=. ./dynunit
install: $(OBJECTS) $(LIBNAME)
cp $(LIBNAME) /usr/local/lib
ln -f -s /usr/local/lib/$(LIBNAME) /usr/local/lib/libstreamvbyte.so
ldconfig
cp $(HEADERS) /usr/local/include
HEADERS=./include/streamvbyte.h ./include/streamvbytedelta.h ./include/streamvbyte_zigzag.h
uninstall:
for h in $(HEADERS) ; do rm /usr/local/$$h; done
rm /usr/local/lib/$(LIBNAME)
rm /usr/local/lib/libstreamvbyte.so
ldconfig
OBJECTS= streamvbyte_decode.o streamvbyte_encode.o streamvbytedelta_decode.o streamvbytedelta_encode.o streamvbyte_0124_encode.o streamvbyte_0124_decode.o streamvbyte_zigzag.o
streamvbyte_zigzag.o: ./src/streamvbyte_zigzag.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbyte_zigzag.c -Iinclude
streamvbytedelta_encode.o: ./src/streamvbytedelta_encode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbytedelta_encode.c -Iinclude
streamvbytedelta_decode.o: ./src/streamvbytedelta_decode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbytedelta_decode.c -Iinclude
streamvbyte_0124_encode.o: ./src/streamvbyte_0124_encode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbyte_0124_encode.c -Iinclude
streamvbyte_0124_decode.o: ./src/streamvbyte_0124_decode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbyte_0124_decode.c -Iinclude
streamvbyte_decode.o: ./src/streamvbyte_decode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbyte_decode.c -Iinclude
streamvbyte_encode.o: ./src/streamvbyte_encode.c $(HEADERS)
$(CC) $(CFLAGS) -c ./src/streamvbyte_encode.c -Iinclude
$(LIBNAME): $(OBJECTS)
$(CC) $(CFLAGS) -o $(LIBNAME) $(OBJECTS) $(LDFLAGS)
$(LNLIBNAME): $(LIBNAME)
ln -f -s $(LIBNAME) $(LNLIBNAME)
shuffle_tables: ./utils/shuffle_tables.c
$(CC) $(CFLAGS) -o shuffle_tables ./utils/shuffle_tables.c
example: ./examples/example.c $(HEADERS) $(OBJECTS)
$(CC) $(CFLAGS) -o example ./examples/example.c -Iinclude $(OBJECTS)
perf: ./tests/perf.c $(HEADERS) $(OBJECTS)
$(CC) $(CFLAGS) -o perf ./tests/perf.c -Iinclude $(OBJECTS) -lm
writeseq: ./tests/writeseq.c $(HEADERS) $(OBJECTS)
$(CC) $(CFLAGS) -o writeseq ./tests/writeseq.c -Iinclude $(OBJECTS)
unit: ./tests/unit.c $(HEADERS) $(OBJECTS)
$(CC) $(CFLAGS) -o unit ./tests/unit.c -Iinclude -Isrc $(OBJECTS)
dynunit: ./tests/unit.c $(HEADERS) $(LIBNAME) $(LNLIBNAME)
$(CC) $(CFLAGS) -o dynunit ./tests/unit.c -Iinclude -Isrc -L. -lstreamvbyte
clean:
rm -f unit *.o $(LIBNAME) $(LNLIBNAME) example shuffle_tables perf writeseq dynunit