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