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