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