-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile.BSD
64 lines (58 loc) · 2.05 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
PKG= spiped
PROGS= spipe \
spiped
LIBS= liball \
liball/optional_mutex_normal \
liball/optional_mutex_pthread
TESTS= perftests/recv-zeros \
perftests/send-zeros \
perftests/standalone-enc \
tests/dnsthread-resolve \
tests/msleep \
tests/nc-client \
tests/nc-server \
tests/pthread_create_blocking_np \
tests/pushbits \
tests/valgrind
SUBST_VERSION_FILES= spipe/spipe.1 spiped/spiped.1 spipe/main.c spiped/main.c
PUBLISH= ${PROGS} BUILDING DESIGN.md CHANGELOG COPYRIGHT README.md STYLE Makefile lib liball libcperciva perftests proto 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>