]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/Makefile
Consolidate BUILDENV [idea is to keep all variables in one place].
[thirdparty/openssl.git] / crypto / Makefile
CommitLineData
d02b48c6
RE
1#
2# SSLeay/crypto/Makefile
3#
4
5DIR= crypto
6TOP= ..
7CC= cc
41d2a336
RL
8INCLUDE= -I. -I$(TOP) -I../include
9INCLUDES= -I.. -I../.. -I../../include
d02b48c6 10CFLAG= -g
cf1b7d96
RL
11MAKEDEPPROG= makedepend
12MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
42ba5d23 13MAKEFILE= Makefile
bb8f3c58 14RM= rm -f
d02b48c6
RE
15AR= ar r
16
d02b48c6
RE
17PEX_LIBS=
18EX_LIBS=
19
664b9985 20CFLAGS= $(INCLUDE) $(CFLAG)
14e21f86 21ASFLAGS= $(INCLUDE) $(ASFLAG)
16760a30 22AFLAGS=$(ASFLAGS)
58964a49 23
d02b48c6
RE
24LIBS=
25
d87b79bf
RL
26SDIRS= 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 34GENERAL=Makefile README crypto-lib.com install.com
d02b48c6
RE
35
36LIB= $(TOP)/libcrypto.a
a7b42009 37SHARED_LIB= libcrypto$(SHLIB_EXT)
a2400fca 38LIBSRC= 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 39LIBOBJ= 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
41SRC= $(LIBSRC)
42
d66ace9d 43EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
114697be 44 ossl_typ.h
a2400fca 45HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
d02b48c6
RE
46
47ALL= $(GENERAL) $(SRC) $(HEADER)
48
49top:
50 @(cd ..; $(MAKE) DIRS=$(DIR) all)
51
919f8bcd 52all: shared
d02b48c6 53
42ba5d23 54buildinf.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
62x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
63 $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
ec38ddc7
AP
64x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
65 $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
16760a30
AP
66x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
67 $(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
ec38ddc7 68
5f1841cd
AP
69x86_64cpuid.s: x86_64cpuid.pl
70 $(PERL) x86_64cpuid.pl $@
14e21f86
AP
71ia64cpuid.s: ia64cpuid.S
72 $(CC) $(CFLAGS) -E ia64cpuid.S > $@
73
b357e95c 74testapps:
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
80subdirs:
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
87files:
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
95links:
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
104lib: $(LIBOBJ)
105 $(AR) $(LIB) $(LIBOBJ)
4e20b1a6 106 $(RANLIB) $(LIB) || echo Never mind.
d02b48c6
RE
107 @touch lib
108
919f8bcd 109shared: buildinf.h lib subdirs
a7b42009 110 if [ -n "$(SHARED_LIBS)" ]; then \
e70a3983 111 (cd ..; $(MAKE) $(SHARED_LIB)); \
a7b42009
RL
112 fi
113
d02b48c6
RE
114libs:
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
121tests:
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
129install:
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
142lint:
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
149depend:
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
159clean:
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
167dclean:
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 178cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
cf1b7d96
RL
179cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
180cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
c57bc2dc
GT
181cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
182cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
183cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
41d2a336
RL
184cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
185cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
186cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
187cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
188cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
189cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
190cryptlib.o: cryptlib.h
41d2a336
RL
191cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
192cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
193cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
194cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
195cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
196cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
197cversion.o: cryptlib.h cversion.c
3aecef76 198ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
41d2a336
RL
199ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
200ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
201ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
202ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
203ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
204ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
205ex_data.o: ex_data.c
41d2a336
RL
206mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
207mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
208mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
209mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
210mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
211mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
212mem.o: mem.c
df29cc8f
RL
213mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
214mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
9c52d2cc
GT
215mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
216mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
41d2a336
RL
217mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
218mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
219mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
220mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
221mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
222mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
223mem_dbg.o: mem_dbg.c
a2400fca
RL
224o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
225o_dir.o: LPdir_unix.c o_dir.c o_dir.h
a7201e9a
RL
226o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
227o_str.o: o_str.c o_str.h
2b49dd1e
RL
228o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
229o_time.o: o_time.h
41d2a336
RL
230tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
231tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
232tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
233tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
c57bc2dc
GT
234tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
235tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
236tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
cf1b7d96
RL
237uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
238uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
9c52d2cc
GT
239uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
240uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c