Regenerate build date and time every time tinc is built.
[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
8 if LINUX
9 sbin_PROGRAMS += sptps_speed
10 endif
11
12 DEFAULT_INCLUDES =
13
14 ed25519_SOURCES = \
15         ed25519/add_scalar.c \
16         ed25519/ed25519.h \
17         ed25519/fe.c ed25519/fe.h \
18         ed25519/fixedint.h \
19         ed25519/ge.c ed25519/ge.h \
20         ed25519/key_exchange.c \
21         ed25519/keypair.c \
22         ed25519/precomp_data.h \
23         ed25519/sc.c ed25519/sc.h \
24         ed25519/seed.c \
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_SOURCES) \
96         $(chacha_poly1305_SOURCES)
97
98 tinc_SOURCES = \
99         dropin.c dropin.h \
100         getopt.c getopt.h \
101         getopt1.c \
102         info.c info.h \
103         invitation.c invitation.h \
104         list.c list.h \
105         names.c names.h \
106         netutl.c netutl.h \
107         script.c script.h \
108         sptps.c sptps.h \
109         subnet_parse.c subnet.h \
110         tincctl.c tincctl.h \
111         top.c top.h \
112         utils.c utils.h \
113         version.c version.h \
114         $(ed25519_SOURCES) \
115         $(chacha_poly1305_SOURCES)
116
117 sptps_test_SOURCES = \
118         logger.c logger.h \
119         sptps.c sptps.h \
120         sptps_test.c \
121         utils.c utils.h \
122         $(ed25519_SOURCES) \
123         $(chacha_poly1305_SOURCES)
124
125 sptps_keypair_SOURCES = \
126         sptps_keypair.c \
127         utils.c utils.h \
128         $(ed25519_SOURCES)
129
130 sptps_speed_SOURCES = \
131         logger.c logger.h \
132         sptps.c sptps.h \
133         sptps_speed.c \
134         utils.c utils.h \
135         $(ed25519_SOURCES) \
136         $(chacha_poly1305_SOURCES)
137
138 ## Conditionally compile device drivers
139         
140 if LINUX
141 tincd_SOURCES += linux/device.c
142 endif
143
144 if BSD
145 tincd_SOURCES += bsd/device.c
146 if TUNEMU
147 tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
148 endif
149 endif
150
151 if SOLARIS
152 tincd_SOURCES += solaris/device.c
153 endif
154
155 if MINGW
156 tincd_SOURCES += mingw/device.c mingw/common.h
157 endif
158
159 if CYGWIN
160 tincd_SOURCES += cygwin/device.c
161 endif
162
163 if UML
164 tincd_SOURCES += uml_device.c
165 endif
166
167 if VDE
168 tincd_SOURCES += vde_device.c
169 endif
170
171 if OPENSSL
172 tincd_SOURCES += \
173         openssl/cipher.c \
174         openssl/crypto.c \
175         openssl/digest.c openssl/digest.h \
176         ed25519/ecdh.c \
177         ed25519/ecdsa.c \
178         openssl/prf.c \
179         openssl/rsa.c
180 tinc_SOURCES += \
181         openssl/cipher.c \
182         openssl/crypto.c \
183         openssl/digest.c openssl/digest.h \
184         ed25519/ecdh.c \
185         ed25519/ecdsa.c \
186         ed25519/ecdsagen.c \
187         openssl/prf.c \
188         openssl/rsa.c \
189         openssl/rsagen.c
190 sptps_test_SOURCES += \
191         openssl/crypto.c \
192         openssl/digest.c openssl/digest.h \
193         ed25519/ecdh.c \
194         ed25519/ecdsa.c \
195         openssl/prf.c
196 sptps_keypair_SOURCES += \
197         openssl/crypto.c \
198         ed25519/ecdsagen.c
199 sptps_speed_SOURCES += \
200         openssl/crypto.c \
201         openssl/digest.c openssl/digest.h \
202         ed25519/ecdh.c \
203         ed25519/ecdsa.c \
204         ed25519/ecdsagen.c \
205         openssl/prf.c
206 endif
207
208 if GCRYPT
209 tincd_SOURCES += \
210         gcrypt/cipher.c \
211         gcrypt/crypto.c \
212         gcrypt/digest.c gcrypt/digest.h \
213         gcrypt/ecdh.c \
214         gcrypt/ecdsa.c \
215         gcrypt/prf.c \
216         gcrypt/rsa.c
217 tinc_SOURCES += \
218         gcrypt/cipher.c \
219         gcrypt/crypto.c \
220         gcrypt/digest.c gcrypt/digest.h \
221         gcrypt/ecdh.c \
222         gcrypt/ecdsa.c \
223         gcrypt/ecdsagen.c \
224         gcrypt/prf.c \
225         gcrypt/rsa.c \
226         gcrypt/rsagen.c
227 sptps_test_SOURCES += \
228         gcrypt/cipher.c \
229         gcrypt/crypto.c \
230         gcrypt/digest.c gcrypt/digest.h \
231         gcrypt/ecdh.c \
232         gcrypt/ecdsa.c \
233         gcrypt/prf.c
234 endif
235
236 tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
237 sptps_speed_LDADD = -lrt
238
239 LIBS = @LIBS@
240
241 if TUNEMU
242 LIBS += -lpcap
243 endif
244
245 AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\"