-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
64 lines (49 loc) · 1.12 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
include config.mk
PWD=$(shell pwd)
PREFIX?=/usr
BINDIR=${DESTDIR}${PREFIX}/bin
OBJ=spp.o bin/main.o
# r_api.o
ODF=$(subst .o,.d,$(OBJ))
BIN=spp
ifeq ($(SPP_USE_R2),1)
CFLAGS+=$(shell pkg-config --cflags r_util)
LDFLAGS+=$(shell pkg-config --libs r_util)
endif
CFLAGS?=-Wall -O2
CFLAGS+=-fvisibility=hidden
CFLAGS+=-DUSE_R2=$(SPP_USE_R2)
CFLAGS+=-DHAVE_FORK=$(SPP_HAVE_FORK)
CFLAGS+=-DVERSION=$(VERSION)
all: ${BIN}
config.h:
cp config.def.h config.h
${BIN}: config.h ${OBJ}
${CC} ${LDFLAGS} -o ${BIN} ${OBJ}
r2lib: config.h
${CC} -DUSE_R2=1 -c ${CFLAGS} ${LDFLAGS} -o spp.o spp.c
symlinks:
ln -s ${BIN} acr
ln -s ${BIN} cpp
ln -s ${BIN} pod
ln -s ${BIN} sh
test:
@for a in t/*spp* ; do \
printf "Testing $$a... " ; \
./spp -tspp -o out.txt $$a ; \
if [ -z "`cat out.txt | grep BUG`" ]; then echo ok ; else echo oops ; fi ; \
cat out.txt | grep BUG ; \
rm -f out.txt ; \
true ; \
done
install:
mkdir -p ${BINDIR}
${INSTALL_PROGRAM} ${BIN} ${BINDIR}
symstall:
mkdir -p ${BINDIR}
ln -fs $(PWD)/${BIN} ${BINDIR}/$(BIN)
uninstall:
rm -f ${BINDIR}/${BIN}
clean:
-rm -f ${BIN} ${OBJ} ${ODF}
-include ${ODF}