-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
45 lines (32 loc) · 995 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
38
39
40
41
42
43
CPPFLAGS=
CFLAGS=-Wall -Wpedantic -Wno-parentheses -Wno-missing-braces
CLIENT_SRCS=client
CLIENT_SRCS:=$(addprefix client/, $(CLIENT_SRCS:%=%.c))
CLIENT_OBJ:=$(CLIENT_SRCS:%.c=%.o)
SRCS=dsp error db crypto net
SRCS:=$(SRCS:%=%.c)
OBJ:=$(SRCS:%.c=%.o)
debug: CFLAGS+=-g
debug: dsp
nodebug: CPPFLAGS+=-DNDEBUG
nodebug: CFLAGS+=-O2
nodebug: dsp
$(CLIENT_OBJ): libdsp.h client/client.h $(CLIENT_SRCS)
cd client && \
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(notdir $(CLIENT_SRCS))
dsp: libdsp.so $(CLIENT_OBJ)
$(CC) -L. -o dsp $(CLIENT_OBJ) -ldsp
$(OBJ): dsp.h $(SRCS)
$(CC) -fpic -pthread -c $(CFLAGS) $(CPPFLAGS) $(SRCS)
libdsp.so: libdsp.h $(OBJ)
$(CC) -shared -pthread -o libdsp.so $(OBJ) -lm -lsqlite3 -l:libnacl.a -l:randombytes.o
clean:
rm -f dsp libdsp.so $(CLIENT_OBJ) $(OBJ)
run: export LD_LIBRARY_PATH=.
run: dsp
./dsp
prefix=/usr/local
install: dsp libdsp.so libdsp.h
install -m644 libdsp.h $(prefix)/include/dsp.h
install libdsp.so $(prefix)/lib
install dsp $(prefix)/bin