]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/Makefile
Propagate BUILDENV into subdirectories.
[thirdparty/openssl.git] / crypto / Makefile
CommitLineData
d02b48c6
RE
1#
2# SSLeay/crypto/Makefile
3#
4
5DIR= crypto
6TOP= ..
7CC= cc
41d2a336 8INCLUDE= -I. -I$(TOP) -I../include
7abbffc3 9# INCLUDES targets sudbirs!
41d2a336 10INCLUDES= -I.. -I../.. -I../../include
d02b48c6 11CFLAG= -g
cf1b7d96
RL
12MAKEDEPPROG= makedepend
13MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
42ba5d23 14MAKEFILE= Makefile
bb8f3c58 15RM= rm -f
d02b48c6
RE
16AR= ar r
17
d02b48c6
RE
18PEX_LIBS=
19EX_LIBS=
20
664b9985 21CFLAGS= $(INCLUDE) $(CFLAG)
14e21f86 22ASFLAGS= $(INCLUDE) $(ASFLAG)
16760a30 23AFLAGS=$(ASFLAGS)
58964a49 24
d02b48c6
RE
25LIBS=
26
d87b79bf
RL
27SDIRS= 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 35GENERAL=Makefile README crypto-lib.com install.com
d02b48c6
RE
36
37LIB= $(TOP)/libcrypto.a
a7b42009 38SHARED_LIB= libcrypto$(SHLIB_EXT)
a2400fca 39LIBSRC= 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 40LIBOBJ= 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
42SRC= $(LIBSRC)
43
d66ace9d 44EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
114697be 45 ossl_typ.h
a2400fca 46HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
d02b48c6
RE
47
48ALL= $(GENERAL) $(SRC) $(HEADER)
49
50top:
51 @(cd ..; $(MAKE) DIRS=$(DIR) all)
52
919f8bcd 53all: shared
d02b48c6 54
fe977f75
BL
55BUILDENV= 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 79buildinf.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
87x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
88 $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
ec38ddc7
AP
89x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
90 $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
16760a30
AP
91x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
92 $(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
ec38ddc7 93
51ff6bde
AP
94uplink.o: ../ms/uplink.c
95 $(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
96
97uplink-cof.s: ../ms/uplink.pl
98 $(PERL) ../ms/uplink.pl coff > $@
99
5f1841cd
AP
100x86_64cpuid.s: x86_64cpuid.pl
101 $(PERL) x86_64cpuid.pl $@
14e21f86
AP
102ia64cpuid.s: ia64cpuid.S
103 $(CC) $(CFLAGS) -E ia64cpuid.S > $@
104
b357e95c 105testapps:
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
111subdirs:
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
118files:
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
126links:
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
135lib: $(LIBOBJ)
136 $(AR) $(LIB) $(LIBOBJ)
4e20b1a6 137 $(RANLIB) $(LIB) || echo Never mind.
d02b48c6
RE
138 @touch lib
139
919f8bcd 140shared: buildinf.h lib subdirs
a7b42009 141 if [ -n "$(SHARED_LIBS)" ]; then \
e70a3983 142 (cd ..; $(MAKE) $(SHARED_LIB)); \
a7b42009
RL
143 fi
144
d02b48c6
RE
145libs:
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
152tests:
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
160install:
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
173lint:
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
180depend:
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
192clean:
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
200dclean:
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 211cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
cf1b7d96
RL
212cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
213cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
c57bc2dc
GT
214cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
215cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
216cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
41d2a336
RL
217cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
218cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
219cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
220cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
221cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
222cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
223cryptlib.o: cryptlib.h
41d2a336
RL
224cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
225cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
226cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
227cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
228cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
229cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
230cversion.o: cryptlib.h cversion.c
3aecef76 231ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
41d2a336
RL
232ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
233ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
234ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
235ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
236ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
237ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
238ex_data.o: ex_data.c
41d2a336
RL
239mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
240mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
241mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
242mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
243mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
244mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
245mem.o: mem.c
df29cc8f
RL
246mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
247mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
9c52d2cc
GT
248mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
249mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
41d2a336
RL
250mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
251mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
252mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
253mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
254mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
255mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
256mem_dbg.o: mem_dbg.c
a2400fca
RL
257o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
258o_dir.o: LPdir_unix.c o_dir.c o_dir.h
a7201e9a
RL
259o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
260o_str.o: o_str.c o_str.h
2b49dd1e
RL
261o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
262o_time.o: o_time.h
41d2a336
RL
263tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
264tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
265tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
266tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
267tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
268tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
269tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
cf1b7d96
RL
270uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
271uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
9c52d2cc
GT
272uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
273uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c