Add an LWP version of the hcrypto library
[openafs.git] / src / crypto / hcrypto / Makefile.in
1 # Copyright 2010, Your File System Inc
2 # All rights reserved
3 #
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
6
7 # API version. Must be incremented whenever something changes.
8 LIBMAJOR=1
9 LIBMINOR=1
10
11 srcdir=@srcdir@
12 include @TOP_OBJDIR@/src/config/Makefile.config
13
14 INSTALL = @INSTALL@
15 INSTALL_DATA = @INSTALL_DATA@
16
17 CC=${MT_CC}
18 CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} ${SHLIB_CFLAGS}
19
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
35
36 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
37
38 all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
39         ${TOP_LIBDIR}/libafshcrypto.a \
40         ${TOP_LIBDIR}/libafshcrypto_lwp.a
41
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
46
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
51
52 clean:
53         $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
54                  test_cipher test_cipher.o hex.o
55
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 \
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
61
62 OBJECTS = $(COMMON_OBJS) rand-fortuna.o
63
64 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
65
66 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
67
68 CFLAGS=$(COMMON_CFLAGS) $(MT_CFLAGS) $(SHLIB_CFLAGS)
69 CCRULE = $(MT_CC) -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
70
71 LWPRULE=$(CC) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
72         -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
73
74 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
75         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
76                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
77
78 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
79         ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
80                 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
81                 ${OBJECTS} ${MT_LIBS}
82
83 libafshcrypto.a: ${OBJECTS}
84         $(RM) -f $@
85         $(AR) crv $@ ${OBJECTS}
86         $(RANLIB) $@
87
88 libafshcrypto_lwp.a: $(LWP_OBJS)
89         $(RM) -f $@
90         $(AR) crv $@ $(LWP_OBJS)
91         $(RANLIB) $@
92
93 test_cipher: test_cipher.o hex.o libafshcrypto.a
94         ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
95
96 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
97         ${INSTALL_DATA} $? $@
98
99 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
100         ${INSTALL_DATA} $? $@
101
102 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
103         ${INSTALL_DATA} $? $@
104
105 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
106         ${INSTALL_DATA} $? $@
107
108 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
109         ${INSTALL_DATA} $? $@
110
111 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
112         ${INSTALL_DATA} $? $@
113
114 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
115         ${INSTALL_DATA} $? $@
116
117 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
118         ${INSTALL_DATA} $? $@
119
120 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
121         ${INSTALL_DATA} $? $@
122
123 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
124         ${INSTALL_DATA} $? $@
125
126 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
127         ${INSTALL_DATA} $? $@
128
129 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
130         ${INSTALL_DATA} $? $@
131
132 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
133         ${INSTALL_DATA} $? $@
134
135 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
136         ${INSTALL_DATA} $? $@
137
138 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
139         ${INSTALL_DATA} $? $@
140
141 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
142         ${INSTALL_DATA} $? $@
143
144 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
145         ${INSTALL_DATA} $? $@
146
147 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
148         ${INSTALL_DATA} $? $@
149
150 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
151         ${INSTALL_DATA} $? $@
152
153 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
154         ${INSTALL_DATA} $? $@
155
156 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
157         ${INSTALL_DATA} $? $@
158
159 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
160         ${INSTALL_DATA} $? $@
161
162
163 aes.o: ${UPSTREAM}/hcrypto/aes.c
164         ${CCRULE}
165
166 bn.o: ${UPSTREAM}/hcrypto/bn.c
167         ${CCRULE}
168
169 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
170         ${CCRULE}
171
172 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
173         ${CCRULE}
174
175 des.o: ${UPSTREAM}/hcrypto/des.c
176         ${CCRULE}
177
178 dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
179         ${CCRULE}
180
181 dsa.o: ${UPSTREAM}/hcrypto/dsa.c
182         ${CCRULE}
183
184 evp.o: ${UPSTREAM}/hcrypto/evp.c
185         ${CCRULE} -DHAVE_CONFIG_H
186
187 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
188         ${CCRULE}
189
190 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
191         ${CCRULE}
192
193 engine.o: engine.c
194         ${CCRULE}
195
196 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
197         ${CCRULE}
198
199 md2.o: ${UPSTREAM}/hcrypto/md2.c
200         ${CCRULE}
201
202 md4.o: ${UPSTREAM}/hcrypto/md4.c
203         ${CCRULE}
204
205 md5.o: ${UPSTREAM}/hcrypto/md5.c
206         ${CCRULE}
207
208 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
209         ${CCRULE}
210
211 pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
212         ${CCRULE}
213
214 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
215         ${CCRULE}
216
217 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
218         ${CCRULE}
219
220 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
221         ${LWPRULE} -o rand-fortuna_lwp.o
222
223 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
224         ${CCRULE}
225
226 # The upstream code has a const pointer warning, which we need to suppress */
227 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
228         ${CCRULE} @CFLAGS_NOERROR@
229
230 rand.o: ${UPSTREAM}/hcrypto/rand.c
231         ${CCRULE}
232
233 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
234         ${CCRULE}
235
236 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
237         ${CCRULE}
238
239 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
240         ${CCRULE}
241
242 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
243         ${CCRULE}
244
245 rsa.o: ${UPSTREAM}/hcrypto/rsa.c
246         ${CCRULE}
247
248 rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
249         ${CCRULE}
250
251 rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
252         ${CCRULE}
253
254 sha.o: ${UPSTREAM}/hcrypto/sha.c
255         ${CCRULE}
256
257 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
258         ${CCRULE}
259
260 ui.o: ${UPSTREAM}/hcrypto/ui.c
261         ${CCRULE}
262
263 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
264         ${CCRULE} -I${UPSTREAM}/roken/
265
266 cloexec.o: ${UPSTREAM}/roken/cloexec.c
267         ${CCRULE}
268
269 ct.o: ${UPSTREAM}/roken/ct.c
270         ${CCRULE}
271
272 hex.o: ${UPSTREAM}/roken/hex.c
273         ${CCRULE}
274
275 issuid.o: ${UPSTREAM}/roken/issuid.c
276         ${CCRULE}
277
278 net_read.o: ${UPSTREAM}/roken/net_read.c
279         ${CCRULE}
280
281 net_write.o: ${UPSTREAM}/roken/net_write.c
282         ${CCRULE}
283
284 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
285         ${CCRULE}