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