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