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