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