]>
Commit | Line | Data |
---|---|---|
d02b48c6 RE |
1 | # |
2 | # SSLeay/crypto/Makefile | |
3 | # | |
4 | ||
5 | DIR= crypto | |
6 | TOP= .. | |
7 | CC= cc | |
41d2a336 | 8 | INCLUDE= -I. -I$(TOP) -I../include |
7abbffc3 | 9 | # INCLUDES targets sudbirs! |
41d2a336 | 10 | INCLUDES= -I.. -I../.. -I../../include |
d02b48c6 | 11 | CFLAG= -g |
cf1b7d96 RL |
12 | MAKEDEPPROG= makedepend |
13 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | |
42ba5d23 | 14 | MAKEFILE= Makefile |
bb8f3c58 | 15 | RM= rm -f |
d02b48c6 RE |
16 | AR= ar r |
17 | ||
d02b48c6 RE |
18 | PEX_LIBS= |
19 | EX_LIBS= | |
20 | ||
664b9985 | 21 | CFLAGS= $(INCLUDE) $(CFLAG) |
14e21f86 | 22 | ASFLAGS= $(INCLUDE) $(ASFLAG) |
16760a30 | 23 | AFLAGS=$(ASFLAGS) |
58964a49 | 24 | |
d02b48c6 RE |
25 | LIBS= |
26 | ||
d87b79bf RL |
27 | SDIRS= objects \ |
28 | md2 md4 md5 sha mdc2 hmac ripemd \ | |
58964a49 | 29 | des rc2 rc4 rc5 idea bf cast \ |
e172d60d | 30 | bn ec rsa dsa ecdsa ecdh dh dso engine aes \ |
d87b79bf | 31 | buffer bio stack lhash rand err \ |
a5db6fa5 | 32 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ |
36d16f8e | 33 | store pqueue |
d02b48c6 | 34 | |
7d7d2cbc | 35 | GENERAL=Makefile README crypto-lib.com install.com |
d02b48c6 RE |
36 | |
37 | LIB= $(TOP)/libcrypto.a | |
a7b42009 | 38 | SHARED_LIB= libcrypto$(SHLIB_EXT) |
a2400fca | 39 | LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c |
14e21f86 | 40 | LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ) |
d02b48c6 RE |
41 | |
42 | SRC= $(LIBSRC) | |
43 | ||
d66ace9d | 44 | EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ |
114697be | 45 | ossl_typ.h |
a2400fca | 46 | HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER) |
d02b48c6 RE |
47 | |
48 | ALL= $(GENERAL) $(SRC) $(HEADER) | |
49 | ||
50 | top: | |
51 | @(cd ..; $(MAKE) DIRS=$(DIR) all) | |
52 | ||
919f8bcd | 53 | all: shared |
d02b48c6 | 54 | |
fe977f75 BL |
55 | BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \ |
56 | CC='${CC}' CFLAG='${CFLAG}' \ | |
57 | AS='${CC}' ASFLAG='${CFLAG} -c' \ | |
58 | AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}' \ | |
59 | SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/lib' \ | |
60 | INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' \ | |
61 | MAKEDEPEND='$$(TOP)/util/domd $$(TOP) -MD $(MAKEDEPPROG)'\ | |
62 | DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}' \ | |
63 | MAKEDEPPROG='${MAKEDEPPROG}' \ | |
64 | LDFLAGS="$(LDFLAGS)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ | |
65 | KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' \ | |
66 | EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' \ | |
67 | SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \ | |
68 | PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' \ | |
69 | CPUID_OBJ='${CPUID_OBJ}' \ | |
70 | BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' \ | |
71 | AES_ASM_OBJ='${AES_ASM_OBJ}' \ | |
72 | BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' \ | |
73 | RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' \ | |
74 | SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \ | |
75 | MD5_ASM_OBJ='${MD5_ASM_OBJ}' \ | |
76 | RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \ | |
77 | THIS=$${THIS:-$@} | |
78 | ||
42ba5d23 | 79 | buildinf.h: ../Makefile |
57119943 | 80 | ( echo "#ifndef MK1MF_BUILD"; \ |
42ba5d23 | 81 | echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \ |
1ed0c662 RL |
82 | echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \ |
83 | echo ' #define PLATFORM "$(PLATFORM)"'; \ | |
294bd1e2 | 84 | echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \ |
1ed0c662 | 85 | echo '#endif' ) >buildinf.h |
d02b48c6 | 86 | |
14e21f86 AP |
87 | x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl |
88 | $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@ | |
ec38ddc7 AP |
89 | x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl |
90 | $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@ | |
16760a30 AP |
91 | x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl |
92 | $(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@ | |
ec38ddc7 | 93 | |
51ff6bde AP |
94 | uplink.o: ../ms/uplink.c |
95 | $(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c | |
96 | ||
97 | uplink-cof.s: ../ms/uplink.pl | |
98 | $(PERL) ../ms/uplink.pl coff > $@ | |
99 | ||
5f1841cd AP |
100 | x86_64cpuid.s: x86_64cpuid.pl |
101 | $(PERL) x86_64cpuid.pl $@ | |
14e21f86 AP |
102 | ia64cpuid.s: ia64cpuid.S |
103 | $(CC) $(CFLAGS) -E ia64cpuid.S > $@ | |
104 | ||
b357e95c | 105 | testapps: |
734540f8 AP |
106 | [ -z "$(THIS)" ] || ( if echo ${SDIRS} | fgrep ' des '; \ |
107 | then cd des && $(MAKE) des; fi ) | |
108 | [ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) testapps ); | |
7abbffc3 | 109 | @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi |
b357e95c | 110 | |
d02b48c6 RE |
111 | subdirs: |
112 | @for i in $(SDIRS) ;\ | |
113 | do \ | |
bb8f3c58 | 114 | (cd $$i && echo "making all in crypto/$$i..." && \ |
fe977f75 | 115 | $(MAKE) $(BUILDENV) INCLUDES='${INCLUDES}' all ) || exit 1; \ |
d02b48c6 RE |
116 | done; |
117 | ||
118 | files: | |
42ba5d23 | 119 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
d02b48c6 RE |
120 | @for i in $(SDIRS) ;\ |
121 | do \ | |
b28ec124 | 122 | (cd $$i && echo "making 'files' in crypto/$$i..." && \ |
7abbffc3 | 123 | $(MAKE) files ); \ |
d02b48c6 RE |
124 | done; |
125 | ||
126 | links: | |
1314c344 BM |
127 | @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER) |
128 | @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST) | |
129 | @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS) | |
bb8f3c58 | 130 | @for i in $(SDIRS); do \ |
734540f8 AP |
131 | (cd $$i && echo "making links in crypto/$$i..." && \ |
132 | $(MAKE) links ); \ | |
d02b48c6 RE |
133 | done; |
134 | ||
135 | lib: $(LIBOBJ) | |
136 | $(AR) $(LIB) $(LIBOBJ) | |
4e20b1a6 | 137 | $(RANLIB) $(LIB) || echo Never mind. |
d02b48c6 RE |
138 | @touch lib |
139 | ||
919f8bcd | 140 | shared: buildinf.h lib subdirs |
a7b42009 | 141 | if [ -n "$(SHARED_LIBS)" ]; then \ |
e70a3983 | 142 | (cd ..; $(MAKE) $(SHARED_LIB)); \ |
a7b42009 RL |
143 | fi |
144 | ||
d02b48c6 RE |
145 | libs: |
146 | @for i in $(SDIRS) ;\ | |
147 | do \ | |
b28ec124 | 148 | (cd $$i && echo "making libs in crypto/$$i..." && \ |
734540f8 | 149 | $(MAKE) lib ); |
d02b48c6 RE |
150 | done; |
151 | ||
152 | tests: | |
734540f8 | 153 | @[ -z "$(THIS)" ] || (for i in $(SDIRS) ;\ |
d02b48c6 | 154 | do \ |
b28ec124 | 155 | (cd $$i && echo "making tests in crypto/$$i..." && \ |
734540f8 AP |
156 | $(MAKE) tests ); \ |
157 | done; ) | |
7abbffc3 | 158 | @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi |
d02b48c6 RE |
159 | |
160 | install: | |
734540f8 | 161 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... |
a2ac429d | 162 | @headerlist="$(EXHEADER)"; for i in $$headerlist ;\ |
d02b48c6 | 163 | do \ |
e5f3045f BM |
164 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ |
165 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | |
d02b48c6 RE |
166 | done; |
167 | @for i in $(SDIRS) ;\ | |
168 | do \ | |
b28ec124 | 169 | (cd $$i && echo "making install in crypto/$$i..." && \ |
734540f8 | 170 | $(MAKE) install ); \ |
d02b48c6 RE |
171 | done; |
172 | ||
173 | lint: | |
174 | @for i in $(SDIRS) ;\ | |
175 | do \ | |
b28ec124 | 176 | (cd $$i && echo "making lint in crypto/$$i..." && \ |
734540f8 | 177 | $(MAKE) lint ); \ |
d02b48c6 RE |
178 | done; |
179 | ||
180 | depend: | |
7abbffc3 AP |
181 | [ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist |
182 | [ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | |
183 | [ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h | |
ce92b6eb AP |
184 | @[ -z "$(THIS)" ] || (set -e; \ |
185 | for i in $(SDIRS) ; do \ | |
186 | ( cd $$i && echo "making depend in crypto/$$i..." && \ | |
187 | $(MAKE) INCLUDES='${INCLUDES}' depend \ | |
188 | ); \ | |
189 | done; ) | |
7abbffc3 | 190 | @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi |
d02b48c6 RE |
191 | |
192 | clean: | |
14e21f86 | 193 | rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff |
d02b48c6 RE |
194 | @for i in $(SDIRS) ;\ |
195 | do \ | |
b28ec124 | 196 | (cd $$i && echo "making clean in crypto/$$i..." && \ |
734540f8 | 197 | $(MAKE) clean ); \ |
d02b48c6 RE |
198 | done; |
199 | ||
200 | dclean: | |
99aab161 | 201 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
d02b48c6 RE |
202 | mv -f Makefile.new $(MAKEFILE) |
203 | @for i in $(SDIRS) ;\ | |
204 | do \ | |
b28ec124 | 205 | (cd $$i && echo "making dclean in crypto/$$i..." && \ |
734540f8 | 206 | $(MAKE) dclean ); \ |
d02b48c6 RE |
207 | done; |
208 | ||
d02b48c6 | 209 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
6242bb9c | 210 | |
1c4f90a0 | 211 | cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h |
cf1b7d96 RL |
212 | cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h |
213 | cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | |
c57bc2dc GT |
214 | cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h |
215 | cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h | |
216 | cpt_err.o: ../include/openssl/symhacks.h cpt_err.c | |
41d2a336 RL |
217 | cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
218 | cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
219 | cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
220 | cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
221 | cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
222 | cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c | |
223 | cryptlib.o: cryptlib.h | |
41d2a336 RL |
224 | cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
225 | cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
226 | cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
227 | cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
228 | cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
229 | cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h | |
230 | cversion.o: cryptlib.h cversion.c | |
3aecef76 | 231 | ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c |
41d2a336 RL |
232 | ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
233 | ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
234 | ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
235 | ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
236 | ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
237 | ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | |
238 | ex_data.o: ex_data.c | |
41d2a336 RL |
239 | mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
240 | mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
241 | mem.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
242 | mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
243 | mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
244 | mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | |
245 | mem.o: mem.c | |
df29cc8f RL |
246 | mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
247 | mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
9c52d2cc GT |
248 | mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
249 | mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c | |
41d2a336 RL |
250 | mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
251 | mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
252 | mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
253 | mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
254 | mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
255 | mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | |
256 | mem_dbg.o: mem_dbg.c | |
a2400fca RL |
257 | o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
258 | o_dir.o: LPdir_unix.c o_dir.c o_dir.h | |
a7201e9a RL |
259 | o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
260 | o_str.o: o_str.c o_str.h | |
2b49dd1e RL |
261 | o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c |
262 | o_time.o: o_time.h | |
41d2a336 RL |
263 | tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
264 | tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | |
265 | tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h | |
266 | tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
c57bc2dc GT |
267 | tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
268 | tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | |
269 | tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c | |
cf1b7d96 RL |
270 | uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
271 | uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |
9c52d2cc GT |
272 | uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
273 | uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c |