-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile.BSD
104 lines (98 loc) · 2.97 KB
/
Makefile.BSD
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
93
94
95
96
97
98
99
100
101
102
103
104
PKG= kivaloo
PROGS= dynamodb-kv \
kvlds \
kvlds-dump \
kvlds-undump \
lbs \
lbs-dynamodb \
lbs-dynamodb-init \
lbs-s3 \
mux \
perf \
s3
LIBS= liball \
liball/optional_mutex_normal \
liball/optional_mutex_pthread
BENCHES=bench/bulk_extract \
bench/bulk_insert \
bench/bulk_update \
bench/hotspot_read \
bench/mkpairs \
bench/random_mixed \
bench/random_read
# For compatibility with other libcperciva software, we don't use
# ${BENCHES} in the shared code, so we add it to ${TESTS}.
TESTS= perftests/dynamodb_kv \
perftests/dynamodb_queue \
perftests/dynamodb_request \
perftests/dynamodb_sign \
perftests/kvldsclean \
perftests/kvldsclean-ddbkv \
perftests/kvldsperf \
perftests/s3 \
perftests/s3_put \
perftests/serverpool \
tests/kvlds \
tests/kvlds-blocking \
tests/kvlds-ddbkv \
tests/kvlds-dump \
tests/kvlds-s3 \
tests/lbs \
tests/msleep \
tests/mux \
tests/onlinequantile \
tests/s3 \
tests/valgrind \
${BENCHES}
SUBST_VERSION_FILES= dynamodb-kv/main.c \
kvlds-dump/main.c \
kvlds-undump/main.c \
kvlds/main.c \
lbs-dynamodb-init/main.c \
lbs-dynamodb/main.c \
lbs-s3/main.c \
lbs/main.c \
mux/main.c \
perf/main.c \
s3/main.c
PUBLISH= ${PROGS} BUILDING CHANGELOG COPYRIGHT DESIGN INTERFACES STYLE Makefile lib liball libcperciva bench perftests tests
### Shared code between Tarsnap projects.
# These definitions improve the readability of the below material.
MAKEBSD:= ${MAKE} -f Makefile.BSD
RELEASEDATE!= date "+%B %d, %Y"
CFLAGS_HARDCODED= -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\\\"cpusupport-config.h\\\" -DAPISUPPORT_CONFIG_FILE=\\\"apisupport-config.h\\\"
# This creates (and deletes) a fake cpusupport-config.h that is
# blank (and thus does not require any special CFLAGS to compile).
.for D in ${LIBS} ${PROGS} ${TESTS}
${D}/Makefile::
CPP="${CPP}" ./release-tools/metabuild.sh \
"${D}" "${MAKEBSD}" "${CFLAGS_HARDCODED}"
.endfor
Makefiles:
.for D in ${LIBS} ${PROGS} ${TESTS}
${MAKEBSD} ${D}/Makefile
.endfor
# This uses temporary files for sed because the FreeBSD and GNU
# behaviour of sed -i is different.
publish: clean Makefiles
if [ -z "${VERSION}" ]; then \
echo "VERSION must be specified!"; \
exit 1; \
fi
if find . | grep \~; then \
echo "Delete temporary files before publishing!"; \
exit 1; \
fi
rm -f ${PKG}-${VERSION}.tgz
mkdir ${PKG}-${VERSION}
tar -cf- --exclude 'Makefile.*' ${PUBLISH} | \
tar -xf- -C ${PKG}-${VERSION}
.for F in ${SUBST_VERSION_FILES}
sed -e 's/@VERSION@/${VERSION}/' -e 's/@DATE@/${RELEASEDATE}/' \
< ${PKG}-${VERSION}/${F} > ${PKG}-${VERSION}/${F}.tmp
mv ${PKG}-${VERSION}/${F}.tmp ${PKG}-${VERSION}/${F}
.endfor
tar -cvzf ${PKG}-${VERSION}.tgz ${PKG}-${VERSION}
rm -r ${PKG}-${VERSION}
SUBDIR= ${PROGS}
.include <bsd.subdir.mk>