10a2aeab06fe4bf70d0d3293fa9d3b22c239479e
[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} ${TOP_LIBDIR}/libafshcrypto.a
39
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
44
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
49
50 clean:
51         $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
52                  test_cipher test_cipher.o hex.o
53
54 # Ignore for now : rand-egd.o
55
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
61
62 UPSTREAM= ${TOP_SRCDIR}/external/heimdal
63
64 CCRULE = ${CC} -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
65
66 ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
67         ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \
68                 -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR}
69
70 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
71         ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
72                 -M ${LIBMAJOR} -m ${LIBMINOR} -- \
73                 ${OBJECTS} ${MT_LIBS}
74
75 libafshcrypto.a: ${OBJECTS}
76         $(RM) -f $@
77         $(AR) crv $@ ${OBJECTS}
78         $(RANLIB) $@
79
80 test_cipher: test_cipher.o hex.o libafshcrypto.a
81         ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
82
83 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
84         ${INSTALL_DATA} $? $@
85
86 ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h
87         ${INSTALL_DATA} $? $@
88
89 ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h
90         ${INSTALL_DATA} $? $@
91
92 ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h
93         ${INSTALL_DATA} $? $@
94
95 ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h
96         ${INSTALL_DATA} $? $@
97
98 ${TOP_INCDIR}/hcrypto/engine.h: engine.h
99         ${INSTALL_DATA} $? $@
100
101 ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h
102         ${INSTALL_DATA} $? $@
103
104 ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h
105         ${INSTALL_DATA} $? $@
106
107 ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h
108         ${INSTALL_DATA} $? $@
109
110 ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h
111         ${INSTALL_DATA} $? $@
112
113 ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h
114         ${INSTALL_DATA} $? $@
115
116 ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h
117         ${INSTALL_DATA} $? $@
118
119 ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h
120         ${INSTALL_DATA} $? $@
121
122 ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h
123         ${INSTALL_DATA} $? $@
124
125 ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h
126         ${INSTALL_DATA} $? $@
127
128 ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h
129         ${INSTALL_DATA} $? $@
130
131 ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h
132         ${INSTALL_DATA} $? $@
133
134 ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h
135         ${INSTALL_DATA} $? $@
136
137 ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h
138         ${INSTALL_DATA} $? $@
139
140 ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
141         ${INSTALL_DATA} $? $@
142
143 ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a
144         ${INSTALL_DATA} $? $@
145
146 aes.o: ${UPSTREAM}/hcrypto/aes.c
147         ${CCRULE}
148
149 bn.o: ${UPSTREAM}/hcrypto/bn.c
150         ${CCRULE}
151
152 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
153         ${CCRULE}
154
155 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
156         ${CCRULE}
157
158 des.o: ${UPSTREAM}/hcrypto/des.c
159         ${CCRULE}
160
161 dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
162         ${CCRULE}
163
164 dsa.o: ${UPSTREAM}/hcrypto/dsa.c
165         ${CCRULE}
166
167 evp.o: ${UPSTREAM}/hcrypto/evp.c
168         ${CCRULE}
169
170 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
171         ${CCRULE}
172
173 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
174         ${CCRULE}
175
176 engine.o: engine.c
177         ${CCRULE}
178
179 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
180         ${CCRULE}
181
182 md2.o: ${UPSTREAM}/hcrypto/md2.c
183         ${CCRULE}
184
185 md4.o: ${UPSTREAM}/hcrypto/md4.c
186         ${CCRULE}
187
188 md5.o: ${UPSTREAM}/hcrypto/md5.c
189         ${CCRULE}
190
191 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
192         ${CCRULE}
193
194 pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
195         ${CCRULE}
196
197 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
198         ${CCRULE}
199
200 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
201         ${CCRULE}
202
203 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
204         ${CCRULE}
205
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@
209
210 rand.o: ${UPSTREAM}/hcrypto/rand.c
211         ${CCRULE}
212
213 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
214         ${CCRULE}
215
216 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
217         ${CCRULE}
218
219 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
220         ${CCRULE}
221
222 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
223         ${CCRULE}
224
225 rsa.o: ${UPSTREAM}/hcrypto/rsa.c
226         ${CCRULE}
227
228 rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
229         ${CCRULE}
230
231 rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
232         ${CCRULE}
233
234 sha.o: ${UPSTREAM}/hcrypto/sha.c
235         ${CCRULE}
236
237 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
238         ${CCRULE}
239
240 ui.o: ${UPSTREAM}/hcrypto/ui.c
241         ${CCRULE}
242
243 test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
244         ${CCRULE} -I${UPSTREAM}/roken/
245
246 cloexec.o: ${UPSTREAM}/roken/cloexec.c
247         ${CCRULE}
248
249 ct.o: ${UPSTREAM}/roken/ct.c
250         ${CCRULE}
251
252 hex.o: ${UPSTREAM}/roken/hex.c
253         ${CCRULE}
254
255 issuid.o: ${UPSTREAM}/roken/issuid.c
256         ${CCRULE}
257
258 net_read.o: ${UPSTREAM}/roken/net_read.c
259         ${CCRULE}
260
261 net_write.o: ${UPSTREAM}/roken/net_write.c
262         ${CCRULE}
263
264 strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
265         ${CCRULE}