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