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