-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.BSD
88 lines (82 loc) · 2.57 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
PKG= libcperciva
PROGS=
LIBS= liball \
liball/optional_mutex_normal \
liball/optional_mutex_pthread
TESTS= perftests/http \
perftests/https \
perftests/network-ssl \
tests/aws \
tests/buildall \
tests/buildnothing \
tests/buildsingles \
tests/crc32 \
tests/crypto_aes \
tests/crypto_aesctr \
tests/crypto_entropy \
tests/daemonize \
tests/elasticarray \
tests/events \
tests/fork_func \
tests/getopt \
tests/getopt-longjmp \
tests/heap \
tests/humansize \
tests/ipc_sync \
tests/json \
tests/md5 \
tests/monoclock \
tests/mpool \
tests/optional_mutex/normal \
tests/optional_mutex/pthread \
tests/parsenum \
tests/readpass_file \
tests/setuidgid \
tests/sha1 \
tests/sha256 \
tests/sock_util \
tests/sysendian \
tests/valgrind \
tests/warnp
PUBLISH= ${PROGS} COPYRIGHT STYLE POSIX Makefile aws alg apisupport \
cpusupport crypto datastruct events liball network tests util
### 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>