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