forked from gyepisam/spiped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (84 loc) · 2.13 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
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
# Program name.
PROG = spiped
# Library code required
LDADD = -lrt
LDADD += -lcrypto
# spiped code
SRCS = main.c
SRCS += conn.c
SRCS += pcrypt.c
SRCS += proto_handshake.c
SRCS += proto_pipe.c
# Data structures
.PATH.c : lib/datastruct
SRCS += elasticarray.c
SRCS += ptrheap.c
SRCS += timerqueue.c
IDIRS += -I lib/datastruct
# Utility functions
.PATH.c : lib/util
SRCS += asprintf.c
SRCS += daemonize.c
SRCS += entropy.c
SRCS += monoclock.c
SRCS += sock.c
SRCS += warnp.c
IDIRS += -I lib/util
# Event loop
.PATH.c : lib/events
SRCS += events_immediate.c
SRCS += events_network.c
SRCS += events_timer.c
SRCS += events.c
IDIRS += -I lib/events
# Event-driven networking
.PATH.c : lib/network
SRCS += network_accept.c
SRCS += network_buf.c
SRCS += network_connect.c
IDIRS += -I lib/network
# Crypto code
.PATH.c : lib/crypto
SRCS += crypto_aesctr.c
SRCS += crypto_dh.c
SRCS += crypto_dh_group14.c
SRCS += crypto_entropy.c
SRCS += crypto_verify_bytes.c
SRCS += sha256.c
IDIRS += -I lib/crypto
# Debugging options
CFLAGS += -g
#CFLAGS += -DNDEBUG
#CFLAGS += -DDEBUG
#CFLAGS += -pg
publish: clean
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 ${PROG}-${VERSION}.tgz
mkdir ${PROG}-${VERSION}
tar -cf- --exclude 'Makefile.*' --exclude Makefile \
--exclude ${PROG}-${VERSION} . | \
tar -xf- -C ${PROG}-${VERSION}
echo '.POSIX:' > ${PROG}-${VERSION}/Makefile
( echo -n 'PROG=' && make -V PROG ) >> ${PROG}-${VERSION}/Makefile
( echo -n 'SRCS=' && make -V SRCS ) >> ${PROG}-${VERSION}/Makefile
( echo -n 'IDIRS=' && make -V IDIRS ) >> ${PROG}-${VERSION}/Makefile
( echo -n 'LDADD=' && make -V LDADD ) >> ${PROG}-${VERSION}/Makefile
cat Makefile.prog >> ${PROG}-${VERSION}/Makefile
( make -V SRCS | \
tr ' ' '\n' | \
sed -E 's/.c$$/.o/' | \
while read F; do \
echo -n "$${F}: "; \
make source-$${F}; \
done ) >> ${PROG}-${VERSION}/Makefile
tar -cvzf ${PROG}-${VERSION}.tgz ${PROG}-${VERSION}
rm -r ${PROG}-${VERSION}
.include <Makefile.inc>
.include <bsd.prog.mk>