Add fd_device
[tinc] / src / Makefile.am
1 ## Produce this file with automake to get Makefile.in
2
3 sbin_PROGRAMS = tincd tinc
4 EXTRA_PROGRAMS = sptps_test sptps_keypair
5
6 CLEANFILES = version_git.h
7
8 .PHONY: version-stamp
9 version-stamp:
10
11 version_git.h: version-stamp
12         $(AM_V_GEN)echo >$@
13         @-(cd $(srcdir) && git describe 2>/dev/null >/dev/null) && echo '#define GIT_DESCRIPTION "'`(cd $(srcdir) && git describe) | sed 's/release-//'`'"' >$@ ||:
14 ${srcdir}/version.c: version_git.h
15
16 ## Now a hack to appease some versions of BSD make that don't understand that "./foo" is the same as "foo".
17 if BSD
18 version.c: ${srcdir}/version.c
19 endif
20
21 if LINUX
22 EXTRA_PROGRAMS += sptps_speed
23 endif
24
25 ed25519_SOURCES = \
26         ed25519/add_scalar.c \
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         buffer.c buffer.h \
46         cipher.h \
47         conf.c conf.h \
48         connection.c connection.h \
49         control.c control.h \
50         control_common.h \
51         crypto.h \
52         device.h \
53         digest.h \
54         dropin.c dropin.h \
55         dummy_device.c \
56         ecdh.h \
57         ecdsa.h \
58         ecdsagen.h \
59         edge.c edge.h \
60         ethernet.h \
61         event.c event.h \
62         fd_device.c \
63         graph.c graph.h \
64         hash.c hash.h \
65         have.h \
66         ipv4.h \
67         ipv6.h \
68         list.c list.h \
69         logger.c logger.h \
70         meta.c meta.h \
71         multicast_device.c \
72         names.c names.h \
73         net.c net.h \
74         net_packet.c \
75         net_setup.c \
76         net_socket.c \
77         netutl.c netutl.h \
78         node.c node.h \
79         prf.h \
80         process.c process.h \
81         protocol.c protocol.h \
82         protocol_auth.c \
83         protocol_edge.c \
84         protocol_key.c \
85         protocol_misc.c \
86         protocol_subnet.c \
87         raw_socket_device.c \
88         route.c route.h \
89         rsa.h \
90         rsagen.h \
91         script.c script.h \
92         splay_tree.c splay_tree.h \
93         sptps.c sptps.h \
94         subnet.c subnet.h \
95         subnet_parse.c \
96         system.h \
97         tincd.c \
98         utils.c utils.h \
99         xalloc.h \
100         version.c version.h \
101         ed25519/ecdh.c \
102         ed25519/ecdsa.c \
103         $(ed25519_SOURCES) \
104         $(chacha_poly1305_SOURCES)
105
106 tinc_SOURCES = \
107         dropin.c dropin.h \
108         fsck.c fsck.h \
109         ifconfig.c ifconfig.h \
110         info.c info.h \
111         invitation.c invitation.h \
112         list.c list.h \
113         names.c names.h \
114         netutl.c netutl.h \
115         script.c script.h \
116         sptps.c sptps.h \
117         subnet_parse.c subnet.h \
118         tincctl.c tincctl.h \
119         top.c top.h \
120         utils.c utils.h \
121         version.c version.h \
122         ed25519/ecdh.c \
123         ed25519/ecdsa.c \
124         ed25519/ecdsagen.c \
125         $(ed25519_SOURCES) \
126         $(chacha_poly1305_SOURCES)
127
128 sptps_test_SOURCES = \
129         logger.c logger.h \
130         sptps.c sptps.h \
131         sptps_test.c \
132         utils.c utils.h \
133         ed25519/ecdh.c \
134         ed25519/ecdsa.c \
135         $(ed25519_SOURCES) \
136         $(chacha_poly1305_SOURCES)
137
138 sptps_keypair_SOURCES = \
139         sptps_keypair.c \
140         utils.c utils.h \
141         ed25519/ecdsagen.c \
142         $(ed25519_SOURCES)
143
144 sptps_speed_SOURCES = \
145         logger.c logger.h \
146         sptps.c sptps.h \
147         sptps_speed.c \
148         utils.c utils.h \
149         ed25519/ecdh.c \
150         ed25519/ecdsa.c \
151         ed25519/ecdsagen.c \
152         $(ed25519_SOURCES) \
153         $(chacha_poly1305_SOURCES)
154
155 ## Conditionally compile device drivers
156
157 if !GETOPT
158 tincd_SOURCES += \
159         getopt.c getopt.h \
160         getopt1.c
161 tinc_SOURCES += \
162         getopt.c getopt.h \
163         getopt1.c
164 sptps_test_SOURCES += \
165         getopt.c getopt.h \
166         getopt1.c
167 sptps_keypair_SOURCES += \
168         getopt.c getopt.h \
169         getopt1.c
170 endif
171
172 if LINUX
173 tincd_SOURCES += linux/device.c
174 endif
175
176 if BSD
177 tincd_SOURCES += bsd/device.c
178 if TUNEMU
179 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
180 endif
181 endif
182
183 if SOLARIS
184 tincd_SOURCES += solaris/device.c
185 endif
186
187 if MINGW
188 tincd_SOURCES += mingw/device.c mingw/common.h
189 endif
190
191 if CYGWIN
192 tincd_SOURCES += cygwin/device.c
193 endif
194
195 if UML
196 tincd_SOURCES += uml_device.c
197 endif
198
199 if VDE
200 tincd_SOURCES += vde_device.c
201 endif
202
203 if OPENSSL
204 tincd_SOURCES += \
205         openssl/cipher.c \
206         openssl/crypto.c \
207         openssl/digest.c openssl/digest.h \
208         openssl/prf.c \
209         openssl/rsa.c
210 tinc_SOURCES += \
211         openssl/cipher.c \
212         openssl/crypto.c \
213         openssl/digest.c openssl/digest.h \
214         openssl/prf.c \
215         openssl/rsa.c \
216         openssl/rsagen.c
217 sptps_test_SOURCES += \
218         openssl/crypto.c \
219         openssl/digest.c openssl/digest.h \
220         openssl/prf.c
221 sptps_keypair_SOURCES += \
222         openssl/crypto.c
223 sptps_speed_SOURCES += \
224         openssl/crypto.c \
225         openssl/digest.c openssl/digest.h \
226         openssl/prf.c
227 else
228 if GCRYPT
229 tincd_SOURCES += \
230         gcrypt/cipher.c \
231         gcrypt/crypto.c \
232         gcrypt/digest.c gcrypt/digest.h \
233         gcrypt/prf.c \
234         gcrypt/rsa.c
235 tinc_SOURCES += \
236         gcrypt/cipher.c \
237         gcrypt/crypto.c \
238         gcrypt/digest.c gcrypt/digest.h \
239         gcrypt/prf.c \
240         gcrypt/rsa.c \
241         gcrypt/rsagen.c
242 sptps_test_SOURCES += \
243         gcrypt/cipher.c \
244         gcrypt/crypto.c \
245         gcrypt/digest.c gcrypt/digest.h \
246         gcrypt/prf.c
247 sptps_keypair_SOURCES += \
248         openssl/crypto.c
249 sptps_speed_SOURCES += \
250         openssl/crypto.c \
251         openssl/digest.c openssl/digest.h \
252         openssl/prf.c
253 else
254 tincd_SOURCES += \
255         nolegacy/crypto.c \
256         nolegacy/prf.c
257 tinc_SOURCES += \
258         nolegacy/crypto.c \
259         nolegacy/prf.c
260 sptps_test_SOURCES += \
261         nolegacy/crypto.c \
262         nolegacy/prf.c
263 sptps_keypair_SOURCES += \
264         nolegacy/crypto.c
265 sptps_speed_SOURCES += \
266         nolegacy/crypto.c \
267         nolegacy/prf.c
268 endif
269 endif
270
271 if MINIUPNPC
272 tincd_SOURCES += upnp.h upnp.c
273 tincd_LDADD = $(MINIUPNPC_LIBS)
274 tincd_LDFLAGS = -pthread
275 endif
276
277 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
278 sptps_speed_LDADD = -lrt
279
280 LIBS = @LIBS@ -lm
281
282 if TUNEMU
283 LIBS += -lpcap
284 endif
285
286 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.