Fix "use of GNU empty initializer extension" warning.
[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 CYGWIN
194 tincd_SOURCES += cygwin/device.c
195 endif
196
197 if UML
198 tincd_SOURCES += uml_device.c
199 endif
200
201 if VDE
202 tincd_SOURCES += vde_device.c
203 endif
204
205 if OPENSSL
206 tincd_SOURCES += \
207         openssl/cipher.c \
208         openssl/crypto.c \
209         openssl/digest.c openssl/digest.h \
210         openssl/prf.c \
211         openssl/rsa.c
212 tinc_SOURCES += \
213         openssl/cipher.c \
214         openssl/crypto.c \
215         openssl/digest.c openssl/digest.h \
216         openssl/prf.c \
217         openssl/rsa.c \
218         openssl/rsagen.c
219 sptps_test_SOURCES += \
220         openssl/crypto.c \
221         openssl/digest.c openssl/digest.h \
222         openssl/prf.c
223 sptps_keypair_SOURCES += \
224         openssl/crypto.c
225 sptps_speed_SOURCES += \
226         openssl/crypto.c \
227         openssl/digest.c openssl/digest.h \
228         openssl/prf.c
229 else
230 if GCRYPT
231 tincd_SOURCES += \
232         gcrypt/cipher.c \
233         gcrypt/crypto.c \
234         gcrypt/digest.c gcrypt/digest.h \
235         gcrypt/prf.c \
236         gcrypt/rsa.c
237 tinc_SOURCES += \
238         gcrypt/cipher.c \
239         gcrypt/crypto.c \
240         gcrypt/digest.c gcrypt/digest.h \
241         gcrypt/prf.c \
242         gcrypt/rsa.c \
243         gcrypt/rsagen.c
244 sptps_test_SOURCES += \
245         gcrypt/cipher.c \
246         gcrypt/crypto.c \
247         gcrypt/digest.c gcrypt/digest.h \
248         gcrypt/prf.c
249 sptps_keypair_SOURCES += \
250         openssl/crypto.c
251 sptps_speed_SOURCES += \
252         openssl/crypto.c \
253         openssl/digest.c openssl/digest.h \
254         openssl/prf.c
255 else
256 tincd_SOURCES += \
257         nolegacy/crypto.c \
258         nolegacy/prf.c
259 tinc_SOURCES += \
260         nolegacy/crypto.c \
261         nolegacy/prf.c
262 sptps_test_SOURCES += \
263         nolegacy/crypto.c \
264         nolegacy/prf.c
265 sptps_keypair_SOURCES += \
266         nolegacy/crypto.c
267 sptps_speed_SOURCES += \
268         nolegacy/crypto.c \
269         nolegacy/prf.c
270 endif
271 endif
272
273 if MINIUPNPC
274 tincd_SOURCES += upnp.h upnp.c
275 tincd_LDADD = $(MINIUPNPC_LIBS)
276 tincd_LDFLAGS = -pthread
277 endif
278
279 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
280 sptps_speed_LDADD = -lrt
281
282 LIBS = @LIBS@ -lm
283
284 if TUNEMU
285 LIBS += -lpcap
286 endif
287
288 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DRUNSTATEDIR=\"$(runstatedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.