1 # Copyright 2010, Your File System Inc
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
7 # API version. Must be incremented whenever something changes.
12 include @TOP_OBJDIR@/src/config/Makefile.config
13 include @TOP_OBJDIR@/src/config/Makefile.shared
16 INSTALL_DATA = @INSTALL_DATA@
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
34 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
36 MODULE_INCLUDE=-I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto
38 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
40 all: $(ROKEN_HEADERS) ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
41 ${TOP_LIBDIR}/libafshcrypto.a \
42 ${TOP_LIBDIR}/libafshcrypto_lwp.a
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
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
55 $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
56 test_cipher test_cipher.o hex.o
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 \
63 cloexec.o ct.o issuid.o net_read.o net_write.o warnerr.o
65 OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS)
67 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS)
69 LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
70 -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
72 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
73 ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
74 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
76 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
77 ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
78 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
81 libafshcrypto.a: ${OBJECTS}
83 $(AR) crv $@ ${OBJECTS}
86 libafshcrypto_lwp.a: $(LWP_OBJS)
88 $(AR) crv $@ $(LWP_OBJS)
91 test_cipher: test_cipher.o hex.o libafshcrypto.a
92 $(AFS_LDRULE) test_cipher.o hex.o libafshcrypto.a
94 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
97 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
100 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
101 ${INSTALL_DATA} $? $@
103 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
104 ${INSTALL_DATA} $? $@
106 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
107 ${INSTALL_DATA} $? $@
109 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
110 ${INSTALL_DATA} $? $@
112 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
113 ${INSTALL_DATA} $? $@
115 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
116 ${INSTALL_DATA} $? $@
118 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
119 ${INSTALL_DATA} $? $@
121 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
122 ${INSTALL_DATA} $? $@
124 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
125 ${INSTALL_DATA} $? $@
127 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
128 ${INSTALL_DATA} $? $@
130 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
131 ${INSTALL_DATA} $? $@
133 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
134 ${INSTALL_DATA} $? $@
136 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
137 ${INSTALL_DATA} $? $@
139 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
140 ${INSTALL_DATA} $? $@
142 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
143 ${INSTALL_DATA} $? $@
145 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
146 ${INSTALL_DATA} $? $@
148 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
149 ${INSTALL_DATA} $? $@
151 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
152 ${INSTALL_DATA} $? $@
154 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
155 ${INSTALL_DATA} $? $@
157 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
158 ${INSTALL_DATA} $? $@
162 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
163 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
164 CFLAGS_evp.o=-DHAVE_CONFIG_H
166 aes.o: ${UPSTREAM}/hcrypto/aes.c
167 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
169 bn.o: ${UPSTREAM}/hcrypto/bn.c
170 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
172 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
173 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
175 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
176 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
178 des.o: ${UPSTREAM}/hcrypto/des.c
179 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
181 evp.o: ${UPSTREAM}/hcrypto/evp.c
182 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
184 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
185 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
187 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
188 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
190 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
191 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
193 md2.o: ${UPSTREAM}/hcrypto/md2.c
194 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
196 md4.o: ${UPSTREAM}/hcrypto/md4.c
197 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
199 md5.o: ${UPSTREAM}/hcrypto/md5.c
200 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
202 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
203 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
205 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
206 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
208 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
209 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
211 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
212 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
214 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
215 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
217 rand.o: ${UPSTREAM}/hcrypto/rand.c
218 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
220 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
221 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
223 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
224 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
226 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
227 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
229 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
230 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
232 sha.o: ${UPSTREAM}/hcrypto/sha.c
233 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
235 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
236 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
238 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
239 ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
241 ui.o: ${UPSTREAM}/hcrypto/ui.c
242 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
244 validate.o: ${UPSTREAM}/hcrypto/validate.c
245 ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
247 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
248 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
250 # These bits of libroken are new functionality, rather than compatibility
251 # code. Where they should go eventually is unclear.
253 cloexec.o: ${UPSTREAM}/roken/cloexec.c
254 $(AFS_CCRULE) $(UPSTREAM)/roken/cloexec.c
256 ct.o: ${UPSTREAM}/roken/ct.c
257 $(AFS_CCRULE) $(UPSTREAM)/roken/ct.c
259 hex.o: ${UPSTREAM}/roken/hex.c
260 $(AFS_CCRULE) $(UPSTREAM)/roken/hex.c
262 issuid.o: ${UPSTREAM}/roken/issuid.c
263 $(AFS_CCRULE) $(UPSTREAM)/roken/issuid.c
265 net_read.o: ${UPSTREAM}/roken/net_read.c
266 $(AFS_CCRULE) $(UPSTREAM)/roken/net_read.c
268 net_write.o: ${UPSTREAM}/roken/net_write.c
269 $(AFS_CCRULE) $(UPSTREAM)/roken/net_write.c
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.
275 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
276 $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c
278 err.h: ${UPSTREAM}/roken/err.hin
281 err.o: ${UPSTREAM}/roken/err.c
282 $(AFS_CCRULE) $(UPSTREAM)/roken/err.c
284 errx.o: ${UPSTREAM}/roken/errx.c
285 $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c
288 getprogname.o: ${UPSTREAM}/roken/getprogname.c
289 $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c
292 verr.o: ${UPSTREAM}/roken/verr.c
293 $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c
296 verrx.o: ${UPSTREAM}/roken/verrx.c
297 $(AFS_CCRULE) $(UPSTREAM)/roken/verrx.c
300 vwarn.o: ${UPSTREAM}/roken/vwarn.c
301 $(AFS_CCRULE) $(UPSTREAM)/roken/vwarn.c
304 vwarnx.o: ${UPSTREAM}/roken/vwarnx.c
305 $(AFS_CCRULE) $(UPSTREAM)/roken/vwarnx.c
308 warn.o: ${UPSTREAM}/roken/warn.c
309 $(AFS_CCRULE) $(UPSTREAM)/roken/warn.c
312 warnerr.o: ${UPSTREAM}/roken/warnerr.c
313 $(AFS_CCRULE) $(UPSTREAM)/roken/warnerr.c
316 warnx.o: ${UPSTREAM}/roken/warnx.c
317 $(AFS_CCRULE) $(UPSTREAM)/roken/warnx.c
322 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
323 ${LWPRULE} -o rand-fortuna_lwp.o