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