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