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} \
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} libafshcrypto.a libafshcrypto.exp \
54 test_cipher test_cipher.o hex.o
56 COMMON_OBJS= 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-timer.o rand-unix.o rand.o rc2.o rc4.o \
59 rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \
61 cloexec.o ct.o issuid.o net_read.o net_write.o strlcpy.o
63 OBJECTS = $(COMMON_OBJS) rand-fortuna.o
65 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
67 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
69 CFLAGS=$(COMMON_CFLAGS) $(MT_CFLAGS) $(SHLIB_CFLAGS)
70 CCRULE = $(MT_CC) -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
72 LWPRULE=$(CC) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
73 -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
75 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
76 ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
77 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
79 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
80 ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
81 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
84 libafshcrypto.a: ${OBJECTS}
86 $(AR) crv $@ ${OBJECTS}
89 libafshcrypto_lwp.a: $(LWP_OBJS)
91 $(AR) crv $@ $(LWP_OBJS)
94 test_cipher: test_cipher.o hex.o libafshcrypto.a
95 ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
97 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
100 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
101 ${INSTALL_DATA} $? $@
103 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
104 ${INSTALL_DATA} $? $@
106 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
107 ${INSTALL_DATA} $? $@
109 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
110 ${INSTALL_DATA} $? $@
112 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
113 ${INSTALL_DATA} $? $@
115 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
116 ${INSTALL_DATA} $? $@
118 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
119 ${INSTALL_DATA} $? $@
121 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
122 ${INSTALL_DATA} $? $@
124 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
125 ${INSTALL_DATA} $? $@
127 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
128 ${INSTALL_DATA} $? $@
130 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
131 ${INSTALL_DATA} $? $@
133 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
134 ${INSTALL_DATA} $? $@
136 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
137 ${INSTALL_DATA} $? $@
139 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
140 ${INSTALL_DATA} $? $@
142 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
143 ${INSTALL_DATA} $? $@
145 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
146 ${INSTALL_DATA} $? $@
148 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
149 ${INSTALL_DATA} $? $@
151 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
152 ${INSTALL_DATA} $? $@
154 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
155 ${INSTALL_DATA} $? $@
157 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
158 ${INSTALL_DATA} $? $@
160 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
161 ${INSTALL_DATA} $? $@
164 aes.o: ${UPSTREAM}/hcrypto/aes.c
167 bn.o: ${UPSTREAM}/hcrypto/bn.c
170 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
173 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
176 des.o: ${UPSTREAM}/hcrypto/des.c
179 dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
182 dsa.o: ${UPSTREAM}/hcrypto/dsa.c
185 evp.o: ${UPSTREAM}/hcrypto/evp.c
186 ${CCRULE} -DHAVE_CONFIG_H
188 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
191 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
197 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
200 md2.o: ${UPSTREAM}/hcrypto/md2.c
203 md4.o: ${UPSTREAM}/hcrypto/md4.c
206 md5.o: ${UPSTREAM}/hcrypto/md5.c
209 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
212 pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
215 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
218 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
221 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
222 ${LWPRULE} -o rand-fortuna_lwp.o
224 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
227 # The upstream code has a const pointer warning, which we need to suppress */
228 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
229 ${CCRULE} @CFLAGS_NOERROR@
231 rand.o: ${UPSTREAM}/hcrypto/rand.c
234 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
237 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
240 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
243 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
246 rsa.o: ${UPSTREAM}/hcrypto/rsa.c
249 rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
252 rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
255 sha.o: ${UPSTREAM}/hcrypto/sha.c
258 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
261 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
264 ui.o: ${UPSTREAM}/hcrypto/ui.c
267 validate.o: ${UPSTREAM}/hcrypto/validate.c
270 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
271 ${CCRULE} -I${UPSTREAM}/roken/
273 cloexec.o: ${UPSTREAM}/roken/cloexec.c
276 ct.o: ${UPSTREAM}/roken/ct.c
279 hex.o: ${UPSTREAM}/roken/hex.c
282 issuid.o: ${UPSTREAM}/roken/issuid.c
285 net_read.o: ${UPSTREAM}/roken/net_read.c
288 net_write.o: ${UPSTREAM}/roken/net_write.c
291 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c