forked from scslab/tcpcrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
183 lines (141 loc) · 4.46 KB
/
Makefile.am
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = src/tcpcryptd util/tcnetstat
if !OS_MINGW
bin_PROGRAMS += util/tcs
endif
dist_man8_MANS = src/tcpcryptd.man util/tcnetstat.man
lib_LTLIBRARIES = lib/libtcpcrypt.la
TESTSUITE = tests/testsuite
TESTSUITEFLAGS = --directory tests
EXTRA_DIST = \
launch_tcpcryptd.sh \
src/tcpcrypt_version.h \
src/tcpcryptd.man.md util/tcnetstat.man.md \
tests/package.m4 tests/atlocal.in \
tests/testsuite.at tests/version.at tests/hmac.at \
$(TESTSUITE)
if MAINTAINER_MODE
SUFFIXES = .man.md .man
.man.md.man:
pandoc -s -w man $^ -o $@
endif
TCPCRYPT_SRC = $(srcdir)/src
TCPCRYPT_INCLUDE = $(srcdir)/include
AM_CFLAGS = -I$(TCPCRYPT_SRC) -I$(TCPCRYPT_INCLUDE)
# include generated headers like tcpcrypt_version.h
AM_CFLAGS += -I$(builddir)/src
PRIV_SOURCES = src/priv.h
PRIV_LDADD =
if OS_MINGW
PRIV_SOURCES += win/priv.c
else
PRIV_SOURCES += unix/priv.c
if OS_LINUX
PRIV_SOURCES += unix/linux/priv.c
PRIV_LDADD += -lcap
endif
endif
# lib_libtcpcrypt
lib_libtcpcrypt_ladir = $(includedir)/tcpcrypt
lib_libtcpcrypt_la_HEADERS = include/tcpcrypt/tcpcrypt.h
lib_libtcpcrypt_la_SOURCES = \
lib/sockopt.c \
shared/socket_address.c shared/socket_address.h \
src/tcpcrypt_ctl.h \
lib/libtcpcrypt.sym
TCPCRYPT_LIBRARY_VERSION = 0:0:0
lib_libtcpcrypt_la_LDFLAGS = \
-version-info $(TCPCRYPT_LIBRARY_VERSION) \
-export-symbols $(top_srcdir)/lib/libtcpcrypt.sym
if OS_MINGW
lib_libtcpcrypt_la_LIBADD = -lws2_32
endif
# util_tcnetstat
util_tcnetstat_SOURCES = \
util/tcnetstat.c \
include/tcpcrypt/tcpcrypt.h \
shared/socket_address.c shared/socket_address.h \
lib/libtcpcrypt.la
util_tcnetstat_LDADD = lib/libtcpcrypt.la
if OS_MINGW
util_tcnetstat_LDADD += -lwsock32 -liphlpapi
endif
util_tcnetstat_CFLAGS = $(AM_CFLAGS)
# util_tcs
util_tcs_SOURCES = util/tcs.c \
shared/socket_address.c shared/socket_address.h \
$(PRIV_SOURCES)
util_tcs_LDADD = lib/libtcpcrypt.la $(PRIV_LDADD)
util_tcs_CFLAGS = $(AM_CFLAGS)
# src_tcpcryptd
src_tcpcryptd_SOURCES = \
src/tcpcryptd.c src/tcpcrypt.c src/crypto.c src/crypto_rsa.c src/crypto_aes.c \
src/crypto_hmac.c src/crypto_dummy.c src/profile.c src/checksum.c src/test.c \
src/crypto_hkdf.c \
src/crypto_reg.c src/crypto_ecdhe.c \
src/inc.h src/tcpcrypt_ctl.h src/tcpcrypt_divert.h src/tcpcrypt.h src/tcpcryptd.h \
src/profile.h src/checksum.h src/test.h src/crypto.h src/tcpcrypt_strings.h \
src/util.c src/util.h \
src/tcpcrypt_version.h \
shared/socket_address.c shared/socket_address.h \
$(PRIV_SOURCES)
src_tcpcryptd_LDADD = @tcpcryptd_LDADD@ @crypto_LDADD@
if OS_BSD
src_tcpcryptd_SOURCES += src/freebsd.c
endif
if OS_LINUX
src_tcpcryptd_SOURCES += src/linux.c
endif
if OS_MINGW
src_tcpcryptd_SOURCES += src/mingw.c src/res.rc src/cygwin.c contrib/win_port.h
src_tcpcryptd_LDADD += -lwsock32 -liphlpapi -lWinDivert
else
src_tcpcryptd_SOURCES += src/unix.c
endif
if !NO_ASM
src_tcpcryptd_SOURCES += src/checksum_32.S
endif
src_tcpcryptd_CFLAGS = $(AM_CFLAGS)
# tests/
tests/package.m4: $(top_srcdir)/configure.ac
{ \
echo '# Signature of the current package.' && \
echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
echo 'm4_define([AT_PACKAGE_URL], [$(PACKAGE_URL)])'; \
} >$@
tests/atconfig: config.status
./config.status $@
ALL_TESTS = tests/version.at tests/hmac.at
RUN_TESTSUITE = $(SHELL) $(srcdir)/tests/testsuite $(TESTSUITEFLAGS)
check-local: tests/atconfig tests/atlocal $(TESTSUITE)
$(RUN_TESTSUITE) AUTOTEST_PATH='tests:src:util'
installcheck-local: tests/atconfig tests/atlocal $(TESTSUITE)
$(RUN_TESTSUITE) AUTOTEST_PATH='tests:$(bindir)'
clean-local:
test ! -f '$(TESTSUITE)' || $(RUN_TESTSUITE) --clean
rm -f '$(TESTSUITE)'
rm -f tests/testsuite.log
rm -f tests/atconfig
AUTOM4TE = $(SHELL) $(srcdir)/config/missing --run autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): tests/testsuite.at tests/package.m4 $(ALL_TESTS)
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
mv $@.tmp $@
## test programs:
## all tests against crypto elements should include these:
cryptosources = \
src/inc.h \
src/crypto.h \
src/profile.h \
src/crypto.c \
src/profile.c \
src/util.c
check_PROGRAMS = tests/hmac
tests_hmac_SOURCES = tests/hmac.c \
src/crypto_hmac.c \
$(cryptosources)
tests_hmac_LDADD = @crypto_LDADD@