use proper 64bit casting for pointer-math
[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 include @TOP_OBJDIR@/src/config/Makefile.shared
14
15 INSTALL = @INSTALL@
16 INSTALL_DATA = @INSTALL_DATA@
17
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
33
34 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
35
36 MODULE_INCLUDE=-I${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto 
37
38 SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
39
40 all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
41         ${TOP_LIBDIR}/libafshcrypto.a \
42         ${TOP_LIBDIR}/libafshcrypto_lwp.a
43
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
48
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
53
54 clean:
55         $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
56                  test_cipher test_cipher.o
57
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 \
62              validate.o
63
64 OBJECTS = $(COMMON_OBJS) rand-fortuna.o
65
66 LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
67
68 LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
69         -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
70
71 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
72         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
73                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
74
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}
79
80 libafshcrypto.a: ${OBJECTS}
81         $(RM) -f $@
82         $(AR) crv $@ ${OBJECTS}
83         $(RANLIB) $@
84
85 libafshcrypto_lwp.a: $(LWP_OBJS)
86         $(RM) -f $@
87         $(AR) crv $@ $(LWP_OBJS)
88         $(RANLIB) $@
89
90 test_cipher: test_cipher.o libafshcrypto.a
91         $(AFS_LDRULE) test_cipher.o libafshcrypto.a $(LIB_roken)
92
93 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
94         ${INSTALL_DATA} $? $@
95
96 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
97         ${INSTALL_DATA} $? $@
98
99 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
100         ${INSTALL_DATA} $? $@
101
102 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
103         ${INSTALL_DATA} $? $@
104
105 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
106         ${INSTALL_DATA} $? $@
107
108 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
109         ${INSTALL_DATA} $? $@
110
111 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
112         ${INSTALL_DATA} $? $@
113
114 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
115         ${INSTALL_DATA} $? $@
116
117 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
118         ${INSTALL_DATA} $? $@
119
120 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
121         ${INSTALL_DATA} $? $@
122
123 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
124         ${INSTALL_DATA} $? $@
125
126 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
127         ${INSTALL_DATA} $? $@
128
129 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
130         ${INSTALL_DATA} $? $@
131
132 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
133         ${INSTALL_DATA} $? $@
134
135 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
136         ${INSTALL_DATA} $? $@
137
138 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
139         ${INSTALL_DATA} $? $@
140
141 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
142         ${INSTALL_DATA} $? $@
143
144 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
145         ${INSTALL_DATA} $? $@
146
147 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
148         ${INSTALL_DATA} $? $@
149
150 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
151         ${INSTALL_DATA} $? $@
152
153 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
154         ${INSTALL_DATA} $? $@
155
156 ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a
157         ${INSTALL_DATA} $? $@
158
159 # Pthread Targets
160
161 CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/
162 CFLAGS_rand-unix.o=@CFLAGS_NOERROR@
163 CFLAGS_evp.o=-DHAVE_CONFIG_H
164
165 aes.o: ${UPSTREAM}/hcrypto/aes.c
166         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
167
168 bn.o: ${UPSTREAM}/hcrypto/bn.c
169         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
170
171 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
172         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
173
174 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
175         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
176
177 des.o: ${UPSTREAM}/hcrypto/des.c
178         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
179         
180 evp.o: ${UPSTREAM}/hcrypto/evp.c
181         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
182         
183 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
184         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
185         
186 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
187         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
188
189 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
190         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
191
192 md2.o: ${UPSTREAM}/hcrypto/md2.c
193         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
194
195 md4.o: ${UPSTREAM}/hcrypto/md4.c
196         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
197
198 md5.o: ${UPSTREAM}/hcrypto/md5.c
199         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
200
201 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
202         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
203
204 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
205         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
206
207 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
208         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
209
210 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
211         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
212
213 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
214         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
215
216 rand.o: ${UPSTREAM}/hcrypto/rand.c
217         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
218
219 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
220         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
221
222 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
223         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
224
225 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
226         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
227
228 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
229         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
230
231 sha.o: ${UPSTREAM}/hcrypto/sha.c
232         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
233
234 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
235         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
236
237 sha512.o: ${UPSTREAM}/hcrypto/sha512.c
238         ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
239
240 ui.o: ${UPSTREAM}/hcrypto/ui.c
241         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
242
243 validate.o: ${UPSTREAM}/hcrypto/validate.c
244         ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
245
246 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
247         $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
248
249 # LWP Targets
250
251 rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
252         ${LWPRULE} -o rand-fortuna_lwp.o
253