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${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto
38 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
40 all: ${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
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 \
64 OBJECTS = $(COMMON_OBJS) rand-fortuna.o
66 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
68 LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
69 -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
71 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
72 ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
73 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
75 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
76 ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
77 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
78 ${OBJECTS} -L$(TOP_LIBDIR) -lrokenafs ${MT_LIBS}
80 libafshcrypto.a: ${OBJECTS}
82 $(AR) crv $@ ${OBJECTS}
85 libafshcrypto_lwp.a: $(LWP_OBJS)
87 $(AR) crv $@ $(LWP_OBJS)
90 test_cipher: test_cipher.o libafshcrypto.a
91 $(AFS_LDRULE) test_cipher.o libafshcrypto.a $(LIB_roken)
93 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
96 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
99 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
100 ${INSTALL_DATA} $? $@
102 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
103 ${INSTALL_DATA} $? $@
105 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
106 ${INSTALL_DATA} $? $@
108 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
109 ${INSTALL_DATA} $? $@
111 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
112 ${INSTALL_DATA} $? $@
114 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
115 ${INSTALL_DATA} $? $@
117 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
118 ${INSTALL_DATA} $? $@
120 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
121 ${INSTALL_DATA} $? $@
123 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
124 ${INSTALL_DATA} $? $@
126 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
127 ${INSTALL_DATA} $? $@
129 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
130 ${INSTALL_DATA} $? $@
132 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
133 ${INSTALL_DATA} $? $@
135 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
136 ${INSTALL_DATA} $? $@
138 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
139 ${INSTALL_DATA} $? $@
141 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
142 ${INSTALL_DATA} $? $@
144 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
145 ${INSTALL_DATA} $? $@
147 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
148 ${INSTALL_DATA} $? $@
150 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
151 ${INSTALL_DATA} $? $@
153 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
154 ${INSTALL_DATA} $? $@
156 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
157 ${INSTALL_DATA} $? $@
161 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
162 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
163 CFLAGS_evp.o=-DHAVE_CONFIG_H
165 aes.o: ${UPSTREAM}/hcrypto/aes.c
166 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
168 bn.o: ${UPSTREAM}/hcrypto/bn.c
169 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
171 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
172 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
174 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
175 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
177 des.o: ${UPSTREAM}/hcrypto/des.c
178 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
180 evp.o: ${UPSTREAM}/hcrypto/evp.c
181 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
183 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
184 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
186 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
187 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
189 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
190 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
192 md2.o: ${UPSTREAM}/hcrypto/md2.c
193 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
195 md4.o: ${UPSTREAM}/hcrypto/md4.c
196 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
198 md5.o: ${UPSTREAM}/hcrypto/md5.c
199 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
201 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
202 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
204 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
205 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
207 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
208 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
210 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
211 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
213 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
214 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
216 rand.o: ${UPSTREAM}/hcrypto/rand.c
217 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
219 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
220 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
222 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
223 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
225 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
226 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
228 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
229 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
231 sha.o: ${UPSTREAM}/hcrypto/sha.c
232 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
234 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
235 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
237 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
238 ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
240 ui.o: ${UPSTREAM}/hcrypto/ui.c
241 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
243 validate.o: ${UPSTREAM}/hcrypto/validate.c
244 ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
246 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
247 $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
251 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
252 ${LWPRULE} -o rand-fortuna_lwp.o