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