hcrypto: Fix builds on Irix
[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: $(ROKEN_HEADERS) ${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 rc2.o rc4.o \
59              rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \
60              validate.o \
61              cloexec.o ct.o issuid.o net_read.o net_write.o warnerr.o
62
63 OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS)
64
65 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS)
66
67 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
68
69 CFLAGS=$(COMMON_CFLAGS) $(MT_CFLAGS) $(SHLIB_CFLAGS)
70 CCRULE = $(MT_CC) -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
71
72 LWPRULE=$(CC) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
73         -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
74
75 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
76         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
77                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
78
79 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
80         ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
81                 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
82                 ${OBJECTS} ${MT_LIBS}
83
84 libafshcrypto.a: ${OBJECTS}
85         $(RM) -f $@
86         $(AR) crv $@ ${OBJECTS}
87         $(RANLIB) $@
88
89 libafshcrypto_lwp.a: $(LWP_OBJS)
90         $(RM) -f $@
91         $(AR) crv $@ $(LWP_OBJS)
92         $(RANLIB) $@
93
94 test_cipher: test_cipher.o hex.o libafshcrypto.a
95         ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
96
97 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
98         ${INSTALL_DATA} $? $@
99
100 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
101         ${INSTALL_DATA} $? $@
102
103 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
104         ${INSTALL_DATA} $? $@
105
106 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
107         ${INSTALL_DATA} $? $@
108
109 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
110         ${INSTALL_DATA} $? $@
111
112 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
113         ${INSTALL_DATA} $? $@
114
115 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
116         ${INSTALL_DATA} $? $@
117
118 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
119         ${INSTALL_DATA} $? $@
120
121 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
122         ${INSTALL_DATA} $? $@
123
124 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
125         ${INSTALL_DATA} $? $@
126
127 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
128         ${INSTALL_DATA} $? $@
129
130 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
131         ${INSTALL_DATA} $? $@
132
133 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
134         ${INSTALL_DATA} $? $@
135
136 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
137         ${INSTALL_DATA} $? $@
138
139 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
140         ${INSTALL_DATA} $? $@
141
142 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
143         ${INSTALL_DATA} $? $@
144
145 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
146         ${INSTALL_DATA} $? $@
147
148 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
149         ${INSTALL_DATA} $? $@
150
151 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
152         ${INSTALL_DATA} $? $@
153
154 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
155         ${INSTALL_DATA} $? $@
156
157 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
158         ${INSTALL_DATA} $? $@
159
160 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
161         ${INSTALL_DATA} $? $@
162
163
164 aes.o: ${UPSTREAM}/hcrypto/aes.c
165         ${CCRULE}
166
167 bn.o: ${UPSTREAM}/hcrypto/bn.c
168         ${CCRULE}
169
170 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
171         ${CCRULE}
172
173 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
174         ${CCRULE}
175
176 des.o: ${UPSTREAM}/hcrypto/des.c
177         ${CCRULE}
178
179 dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
180         ${CCRULE}
181
182 dsa.o: ${UPSTREAM}/hcrypto/dsa.c
183         ${CCRULE}
184
185 evp.o: ${UPSTREAM}/hcrypto/evp.c
186         ${CCRULE} -DHAVE_CONFIG_H
187
188 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
189         ${CCRULE}
190
191 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
192         ${CCRULE}
193
194 engine.o: engine.c
195         ${CCRULE}
196
197 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
198         ${CCRULE}
199
200 md2.o: ${UPSTREAM}/hcrypto/md2.c
201         ${CCRULE}
202
203 md4.o: ${UPSTREAM}/hcrypto/md4.c
204         ${CCRULE}
205
206 md5.o: ${UPSTREAM}/hcrypto/md5.c
207         ${CCRULE}
208
209 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
210         ${CCRULE}
211
212 pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
213         ${CCRULE}
214
215 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
216         ${CCRULE}
217
218 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
219         ${CCRULE}
220
221 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
222         ${LWPRULE} -o rand-fortuna_lwp.o
223
224 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
225         ${CCRULE}
226
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@
230
231 rand.o: ${UPSTREAM}/hcrypto/rand.c
232         ${CCRULE}
233
234 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
235         ${CCRULE}
236
237 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
238         ${CCRULE}
239
240 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
241         ${CCRULE}
242
243 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
244         ${CCRULE}
245
246 rsa.o: ${UPSTREAM}/hcrypto/rsa.c
247         ${CCRULE}
248
249 rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
250         ${CCRULE}
251
252 rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
253         ${CCRULE}
254
255 sha.o: ${UPSTREAM}/hcrypto/sha.c
256         ${CCRULE}
257
258 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
259         ${CCRULE}
260
261 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
262         ${CCRULE}
263
264 ui.o: ${UPSTREAM}/hcrypto/ui.c
265         ${CCRULE}
266
267 validate.o: ${UPSTREAM}/hcrypto/validate.c
268         ${CCRULE}
269
270 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
271         ${CCRULE} -I${UPSTREAM}/roken/
272
273 #┬áThese bits of libroken are new functionality, rather than compatibility
274 # code. Where they should go eventually is unclear.
275
276 cloexec.o: ${UPSTREAM}/roken/cloexec.c
277         ${CCRULE}
278
279 ct.o: ${UPSTREAM}/roken/ct.c
280         ${CCRULE}
281
282 hex.o: ${UPSTREAM}/roken/hex.c
283         ${CCRULE}
284
285 issuid.o: ${UPSTREAM}/roken/issuid.c
286         ${CCRULE}
287
288 net_read.o: ${UPSTREAM}/roken/net_read.c
289         ${CCRULE}
290
291 net_write.o: ${UPSTREAM}/roken/net_write.c
292         ${CCRULE}
293
294 # These bits of libroken are compatibility functions. They should get moved
295 # out into a new libroken top level target, which allows the use of an
296 # existing libroken, if one is available.
297
298 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
299         ${CCRULE}
300
301 err.h: ${UPSTREAM}/roken/err.hin
302         cp $? $@
303
304 err.o: ${UPSTREAM}/roken/err.c
305         ${CCRULE}
306
307 errx.o: ${UPSTREAM}/roken/errx.c
308         ${CCRULE}
309
310 getprogname.o: ${UPSTREAM}/roken/getprogname.c
311         ${CCRULE}
312
313 verr.o: ${UPSTREAM}/roken/verr.c
314         ${CCRULE}
315
316 verrx.o: ${UPSTREAM}/roken/verrx.c
317         ${CCRULE}
318
319 vwarn.o: ${UPSTREAM}/roken/vwarn.c
320         ${CCRULE}
321
322 vwarnx.o: ${UPSTREAM}/roken/vwarnx.c
323         ${CCRULE}
324
325 warn.o: ${UPSTREAM}/roken/warn.c
326         ${CCRULE}
327
328 warnerr.o: ${UPSTREAM}/roken/warnerr.c
329         ${CCRULE}
330
331 warnx.o: ${UPSTREAM}/roken/warnx.c
332         ${CCRULE}