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 HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \
17 ${TOP_INCDIR}/hcrypto/des.h \
18 ${TOP_INCDIR}/hcrypto/engine.h \
19 ${TOP_INCDIR}/hcrypto/evp.h \
20 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h \
21 ${TOP_INCDIR}/hcrypto/evp-cc.h \
22 ${TOP_INCDIR}/hcrypto/hmac.h \
23 ${TOP_INCDIR}/hcrypto/md2.h \
24 ${TOP_INCDIR}/hcrypto/md4.h \
25 ${TOP_INCDIR}/hcrypto/md5.h \
26 ${TOP_INCDIR}/hcrypto/rand.h \
27 ${TOP_INCDIR}/hcrypto/rc2.h \
28 ${TOP_INCDIR}/hcrypto/rc4.h \
29 ${TOP_INCDIR}/hcrypto/sha.h \
30 ${TOP_INCDIR}/hcrypto/ui.h
32 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
34 MODULE_INCLUDE=-I${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto
36 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
38 all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
39 ${TOP_LIBDIR}/libafshcrypto.a \
40 ${TOP_LIBDIR}/libafshcrypto_lwp.a
42 install: libafshcrypto.a ${SHLIBOBJ}
43 ${TOP_OBJDIR}/src/config/shlib-install -d ${DESTDIR}${libdir} \
44 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
45 ${INSTALL_DATA} libafshcrypto.a ${DESTDIR}${libdir}/libafshcrypto.a
47 dest: libafshcrypto.a ${SHLIBOBJ}
48 ${TOP_OBJDIR}/src/config/shlib-install -d ${DEST}/lib \
49 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
50 ${INSTALL_DATA} libafshcrypto.a ${DEST}/lib/libafshcrypto.a
53 $(RM) -f ${OBJECTS} ${SHLIBOBJ} rand-fortuna_lwp.o \
54 libafshcrypto.a libafshcrypto_lwp.a libafshcrypto.exp \
55 test_cipher test_cipher.o
57 COMMON_OBJS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \
58 evp-hcrypto.o evp-cc.o hmac.o md2.o md4.o md5.o pkcs5.o \
59 rand-egd.o rand-timer.o rand-unix.o rand.o rc2.o rc4.o \
60 rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \
63 OBJECTS = $(COMMON_OBJS) rand-fortuna.o
65 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
67 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
68 ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
69 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
71 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
72 ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
73 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
74 ${OBJECTS} $(LDFLAGS_roken) $(LIB_roken) ${MT_LIBS}
76 libafshcrypto.a: ${OBJECTS}
78 $(AR) crv $@ ${OBJECTS}
81 libafshcrypto_lwp.a: $(LWP_OBJS)
83 $(AR) crv $@ $(LWP_OBJS)
86 test_cipher: test_cipher.o libafshcrypto.a
87 $(AFS_LDRULE) test_cipher.o libafshcrypto.a $(LIB_roken)
89 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
92 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
95 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
98 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
101 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
102 ${INSTALL_DATA} $? $@
104 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
105 ${INSTALL_DATA} $? $@
107 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
108 ${INSTALL_DATA} $? $@
110 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
111 ${INSTALL_DATA} $? $@
113 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
114 ${INSTALL_DATA} $? $@
116 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
117 ${INSTALL_DATA} $? $@
119 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
120 ${INSTALL_DATA} $? $@
122 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
123 ${INSTALL_DATA} $? $@
125 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
126 ${INSTALL_DATA} $? $@
128 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
129 ${INSTALL_DATA} $? $@
131 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
132 ${INSTALL_DATA} $? $@
134 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
135 ${INSTALL_DATA} $? $@
137 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
138 ${INSTALL_DATA} $? $@
140 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
141 ${INSTALL_DATA} $? $@
143 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
144 ${INSTALL_DATA} $? $@
146 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
147 ${INSTALL_DATA} $? $@
149 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
150 ${INSTALL_DATA} $? $@
152 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
153 ${INSTALL_DATA} $? $@
157 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
158 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
159 CFLAGS_evp.o=-DHAVE_CONFIG_H
161 aes.o: ${UPSTREAM}/hcrypto/aes.c
162 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
164 bn.o: ${UPSTREAM}/hcrypto/bn.c
165 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
167 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
168 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
170 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
171 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
173 des.o: ${UPSTREAM}/hcrypto/des.c
174 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
176 evp.o: ${UPSTREAM}/hcrypto/evp.c
177 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
179 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
180 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
182 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
183 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
185 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
186 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
188 md2.o: ${UPSTREAM}/hcrypto/md2.c
189 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
191 md4.o: ${UPSTREAM}/hcrypto/md4.c
192 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
194 md5.o: ${UPSTREAM}/hcrypto/md5.c
195 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
197 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
198 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
200 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
201 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
203 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
204 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
206 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
207 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
209 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
210 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
212 rand.o: ${UPSTREAM}/hcrypto/rand.c
213 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
215 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
216 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
218 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
219 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
221 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
222 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
224 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
225 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
227 sha.o: ${UPSTREAM}/hcrypto/sha.c
228 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
230 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
231 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
233 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
234 ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
236 ui.o: ${UPSTREAM}/hcrypto/ui.c
237 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
239 validate.o: ${UPSTREAM}/hcrypto/validate.c
240 ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
242 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
243 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
247 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
248 $(LWP_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c