e0733bebfdfb89cbc12acd15e52a716c464cac57
[tinc] / 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 if CONFIGURE_LZ4_BUILTIN
45 lz4_SOURCES = lib/lz4/lz4.c lib/lz4/lz4.h
46 else
47 lz4_SOURCES =
48 endif
49
50 tincd_SOURCES = \
51         address_cache.c address_cache.h \
52         autoconnect.c autoconnect.h \
53         buffer.c buffer.h \
54         cipher.h \
55         conf.c conf.h \
56         connection.c connection.h \
57         control.c control.h \
58         control_common.h \
59         crypto.h \
60         device.h \
61         digest.h \
62         dropin.c dropin.h \
63         dummy_device.c \
64         ecdh.h \
65         ecdsa.h \
66         ecdsagen.h \
67         edge.c edge.h \
68         ethernet.h \
69         event.c event.h \
70         fd_device.c \
71         graph.c graph.h \
72         hash.c hash.h \
73         have.h \
74         ipv4.h \
75         ipv6.h \
76         list.c list.h \
77         logger.c logger.h \
78         meta.c meta.h \
79         multicast_device.c \
80         names.c names.h \
81         net.c net.h \
82         net_packet.c \
83         net_setup.c \
84         net_socket.c \
85         netutl.c netutl.h \
86         node.c node.h \
87         prf.h \
88         process.c process.h \
89         protocol.c protocol.h \
90         protocol_auth.c \
91         protocol_edge.c \
92         protocol_key.c \
93         protocol_misc.c \
94         protocol_subnet.c \
95         raw_socket_device.c \
96         route.c route.h \
97         rsa.h \
98         rsagen.h \
99         script.c script.h \
100         splay_tree.c splay_tree.h \
101         sptps.c sptps.h \
102         subnet.c subnet.h \
103         subnet_parse.c \
104         system.h \
105         tincd.c \
106         utils.c utils.h \
107         xalloc.h \
108         version.c version.h \
109         ed25519/ecdh.c \
110         ed25519/ecdsa.c \
111         $(ed25519_SOURCES) \
112         $(chacha_poly1305_SOURCES) \
113         $(lz4_SOURCES)
114
115 tinc_SOURCES = \
116         dropin.c dropin.h \
117         fsck.c fsck.h \
118         ifconfig.c ifconfig.h \
119         info.c info.h \
120         invitation.c invitation.h \
121         list.c list.h \
122         names.c names.h \
123         netutl.c netutl.h \
124         script.c script.h \
125         sptps.c sptps.h \
126         subnet_parse.c subnet.h \
127         tincctl.c tincctl.h \
128         top.c top.h \
129         utils.c utils.h \
130         version.c version.h \
131         ed25519/ecdh.c \
132         ed25519/ecdsa.c \
133         ed25519/ecdsagen.c \
134         $(ed25519_SOURCES) \
135         $(chacha_poly1305_SOURCES)
136
137 sptps_test_SOURCES = \
138         logger.c logger.h \
139         sptps.c sptps.h \
140         sptps_test.c \
141         utils.c utils.h \
142         ed25519/ecdh.c \
143         ed25519/ecdsa.c \
144         $(ed25519_SOURCES) \
145         $(chacha_poly1305_SOURCES)
146
147 sptps_keypair_SOURCES = \
148         sptps_keypair.c \
149         utils.c utils.h \
150         ed25519/ecdsagen.c \
151         $(ed25519_SOURCES)
152
153 sptps_speed_SOURCES = \
154         logger.c logger.h \
155         sptps.c sptps.h \
156         sptps_speed.c \
157         utils.c utils.h \
158         ed25519/ecdh.c \
159         ed25519/ecdsa.c \
160         ed25519/ecdsagen.c \
161         $(ed25519_SOURCES) \
162         $(chacha_poly1305_SOURCES)
163
164 ## Conditionally compile device drivers
165
166 if !GETOPT
167 tincd_SOURCES += \
168         getopt.c getopt.h \
169         getopt1.c
170 tinc_SOURCES += \
171         getopt.c getopt.h \
172         getopt1.c
173 sptps_test_SOURCES += \
174         getopt.c getopt.h \
175         getopt1.c
176 sptps_keypair_SOURCES += \
177         getopt.c getopt.h \
178         getopt1.c
179 endif
180
181 if LINUX
182 tincd_SOURCES += linux/device.c
183 endif
184
185 if BSD
186 tincd_SOURCES += bsd/device.c
187 if TUNEMU
188 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
189 endif
190 endif
191
192 if SOLARIS
193 tincd_SOURCES += solaris/device.c
194 endif
195
196 if MINGW
197 tincd_SOURCES += mingw/device.c mingw/common.h
198 endif
199
200 if UML
201 tincd_SOURCES += uml_device.c
202 endif
203
204 if VDE
205 tincd_SOURCES += vde_device.c
206 endif
207
208 if OPENSSL
209 tincd_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 tinc_SOURCES += \
216         openssl/cipher.c \
217         openssl/crypto.c \
218         openssl/digest.c openssl/digest.h \
219         openssl/prf.c \
220         openssl/rsa.c \
221         openssl/rsagen.c
222 sptps_test_SOURCES += \
223         openssl/crypto.c \
224         openssl/digest.c openssl/digest.h \
225         openssl/prf.c
226 sptps_keypair_SOURCES += \
227         openssl/crypto.c
228 sptps_speed_SOURCES += \
229         openssl/crypto.c \
230         openssl/digest.c openssl/digest.h \
231         openssl/prf.c
232 else
233 if GCRYPT
234 tincd_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 tinc_SOURCES += \
241         gcrypt/cipher.c \
242         gcrypt/crypto.c \
243         gcrypt/digest.c gcrypt/digest.h \
244         gcrypt/prf.c \
245         gcrypt/rsa.c \
246         gcrypt/rsagen.c
247 sptps_test_SOURCES += \
248         gcrypt/cipher.c \
249         gcrypt/crypto.c \
250         gcrypt/digest.c gcrypt/digest.h \
251         gcrypt/prf.c
252 sptps_keypair_SOURCES += \
253         openssl/crypto.c
254 sptps_speed_SOURCES += \
255         openssl/crypto.c \
256         openssl/digest.c openssl/digest.h \
257         openssl/prf.c
258 else
259 tincd_SOURCES += \
260         nolegacy/crypto.c \
261         nolegacy/prf.c
262 tinc_SOURCES += \
263         nolegacy/crypto.c \
264         nolegacy/prf.c
265 sptps_test_SOURCES += \
266         nolegacy/crypto.c \
267         nolegacy/prf.c
268 sptps_keypair_SOURCES += \
269         nolegacy/crypto.c
270 sptps_speed_SOURCES += \
271         nolegacy/crypto.c \
272         nolegacy/prf.c
273 endif
274 endif
275
276 if MINIUPNPC
277 tincd_SOURCES += upnp.h upnp.c
278 tincd_LDADD = $(MINIUPNPC_LIBS)
279 tincd_LDFLAGS = -pthread
280 endif
281
282 if MINGW
283 sptps_test_LDFLAGS = -pthread
284 endif
285
286 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
287 sptps_speed_LDADD = -lrt
288
289 LIBS = @LIBS@ -lm $(CODE_COVERAGE_LIBS)
290
291 if TUNEMU
292 LIBS += -lpcap
293 endif
294
295 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DRUNSTATEDIR=\"$(runstatedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote. $(CODE_COVERAGE_CFLAGS)
296 AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)