Don't build sptps_* binaries by default.
[tinc] / src / Makefile.am
1 ## Produce this file with automake to get Makefile.in
2
3 sbin_PROGRAMS = tincd tinc
4 EXTRA_PROGRAMS = sptps_test sptps_keypair
5
6 CLEANFILES = version_git.h
7
8 .PHONY: version-stamp
9 version-stamp:
10
11 version_git.h: version-stamp
12         $(AM_V_GEN)echo >$@
13         @-(cd $(srcdir) && git describe 2>/dev/null >/dev/null) && echo '#define GIT_DESCRIPTION "'`(cd $(srcdir) && git describe) | sed 's/release-//'`'"' >$@ ||:
14 ${srcdir}/version.c: version_git.h
15
16 ## Now a hack to appease some versions of BSD make that don't understand that "./foo" is the same as "foo".
17 if BSD
18 version.c: ${srcdir}/version.c
19 endif
20
21 if LINUX
22 EXTRA_PROGRAMS += sptps_speed
23 endif
24
25 ed25519_SOURCES = \
26         ed25519/add_scalar.c \
27         ed25519/ed25519.h \
28         ed25519/fe.c ed25519/fe.h \
29         ed25519/fixedint.h \
30         ed25519/ge.c ed25519/ge.h \
31         ed25519/key_exchange.c \
32         ed25519/keypair.c \
33         ed25519/precomp_data.h \
34         ed25519/sc.c ed25519/sc.h \
35         ed25519/sha512.c ed25519/sha512.h \
36         ed25519/sign.c \
37         ed25519/verify.c
38
39 chacha_poly1305_SOURCES = \
40         chacha-poly1305/chacha.c chacha-poly1305/chacha.h \
41         chacha-poly1305/chacha-poly1305.c chacha-poly1305/chacha-poly1305.h \
42         chacha-poly1305/poly1305.c chacha-poly1305/poly1305.h
43
44 tincd_SOURCES = \
45         buffer.c buffer.h \
46         cipher.h \
47         conf.c conf.h \
48         connection.c connection.h \
49         control.c control.h \
50         control_common.h \
51         crypto.h \
52         device.h \
53         digest.h \
54         dropin.c dropin.h \
55         dummy_device.c \
56         ecdh.h \
57         ecdsa.h \
58         ecdsagen.h \
59         edge.c edge.h \
60         ethernet.h \
61         event.c event.h \
62         graph.c graph.h \
63         hash.c hash.h \
64         have.h \
65         ipv4.h \
66         ipv6.h \
67         list.c list.h \
68         logger.c logger.h \
69         meta.c meta.h \
70         multicast_device.c \
71         names.c names.h \
72         net.c net.h \
73         net_packet.c \
74         net_setup.c \
75         net_socket.c \
76         netutl.c netutl.h \
77         node.c node.h \
78         prf.h \
79         process.c process.h \
80         protocol.c protocol.h \
81         protocol_auth.c \
82         protocol_edge.c \
83         protocol_key.c \
84         protocol_misc.c \
85         protocol_subnet.c \
86         raw_socket_device.c \
87         route.c route.h \
88         rsa.h \
89         rsagen.h \
90         script.c script.h \
91         splay_tree.c splay_tree.h \
92         sptps.c sptps.h \
93         subnet.c subnet.h \
94         subnet_parse.c \
95         system.h \
96         tincd.c \
97         utils.c utils.h \
98         xalloc.h \
99         version.c version.h \
100         ed25519/ecdh.c \
101         ed25519/ecdsa.c \
102         $(ed25519_SOURCES) \
103         $(chacha_poly1305_SOURCES)
104
105 tinc_SOURCES = \
106         dropin.c dropin.h \
107         fsck.c fsck.h \
108         ifconfig.c ifconfig.h \
109         info.c info.h \
110         invitation.c invitation.h \
111         list.c list.h \
112         names.c names.h \
113         netutl.c netutl.h \
114         script.c script.h \
115         sptps.c sptps.h \
116         subnet_parse.c subnet.h \
117         tincctl.c tincctl.h \
118         top.c top.h \
119         utils.c utils.h \
120         version.c version.h \
121         ed25519/ecdh.c \
122         ed25519/ecdsa.c \
123         ed25519/ecdsagen.c \
124         $(ed25519_SOURCES) \
125         $(chacha_poly1305_SOURCES)
126
127 sptps_test_SOURCES = \
128         logger.c logger.h \
129         sptps.c sptps.h \
130         sptps_test.c \
131         utils.c utils.h \
132         ed25519/ecdh.c \
133         ed25519/ecdsa.c \
134         $(ed25519_SOURCES) \
135         $(chacha_poly1305_SOURCES)
136
137 sptps_keypair_SOURCES = \
138         sptps_keypair.c \
139         utils.c utils.h \
140         ed25519/ecdsagen.c \
141         $(ed25519_SOURCES)
142
143 sptps_speed_SOURCES = \
144         logger.c logger.h \
145         sptps.c sptps.h \
146         sptps_speed.c \
147         utils.c utils.h \
148         ed25519/ecdh.c \
149         ed25519/ecdsa.c \
150         ed25519/ecdsagen.c \
151         $(ed25519_SOURCES) \
152         $(chacha_poly1305_SOURCES)
153
154 ## Conditionally compile device drivers
155
156 if !GETOPT
157 tincd_SOURCES += \
158         getopt.c getopt.h \
159         getopt1.c
160 tinc_SOURCES += \
161         getopt.c getopt.h \
162         getopt1.c
163 sptps_test_SOURCES += \
164         getopt.c getopt.h \
165         getopt1.c
166 sptps_keypair_SOURCES += \
167         getopt.c getopt.h \
168         getopt1.c
169 endif
170
171 if LINUX
172 tincd_SOURCES += linux/device.c
173 endif
174
175 if BSD
176 tincd_SOURCES += bsd/device.c
177 if TUNEMU
178 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
179 endif
180 endif
181
182 if SOLARIS
183 tincd_SOURCES += solaris/device.c
184 endif
185
186 if MINGW
187 tincd_SOURCES += mingw/device.c mingw/common.h
188 endif
189
190 if CYGWIN
191 tincd_SOURCES += cygwin/device.c
192 endif
193
194 if UML
195 tincd_SOURCES += uml_device.c
196 endif
197
198 if VDE
199 tincd_SOURCES += vde_device.c
200 endif
201
202 if OPENSSL
203 tincd_SOURCES += \
204         openssl/cipher.c \
205         openssl/crypto.c \
206         openssl/digest.c openssl/digest.h \
207         openssl/prf.c \
208         openssl/rsa.c
209 tinc_SOURCES += \
210         openssl/cipher.c \
211         openssl/crypto.c \
212         openssl/digest.c openssl/digest.h \
213         openssl/prf.c \
214         openssl/rsa.c \
215         openssl/rsagen.c
216 sptps_test_SOURCES += \
217         openssl/crypto.c \
218         openssl/digest.c openssl/digest.h \
219         openssl/prf.c
220 sptps_keypair_SOURCES += \
221         openssl/crypto.c
222 sptps_speed_SOURCES += \
223         openssl/crypto.c \
224         openssl/digest.c openssl/digest.h \
225         openssl/prf.c
226 else
227 if GCRYPT
228 tincd_SOURCES += \
229         gcrypt/cipher.c \
230         gcrypt/crypto.c \
231         gcrypt/digest.c gcrypt/digest.h \
232         gcrypt/prf.c \
233         gcrypt/rsa.c
234 tinc_SOURCES += \
235         gcrypt/cipher.c \
236         gcrypt/crypto.c \
237         gcrypt/digest.c gcrypt/digest.h \
238         gcrypt/prf.c \
239         gcrypt/rsa.c \
240         gcrypt/rsagen.c
241 sptps_test_SOURCES += \
242         gcrypt/cipher.c \
243         gcrypt/crypto.c \
244         gcrypt/digest.c gcrypt/digest.h \
245         gcrypt/prf.c
246 sptps_keypair_SOURCES += \
247         openssl/crypto.c
248 sptps_speed_SOURCES += \
249         openssl/crypto.c \
250         openssl/digest.c openssl/digest.h \
251         openssl/prf.c
252 else
253 tincd_SOURCES += \
254         nolegacy/crypto.c \
255         nolegacy/prf.c
256 tinc_SOURCES += \
257         nolegacy/crypto.c \
258         nolegacy/prf.c
259 sptps_test_SOURCES += \
260         nolegacy/crypto.c \
261         nolegacy/prf.c
262 sptps_keypair_SOURCES += \
263         nolegacy/crypto.c
264 sptps_speed_SOURCES += \
265         nolegacy/crypto.c \
266         nolegacy/prf.c
267 endif
268 endif
269
270 if MINIUPNPC
271 tincd_SOURCES += upnp.h upnp.c
272 tincd_LDADD = $(MINIUPNPC_LIBS)
273 tincd_LDFLAGS = -pthread
274 endif
275
276 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
277 sptps_speed_LDADD = -lrt
278
279 LIBS = @LIBS@ -lm
280
281 if TUNEMU
282 LIBS += -lpcap
283 endif
284
285 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.