roken build vsyslog
[openafs.git] / src / crypto / hcrypto / Makefile.in
1 # Copyright 2010, Your File System Inc
2 # All rights reserved
3 #
4 # This software has been released under the terms of the BSD License
5 # For details, see the LICENSE file in the top level source directory
6
7 # API version. Must be incremented whenever something changes.
8 LIBMAJOR=1
9 LIBMINOR=1
10
11 srcdir=@srcdir@
12 include @TOP_OBJDIR@/src/config/Makefile.config
13 include @TOP_OBJDIR@/src/config/Makefile.shared
14
15 INSTALL = @INSTALL@
16 INSTALL_DATA = @INSTALL_DATA@
17
18 HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \
19          ${TOP_INCDIR}/hcrypto/des.h \
20          ${TOP_INCDIR}/hcrypto/engine.h \
21          ${TOP_INCDIR}/hcrypto/evp.h \
22          ${TOP_INCDIR}/hcrypto/evp-hcrypto.h \
23          ${TOP_INCDIR}/hcrypto/evp-cc.h \
24          ${TOP_INCDIR}/hcrypto/hmac.h \
25          ${TOP_INCDIR}/hcrypto/md2.h \
26          ${TOP_INCDIR}/hcrypto/md4.h \
27          ${TOP_INCDIR}/hcrypto/md5.h \
28          ${TOP_INCDIR}/hcrypto/rand.h \
29          ${TOP_INCDIR}/hcrypto/rc2.h \
30          ${TOP_INCDIR}/hcrypto/rc4.h \
31          ${TOP_INCDIR}/hcrypto/sha.h \
32          ${TOP_INCDIR}/hcrypto/ui.h
33
34 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
35
36 MODULE_INCLUDE=-I${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto 
37
38 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
39
40 all: $(ROKEN_HEADERS) ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
41         ${TOP_LIBDIR}/libafshcrypto.a \
42         ${TOP_LIBDIR}/libafshcrypto_lwp.a
43
44 install: libafshcrypto.a ${SHLIBOBJ}
45         ${TOP_OBJDIR}/src/config/shlib-install -d ${DESTDIR}${libdir} \
46                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
47         ${INSTALL_DATA} libafshcrypto.a ${DESTDIR}${libdir}/libafshcrypto.a
48
49 dest: libafshcrypto.a ${SHLIBOBJ}
50         ${TOP_OBJDIR}/src/config/shlib-install -d ${DEST}/lib \
51                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
52         ${INSTALL_DATA} libafshcrypto.a ${DEST}/lib/libafshcrypto.a
53
54 clean:
55         $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
56                  test_cipher test_cipher.o hex.o
57
58 COMMON_OBJS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \
59              evp-hcrypto.o evp-cc.o hmac.o md2.o md4.o md5.o pkcs5.o \
60              rand-egd.o rand-timer.o rand-unix.o rand.o rc2.o rc4.o \
61              rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \
62              validate.o \
63              cloexec.o ct.o issuid.o net_read.o net_write.o warnerr.o
64
65 OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS)
66
67 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS)
68
69 LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
70         -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
71
72 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
73         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
74                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
75
76 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
77         ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
78                 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
79                 ${OBJECTS} ${MT_LIBS}
80
81 libafshcrypto.a: ${OBJECTS}
82         $(RM) -f $@
83         $(AR) crv $@ ${OBJECTS}
84         $(RANLIB) $@
85
86 libafshcrypto_lwp.a: $(LWP_OBJS)
87         $(RM) -f $@
88         $(AR) crv $@ $(LWP_OBJS)
89         $(RANLIB) $@
90
91 test_cipher: test_cipher.o hex.o libafshcrypto.a
92         $(AFS_LDRULE) test_cipher.o hex.o libafshcrypto.a
93
94 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
95         ${INSTALL_DATA} $? $@
96
97 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
98         ${INSTALL_DATA} $? $@
99
100 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
101         ${INSTALL_DATA} $? $@
102
103 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
104         ${INSTALL_DATA} $? $@
105
106 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
107         ${INSTALL_DATA} $? $@
108
109 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
110         ${INSTALL_DATA} $? $@
111
112 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
113         ${INSTALL_DATA} $? $@
114
115 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
116         ${INSTALL_DATA} $? $@
117
118 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
119         ${INSTALL_DATA} $? $@
120
121 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
122         ${INSTALL_DATA} $? $@
123
124 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
125         ${INSTALL_DATA} $? $@
126
127 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
128         ${INSTALL_DATA} $? $@
129
130 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
131         ${INSTALL_DATA} $? $@
132
133 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
134         ${INSTALL_DATA} $? $@
135
136 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
137         ${INSTALL_DATA} $? $@
138
139 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
140         ${INSTALL_DATA} $? $@
141
142 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
143         ${INSTALL_DATA} $? $@
144
145 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
146         ${INSTALL_DATA} $? $@
147
148 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
149         ${INSTALL_DATA} $? $@
150
151 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
152         ${INSTALL_DATA} $? $@
153
154 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
155         ${INSTALL_DATA} $? $@
156
157 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
158         ${INSTALL_DATA} $? $@
159
160 # Pthread Targets
161
162 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
163 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
164 CFLAGS_evp.o=-DHAVE_CONFIG_H
165
166 aes.o: ${UPSTREAM}/hcrypto/aes.c
167         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
168
169 bn.o: ${UPSTREAM}/hcrypto/bn.c
170         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
171
172 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
173         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
174
175 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
176         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
177
178 des.o: ${UPSTREAM}/hcrypto/des.c
179         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
180         
181 evp.o: ${UPSTREAM}/hcrypto/evp.c
182         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
183         
184 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
185         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
186         
187 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
188         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
189
190 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
191         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
192
193 md2.o: ${UPSTREAM}/hcrypto/md2.c
194         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
195
196 md4.o: ${UPSTREAM}/hcrypto/md4.c
197         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
198
199 md5.o: ${UPSTREAM}/hcrypto/md5.c
200         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
201
202 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
203         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
204
205 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
206         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
207
208 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
209         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
210
211 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
212         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
213
214 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
215         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
216
217 rand.o: ${UPSTREAM}/hcrypto/rand.c
218         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
219
220 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
221         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
222
223 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
224         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
225
226 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
227         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
228
229 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
230         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
231
232 sha.o: ${UPSTREAM}/hcrypto/sha.c
233         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
234
235 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
236         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
237
238 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
239         ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
240
241 ui.o: ${UPSTREAM}/hcrypto/ui.c
242         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
243
244 validate.o: ${UPSTREAM}/hcrypto/validate.c
245         ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
246
247 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
248         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
249
250 # These bits of libroken are new functionality, rather than compatibility
251 # code. Where they should go eventually is unclear.
252
253 cloexec.o: ${UPSTREAM}/roken/cloexec.c
254         $(AFS_CCRULE) $(UPSTREAM)/roken/cloexec.c
255
256 ct.o: ${UPSTREAM}/roken/ct.c
257         $(AFS_CCRULE) $(UPSTREAM)/roken/ct.c
258
259 hex.o: ${UPSTREAM}/roken/hex.c
260         $(AFS_CCRULE) $(UPSTREAM)/roken/hex.c
261
262 issuid.o: ${UPSTREAM}/roken/issuid.c
263         $(AFS_CCRULE) $(UPSTREAM)/roken/issuid.c
264
265 net_read.o: ${UPSTREAM}/roken/net_read.c
266         $(AFS_CCRULE) $(UPSTREAM)/roken/net_read.c
267
268 net_write.o: ${UPSTREAM}/roken/net_write.c
269         $(AFS_CCRULE) $(UPSTREAM)/roken/net_write.c
270
271 # These bits of libroken are compatibility functions. They should get moved
272 # out into a new libroken top level target, which allows the use of an
273 # existing libroken, if one is available.
274
275
276 daemon.o: ${UPSTREAM}/roken/daemon.c
277         $(AFS_CCRULE) $(UPSTREAM)/roken/daemon.c
278
279 ecalloc.o: ${UPSTREAM}/roken/ecalloc.c
280         $(AFS_CCRULE) $(UPSTREAM)/roken/ecalloc.c
281
282 emalloc.o: ${UPSTREAM}/roken/emalloc.c
283         $(AFS_CCRULE) $(UPSTREAM)/roken/emalloc.c
284
285 erealloc.o: ${UPSTREAM}/roken/erealloc.c
286         $(AFS_CCRULE) $(UPSTREAM)/roken/erealloc.c
287
288 err.h: ${UPSTREAM}/roken/err.hin
289         cp $? $@
290
291 err.o: ${UPSTREAM}/roken/err.c
292         $(AFS_CCRULE) $(UPSTREAM)/roken/err.c
293
294 errx.o: ${UPSTREAM}/roken/errx.c
295         $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c
296
297 getopt.o: ${UPSTREAM}/roken/getopt.c
298         $(AFS_CCRULE) $(UPSTREAM)/roken/getopt.c
299
300 getprogname.o: ${UPSTREAM}/roken/getprogname.c
301         $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c
302
303 socket.o: ${UPSTREAM}/roken/socket.c
304         $(AFS_CCRULE) $(UPSTREAM)/roken/socket.c
305
306 strlcat.o: ${UPSTREAM}/roken/strlcat.c
307         $(AFS_CCRULE) $(UPSTREAM)/roken/strlcat.c
308
309 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
310         $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c
311
312 strnlen.o: ${UPSTREAM}/roken/strnlen.c
313         $(AFS_CCRULE) $(UPSTREAM)/roken/strnlen.c
314
315 verr.o: ${UPSTREAM}/roken/verr.c
316         $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c
317
318 verrx.o: ${UPSTREAM}/roken/verrx.c
319         $(AFS_CCRULE) $(UPSTREAM)/roken/verrx.c
320
321 vsyslog.o: ${UPSTREAM}/roken/vsyslog.c
322         $(AFS_CCRULE) $(UPSTREAM)/roken/vsyslog.c
323
324 vwarn.o: ${UPSTREAM}/roken/vwarn.c
325         $(AFS_CCRULE) $(UPSTREAM)/roken/vwarn.c
326
327 vwarnx.o: ${UPSTREAM}/roken/vwarnx.c
328         $(AFS_CCRULE) $(UPSTREAM)/roken/vwarnx.c
329
330 warn.o: ${UPSTREAM}/roken/warn.c
331         $(AFS_CCRULE) $(UPSTREAM)/roken/warn.c
332
333 warnerr.o: ${UPSTREAM}/roken/warnerr.c
334         $(AFS_CCRULE) $(UPSTREAM)/roken/warnerr.c
335
336 warnx.o: ${UPSTREAM}/roken/warnx.c
337         $(AFS_CCRULE) $(UPSTREAM)/roken/warnx.c
338
339 # LWP Targets
340
341 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
342         ${LWPRULE} -o rand-fortuna_lwp.o
343