Add -Wall to CFLAGS.
[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 ## Now a hack to appease some versions of BSD make that don't understand that "./foo" is the same as "foo".
16 if BSD
17 version.c: ${srcdir}/version.c
18 endif
19
20 if LINUX
21 sbin_PROGRAMS += sptps_speed
22 endif
23
24 ed25519_SOURCES = \
25         ed25519/add_scalar.c \
26         ed25519/ed25519.h \
27         ed25519/fe.c ed25519/fe.h \
28         ed25519/fixedint.h \
29         ed25519/ge.c ed25519/ge.h \
30         ed25519/key_exchange.c \
31         ed25519/keypair.c \
32         ed25519/precomp_data.h \
33         ed25519/sc.c ed25519/sc.h \
34         ed25519/sha512.c ed25519/sha512.h \
35         ed25519/sign.c \
36         ed25519/verify.c
37
38 chacha_poly1305_SOURCES = \
39         chacha-poly1305/chacha.c chacha-poly1305/chacha.h \
40         chacha-poly1305/chacha-poly1305.c chacha-poly1305/chacha-poly1305.h \
41         chacha-poly1305/poly1305.c chacha-poly1305/poly1305.h
42
43 tincd_SOURCES = \
44         buffer.c buffer.h \
45         cipher.h \
46         conf.c conf.h \
47         connection.c connection.h \
48         control.c control.h \
49         control_common.h \
50         crypto.h \
51         device.h \
52         digest.h \
53         dropin.c dropin.h \
54         dummy_device.c \
55         ecdh.h \
56         ecdsa.h \
57         ecdsagen.h \
58         edge.c edge.h \
59         ethernet.h \
60         event.c event.h \
61         graph.c graph.h \
62         hash.c hash.h \
63         have.h \
64         ipv4.h \
65         ipv6.h \
66         list.c list.h \
67         logger.c logger.h \
68         meta.c meta.h \
69         multicast_device.c \
70         names.c names.h \
71         net.c net.h \
72         net_packet.c \
73         net_setup.c \
74         net_socket.c \
75         netutl.c netutl.h \
76         node.c node.h \
77         prf.h \
78         process.c process.h \
79         protocol.c protocol.h \
80         protocol_auth.c \
81         protocol_edge.c \
82         protocol_key.c \
83         protocol_misc.c \
84         protocol_subnet.c \
85         raw_socket_device.c \
86         route.c route.h \
87         rsa.h \
88         rsagen.h \
89         script.c script.h \
90         splay_tree.c splay_tree.h \
91         sptps.c sptps.h \
92         subnet.c subnet.h \
93         subnet_parse.c \
94         system.h \
95         tincd.c \
96         utils.c utils.h \
97         xalloc.h \
98         version.c version.h \
99         ed25519/ecdh.c \
100         ed25519/ecdsa.c \
101         $(ed25519_SOURCES) \
102         $(chacha_poly1305_SOURCES)
103
104 tinc_SOURCES = \
105         dropin.c dropin.h \
106         fsck.c fsck.h \
107         ifconfig.c ifconfig.h \
108         info.c info.h \
109         invitation.c invitation.h \
110         list.c list.h \
111         names.c names.h \
112         netutl.c netutl.h \
113         script.c script.h \
114         sptps.c sptps.h \
115         subnet_parse.c subnet.h \
116         tincctl.c tincctl.h \
117         top.c top.h \
118         utils.c utils.h \
119         version.c version.h \
120         ed25519/ecdh.c \
121         ed25519/ecdsa.c \
122         ed25519/ecdsagen.c \
123         $(ed25519_SOURCES) \
124         $(chacha_poly1305_SOURCES)
125
126 sptps_test_SOURCES = \
127         logger.c logger.h \
128         sptps.c sptps.h \
129         sptps_test.c \
130         utils.c utils.h \
131         ed25519/ecdh.c \
132         ed25519/ecdsa.c \
133         $(ed25519_SOURCES) \
134         $(chacha_poly1305_SOURCES)
135
136 sptps_keypair_SOURCES = \
137         sptps_keypair.c \
138         utils.c utils.h \
139         ed25519/ecdsagen.c \
140         $(ed25519_SOURCES)
141
142 sptps_speed_SOURCES = \
143         logger.c logger.h \
144         sptps.c sptps.h \
145         sptps_speed.c \
146         utils.c utils.h \
147         ed25519/ecdh.c \
148         ed25519/ecdsa.c \
149         ed25519/ecdsagen.c \
150         $(ed25519_SOURCES) \
151         $(chacha_poly1305_SOURCES)
152
153 ## Conditionally compile device drivers
154
155 if !GETOPT
156 tincd_SOURCES += \
157         getopt.c getopt.h \
158         getopt1.c
159 tinc_SOURCES += \
160         getopt.c getopt.h \
161         getopt1.c
162 sptps_test_SOURCES += \
163         getopt.c getopt.h \
164         getopt1.c
165 sptps_keypair_SOURCES += \
166         getopt.c getopt.h \
167         getopt1.c
168 endif
169
170 if LINUX
171 tincd_SOURCES += linux/device.c
172 endif
173
174 if BSD
175 tincd_SOURCES += bsd/device.c
176 if TUNEMU
177 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
178 endif
179 endif
180
181 if SOLARIS
182 tincd_SOURCES += solaris/device.c
183 endif
184
185 if MINGW
186 tincd_SOURCES += mingw/device.c mingw/common.h
187 endif
188
189 if CYGWIN
190 tincd_SOURCES += cygwin/device.c
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
279
280 if TUNEMU
281 LIBS += -lpcap
282 endif
283
284 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.