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