5c8a841695adda536f442a20cc2caf24d8eb96e6
[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         info.c info.h \
105         invitation.c invitation.h \
106         list.c list.h \
107         names.c names.h \
108         netutl.c netutl.h \
109         script.c script.h \
110         sptps.c sptps.h \
111         subnet_parse.c subnet.h \
112         tincctl.c tincctl.h \
113         top.c top.h \
114         utils.c utils.h \
115         version.c version.h \
116         ed25519/ecdh.c \
117         ed25519/ecdsa.c \
118         ed25519/ecdsagen.c \
119         $(ed25519_SOURCES) \
120         $(chacha_poly1305_SOURCES)
121
122 sptps_test_SOURCES = \
123         logger.c logger.h \
124         sptps.c sptps.h \
125         sptps_test.c \
126         utils.c utils.h \
127         ed25519/ecdh.c \
128         ed25519/ecdsa.c \
129         $(ed25519_SOURCES) \
130         $(chacha_poly1305_SOURCES)
131
132 sptps_keypair_SOURCES = \
133         sptps_keypair.c \
134         utils.c utils.h \
135         ed25519/ecdsagen.c \
136         $(ed25519_SOURCES)
137
138 sptps_speed_SOURCES = \
139         logger.c logger.h \
140         sptps.c sptps.h \
141         sptps_speed.c \
142         utils.c utils.h \
143         ed25519/ecdh.c \
144         ed25519/ecdsa.c \
145         ed25519/ecdsagen.c \
146         $(ed25519_SOURCES) \
147         $(chacha_poly1305_SOURCES)
148
149 ## Conditionally compile device drivers
150         
151 if LINUX
152 tincd_SOURCES += linux/device.c
153 endif
154
155 if BSD
156 tincd_SOURCES += bsd/device.c
157 if TUNEMU
158 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
159 endif
160 endif
161
162 if SOLARIS
163 tincd_SOURCES += solaris/device.c
164 endif
165
166 if MINGW
167 tincd_SOURCES += mingw/device.c mingw/common.h
168 endif
169
170 if CYGWIN
171 tincd_SOURCES += cygwin/device.c
172 endif
173
174 if UML
175 tincd_SOURCES += uml_device.c
176 endif
177
178 if VDE
179 tincd_SOURCES += vde_device.c
180 endif
181
182 if OPENSSL
183 tincd_SOURCES += \
184         openssl/cipher.c \
185         openssl/crypto.c \
186         openssl/digest.c openssl/digest.h \
187         openssl/prf.c \
188         openssl/rsa.c
189 tinc_SOURCES += \
190         openssl/cipher.c \
191         openssl/crypto.c \
192         openssl/digest.c openssl/digest.h \
193         openssl/prf.c \
194         openssl/rsa.c \
195         openssl/rsagen.c
196 sptps_test_SOURCES += \
197         openssl/crypto.c \
198         openssl/digest.c openssl/digest.h \
199         openssl/prf.c
200 sptps_keypair_SOURCES += \
201         openssl/crypto.c
202 sptps_speed_SOURCES += \
203         openssl/crypto.c \
204         openssl/digest.c openssl/digest.h \
205         openssl/prf.c
206 elif GCRYPT
207 tincd_SOURCES += \
208         gcrypt/cipher.c \
209         gcrypt/crypto.c \
210         gcrypt/digest.c gcrypt/digest.h \
211         gcrypt/prf.c \
212         gcrypt/rsa.c
213 tinc_SOURCES += \
214         gcrypt/cipher.c \
215         gcrypt/crypto.c \
216         gcrypt/digest.c gcrypt/digest.h \
217         gcrypt/prf.c \
218         gcrypt/rsa.c \
219         gcrypt/rsagen.c
220 sptps_test_SOURCES += \
221         gcrypt/cipher.c \
222         gcrypt/crypto.c \
223         gcrypt/digest.c gcrypt/digest.h \
224         gcrypt/prf.c
225 sptps_keypair_SOURCES += \
226         openssl/crypto.c
227 sptps_speed_SOURCES += \
228         openssl/crypto.c \
229         openssl/digest.c openssl/digest.h \
230         openssl/prf.c
231 else
232 tincd_SOURCES += \
233         nolegacy/crypto.c \
234         nolegacy/prf.c
235 tinc_SOURCES += \
236         nolegacy/crypto.c \
237         nolegacy/prf.c
238 sptps_test_SOURCES += \
239         nolegacy/crypto.c \
240         nolegacy/prf.c
241 sptps_keypair_SOURCES += \
242         nolegacy/crypto.c
243 sptps_speed_SOURCES += \
244         nolegacy/crypto.c \
245         nolegacy/prf.c
246 endif
247
248 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
249 sptps_speed_LDADD = -lrt
250
251 LIBS = @LIBS@
252
253 if TUNEMU
254 LIBS += -lpcap
255 endif
256
257 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\"