Add snprintf to roken for Unix builds
[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 snprintf.o \
64              warnerr.o
65
66 OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS)
67
68 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS)
69
70 LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
71         -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
72
73 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
74         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
75                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
76
77 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
78         ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
79                 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
80                 ${OBJECTS} ${MT_LIBS}
81
82 libafshcrypto.a: ${OBJECTS}
83         $(RM) -f $@
84         $(AR) crv $@ ${OBJECTS}
85         $(RANLIB) $@
86
87 libafshcrypto_lwp.a: $(LWP_OBJS)
88         $(RM) -f $@
89         $(AR) crv $@ $(LWP_OBJS)
90         $(RANLIB) $@
91
92 test_cipher: test_cipher.o hex.o libafshcrypto.a
93         $(AFS_LDRULE) test_cipher.o hex.o libafshcrypto.a
94
95 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
96         ${INSTALL_DATA} $? $@
97
98 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
99         ${INSTALL_DATA} $? $@
100
101 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
102         ${INSTALL_DATA} $? $@
103
104 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
105         ${INSTALL_DATA} $? $@
106
107 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
108         ${INSTALL_DATA} $? $@
109
110 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
111         ${INSTALL_DATA} $? $@
112
113 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
114         ${INSTALL_DATA} $? $@
115
116 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
117         ${INSTALL_DATA} $? $@
118
119 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
120         ${INSTALL_DATA} $? $@
121
122 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
123         ${INSTALL_DATA} $? $@
124
125 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
126         ${INSTALL_DATA} $? $@
127
128 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
129         ${INSTALL_DATA} $? $@
130
131 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
132         ${INSTALL_DATA} $? $@
133
134 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
135         ${INSTALL_DATA} $? $@
136
137 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
138         ${INSTALL_DATA} $? $@
139
140 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
141         ${INSTALL_DATA} $? $@
142
143 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
144         ${INSTALL_DATA} $? $@
145
146 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
147         ${INSTALL_DATA} $? $@
148
149 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
150         ${INSTALL_DATA} $? $@
151
152 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
153         ${INSTALL_DATA} $? $@
154
155 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
156         ${INSTALL_DATA} $? $@
157
158 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
159         ${INSTALL_DATA} $? $@
160
161 # Pthread Targets
162
163 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
164 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
165 CFLAGS_evp.o=-DHAVE_CONFIG_H
166
167 aes.o: ${UPSTREAM}/hcrypto/aes.c
168         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
169
170 bn.o: ${UPSTREAM}/hcrypto/bn.c
171         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
172
173 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
174         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
175
176 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
177         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
178
179 des.o: ${UPSTREAM}/hcrypto/des.c
180         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
181         
182 evp.o: ${UPSTREAM}/hcrypto/evp.c
183         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
184         
185 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
186         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
187         
188 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
189         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
190
191 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
192         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
193
194 md2.o: ${UPSTREAM}/hcrypto/md2.c
195         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
196
197 md4.o: ${UPSTREAM}/hcrypto/md4.c
198         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
199
200 md5.o: ${UPSTREAM}/hcrypto/md5.c
201         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
202
203 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
204         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
205
206 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
207         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
208
209 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
210         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
211
212 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
213         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
214
215 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
216         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
217
218 rand.o: ${UPSTREAM}/hcrypto/rand.c
219         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
220
221 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
222         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
223
224 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
225         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
226
227 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
228         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
229
230 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
231         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
232
233 sha.o: ${UPSTREAM}/hcrypto/sha.c
234         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
235
236 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
237         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
238
239 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
240         ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
241
242 ui.o: ${UPSTREAM}/hcrypto/ui.c
243         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
244
245 validate.o: ${UPSTREAM}/hcrypto/validate.c
246         ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
247
248 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
249         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
250
251 #┬áThese bits of libroken are new functionality, rather than compatibility
252 # code. Where they should go eventually is unclear.
253
254 cloexec.o: ${UPSTREAM}/roken/cloexec.c
255         $(AFS_CCRULE) $(UPSTREAM)/roken/cloexec.c
256
257 ct.o: ${UPSTREAM}/roken/ct.c
258         $(AFS_CCRULE) $(UPSTREAM)/roken/ct.c
259
260 hex.o: ${UPSTREAM}/roken/hex.c
261         $(AFS_CCRULE) $(UPSTREAM)/roken/hex.c
262
263 issuid.o: ${UPSTREAM}/roken/issuid.c
264         $(AFS_CCRULE) $(UPSTREAM)/roken/issuid.c
265
266 net_read.o: ${UPSTREAM}/roken/net_read.c
267         $(AFS_CCRULE) $(UPSTREAM)/roken/net_read.c
268
269 net_write.o: ${UPSTREAM}/roken/net_write.c
270         $(AFS_CCRULE) $(UPSTREAM)/roken/net_write.c
271
272 # The upstream snprintf.c has some pointer warnings in it
273 CFLAGS_snprintf.o = @CFLAGS_NOERROR@
274
275 snprintf.o: ${UPSTREAM}/roken/snprintf.c
276         $(AFS_CCRULE) $(UPSTREAM)/roken/snprintf.c
277
278 # These bits of libroken are compatibility functions. They should get moved
279 # out into a new libroken top level target, which allows the use of an
280 # existing libroken, if one is available.
281
282
283 daemon.o: ${UPSTREAM}/roken/daemon.c
284         $(AFS_CCRULE) $(UPSTREAM)/roken/daemon.c
285
286 ecalloc.o: ${UPSTREAM}/roken/ecalloc.c
287         $(AFS_CCRULE) $(UPSTREAM)/roken/ecalloc.c
288
289 emalloc.o: ${UPSTREAM}/roken/emalloc.c
290         $(AFS_CCRULE) $(UPSTREAM)/roken/emalloc.c
291
292 erealloc.o: ${UPSTREAM}/roken/erealloc.c
293         $(AFS_CCRULE) $(UPSTREAM)/roken/erealloc.c
294
295 err.h: ${UPSTREAM}/roken/err.hin
296         cp $? $@
297
298 err.o: ${UPSTREAM}/roken/err.c
299         $(AFS_CCRULE) $(UPSTREAM)/roken/err.c
300
301 errx.o: ${UPSTREAM}/roken/errx.c
302         $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c
303
304 getopt.o: ${UPSTREAM}/roken/getopt.c
305         $(AFS_CCRULE) $(UPSTREAM)/roken/getopt.c
306
307 getprogname.o: ${UPSTREAM}/roken/getprogname.c
308         $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c
309
310 socket.o: ${UPSTREAM}/roken/socket.c
311         $(AFS_CCRULE) $(UPSTREAM)/roken/socket.c
312
313 strlcat.o: ${UPSTREAM}/roken/strlcat.c
314         $(AFS_CCRULE) $(UPSTREAM)/roken/strlcat.c
315
316 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
317         $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c
318
319 strnlen.o: ${UPSTREAM}/roken/strnlen.c
320         $(AFS_CCRULE) $(UPSTREAM)/roken/strnlen.c
321
322 verr.o: ${UPSTREAM}/roken/verr.c
323         $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c
324
325 verrx.o: ${UPSTREAM}/roken/verrx.c
326         $(AFS_CCRULE) $(UPSTREAM)/roken/verrx.c
327
328 vsyslog.o: ${UPSTREAM}/roken/vsyslog.c
329         $(AFS_CCRULE) $(UPSTREAM)/roken/vsyslog.c
330
331 vwarn.o: ${UPSTREAM}/roken/vwarn.c
332         $(AFS_CCRULE) $(UPSTREAM)/roken/vwarn.c
333
334 vwarnx.o: ${UPSTREAM}/roken/vwarnx.c
335         $(AFS_CCRULE) $(UPSTREAM)/roken/vwarnx.c
336
337 warn.o: ${UPSTREAM}/roken/warn.c
338         $(AFS_CCRULE) $(UPSTREAM)/roken/warn.c
339
340 warnerr.o: ${UPSTREAM}/roken/warnerr.c
341         $(AFS_CCRULE) $(UPSTREAM)/roken/warnerr.c
342
343 warnx.o: ${UPSTREAM}/roken/warnx.c
344         $(AFS_CCRULE) $(UPSTREAM)/roken/warnx.c
345
346 # LWP Targets
347
348 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
349         ${LWPRULE} -o rand-fortuna_lwp.o
350