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
15 INSTALL_DATA = @INSTALL_DATA@
18 CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} ${SHLIB_CFLAGS}
20 HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \
21 ${TOP_INCDIR}/hcrypto/des.h \
22 ${TOP_INCDIR}/hcrypto/engine.h \
23 ${TOP_INCDIR}/hcrypto/evp.h \
24 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h \
25 ${TOP_INCDIR}/hcrypto/evp-cc.h \
26 ${TOP_INCDIR}/hcrypto/hmac.h \
27 ${TOP_INCDIR}/hcrypto/md2.h \
28 ${TOP_INCDIR}/hcrypto/md4.h \
29 ${TOP_INCDIR}/hcrypto/md5.h \
30 ${TOP_INCDIR}/hcrypto/rand.h \
31 ${TOP_INCDIR}/hcrypto/rc2.h \
32 ${TOP_INCDIR}/hcrypto/rc4.h \
33 ${TOP_INCDIR}/hcrypto/sha.h \
34 ${TOP_INCDIR}/hcrypto/ui.h
36 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
38 all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} ${TOP_LIBDIR}/libafshcrypto.a
40 install: libafshcrypto.a ${SHLIBOBJ}
41 ${TOP_OBJDIR}/src/config/shlib-install -d ${DESTDIR}${libdir} \
42 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
43 ${INSTALL_DATA} libafshcrypto.a ${DESTDIR}${libdir}/libafshcrypto.a
45 dest: libafshcrypto.a ${SHLIBOBJ}
46 ${TOP_OBJDIR}/src/config/shlib-install -d ${DEST}/lib \
47 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
48 ${INSTALL_DATA} libafshcrypto.a ${DEST}/lib/libafshcrypto.a
51 $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
52 test_cipher test_cipher.o hex.o
54 # Ignore for now : rand-egd.o
56 OBJECTS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \
57 evp-hcrypto.o evp-cc.o hmac.o md2.o md4.o md5.o pkcs5.o \
58 rand-egd.o rand-fortuna.o rand-timer.o rand-unix.o rand.o \
59 rc2.o rc4.o rijndael-alg-fst.o rnd_keys.o sha.o sha256.o ui.o \
60 cloexec.o ct.o issuid.o net_read.o net_write.o strlcpy.o
62 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
64 CCRULE = ${CC} -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
66 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
67 ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
68 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
70 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
71 ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
72 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
75 libafshcrypto.a: ${OBJECTS}
77 $(AR) crv $@ ${OBJECTS}
80 test_cipher: test_cipher.o hex.o libafshcrypto.a
81 ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
83 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
86 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
89 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
92 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
95 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
98 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
101 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
102 ${INSTALL_DATA} $? $@
104 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
105 ${INSTALL_DATA} $? $@
107 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
108 ${INSTALL_DATA} $? $@
110 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
111 ${INSTALL_DATA} $? $@
113 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
114 ${INSTALL_DATA} $? $@
116 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
117 ${INSTALL_DATA} $? $@
119 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
120 ${INSTALL_DATA} $? $@
122 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
123 ${INSTALL_DATA} $? $@
125 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
126 ${INSTALL_DATA} $? $@
128 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
129 ${INSTALL_DATA} $? $@
131 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
132 ${INSTALL_DATA} $? $@
134 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
135 ${INSTALL_DATA} $? $@
137 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
138 ${INSTALL_DATA} $? $@
140 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
141 ${INSTALL_DATA} $? $@
143 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
144 ${INSTALL_DATA} $? $@
146 aes.o: ${UPSTREAM}/hcrypto/aes.c
149 bn.o: ${UPSTREAM}/hcrypto/bn.c
152 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
155 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
158 des.o: ${UPSTREAM}/hcrypto/des.c
161 dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
164 dsa.o: ${UPSTREAM}/hcrypto/dsa.c
167 evp.o: ${UPSTREAM}/hcrypto/evp.c
170 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
173 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
179 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
182 md2.o: ${UPSTREAM}/hcrypto/md2.c
185 md4.o: ${UPSTREAM}/hcrypto/md4.c
188 md5.o: ${UPSTREAM}/hcrypto/md5.c
191 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
194 pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
197 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
200 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
203 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
206 # The upstream code has a const pointer warning, which we need to suppress */
207 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
208 ${CCRULE} @CFLAGS_NOERROR@
210 rand.o: ${UPSTREAM}/hcrypto/rand.c
213 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
216 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
219 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
222 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
225 rsa.o: ${UPSTREAM}/hcrypto/rsa.c
228 rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
231 rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
234 sha.o: ${UPSTREAM}/hcrypto/sha.c
237 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
240 ui.o: ${UPSTREAM}/hcrypto/ui.c
243 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
244 ${CCRULE} -I${UPSTREAM}/roken/
246 cloexec.o: ${UPSTREAM}/roken/cloexec.c
249 ct.o: ${UPSTREAM}/roken/ct.c
252 hex.o: ${UPSTREAM}/roken/hex.c
255 issuid.o: ${UPSTREAM}/roken/issuid.c
258 net_read.o: ${UPSTREAM}/roken/net_read.c
261 net_write.o: ${UPSTREAM}/roken/net_write.c
264 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c