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