c27a69d5e1e47c05f969b77f03eea84efb6c87e7
[openssl.git] / crypto / Makefile.ssl
1 #
2 # SSLeay/crypto/Makefile
3 #
4
5 DIR=            crypto
6 TOP=            ..
7 CC=             cc
8 INCLUDE=        -I. -I../include
9 INCLUDES=       -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 MAKEDEPEND=     $(TOP)/util/domd $(TOP)
16 MAKEFILE=       Makefile.ssl
17 RM=             rm -f
18 AR=             ar r
19
20 PEX_LIBS=
21 EX_LIBS=
22  
23 CFLAGS= $(INCLUDE) $(CFLAG)
24
25
26 LIBS=
27
28 SDIRS=  md2 md5 sha mdc2 hmac ripemd \
29         des rc2 rc4 rc5 idea bf cast \
30         bn rsa dsa dh \
31         buffer bio stack lhash rand err objects \
32         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
33
34 GENERAL=Makefile README crypto-lib.com install.com
35
36 LIB= $(TOP)/libcrypto.a
37 LIBSRC= cryptlib.c mem.c cversion.c ex_data.c tmdiff.c cpt_err.c
38 LIBOBJ= cryptlib.o mem.o cversion.o ex_data.o tmdiff.o cpt_err.o
39
40 SRC= $(LIBSRC)
41
42 EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h
43 HEADER= cryptlib.h buildinf.h $(EXHEADER)
44
45 ALL=    $(GENERAL) $(SRC) $(HEADER)
46
47 top:
48         @(cd ..; $(MAKE) DIRS=$(DIR) all)
49
50 all: buildinf.h lib subdirs
51
52 buildinf.h: ../Makefile.ssl
53         ( echo "/* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
54         echo "/* (mk1mf builds use mk1mfinf.h instead) */"; \
55         echo "#define CFLAGS \"$(CC) $(CFLAG)\""; \
56         echo "#define PLATFORM \"$(PLATFORM)\""; \
57         echo "#define DATE \"`date`\"" ) >buildinf.h
58
59 subdirs:
60         @for i in $(SDIRS) ;\
61         do \
62         (cd $$i && echo "making all in crypto/$$i..." && \
63         $(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; \
64         done;
65
66 files:
67         $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
68         @for i in $(SDIRS) ;\
69         do \
70         (cd $$i; echo "making 'files' in crypto/$$i..."; \
71         $(MAKE) PERL='${PERL}' files ); \
72         done;
73
74 links:
75         @$(TOP)/util/point.sh Makefile.ssl Makefile
76         @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
77         @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
78         @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
79         @$(TOP)/util/point.sh Makefile.ssl Makefile
80         @for i in $(SDIRS); do \
81         (cd $$i; echo "making links in crypto/$$i..."; \
82         $(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 ); \
83         done;
84
85 lib:    $(LIBOBJ)
86         $(AR) $(LIB) $(LIBOBJ)
87         $(RANLIB) $(LIB)
88         @touch lib
89
90 libs:
91         @for i in $(SDIRS) ;\
92         do \
93         (cd $$i; echo "making libs in crypto/$$i..."; \
94         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
95         done;
96
97 tests:
98         @for i in $(SDIRS) ;\
99         do \
100         (cd $$i; echo "making tests in crypto/$$i..."; \
101         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
102         done;
103
104 install:
105         @for i in $(EXHEADER) ;\
106         do \
107         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
108         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
109         done;
110         @for i in $(SDIRS) ;\
111         do \
112         (cd $$i; echo "making install in crypto/$$i..."; \
113         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}'  INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
114         done;
115
116 lint:
117         @for i in $(SDIRS) ;\
118         do \
119         (cd $$i; echo "making lint in crypto/$$i..."; \
120         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
121         done;
122
123 depend:
124         $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
125         @for i in $(SDIRS) ;\
126         do \
127         (cd $$i; echo "making depend in crypto/$$i..."; \
128         $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
129         done;
130
131 clean:
132         rm -f buildinf.h mk1mfinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
133         @for i in $(SDIRS) ;\
134         do \
135         (cd $$i; echo "making clean in crypto/$$i..."; \
136         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
137         done;
138
139 dclean:
140         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
141         mv -f Makefile.new $(MAKEFILE)
142         @for i in $(SDIRS) ;\
143         do \
144         (cd $$i; echo "making dclean in crypto/$$i..."; \
145         $(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
146         done;
147
148 # DO NOT DELETE THIS LINE -- make depend depends on it.
149
150 cpt_err.o: ../include/openssl/crypto.h ../include/openssl/err.h
151 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/stack.h
152 cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h
153 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
154 cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h
155 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
156 cryptlib.o: ../include/openssl/stack.h cryptlib.h
157 cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h
158 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
159 cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h
160 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
161 cversion.o: ../include/openssl/stack.h buildinf.h cryptlib.h
162 ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h
163 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
164 ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h
165 ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
166 ex_data.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
167 mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h
168 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
169 mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
170 mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
171 mem.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
172 tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h
173 tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
174 tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h
175 tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
176 tmdiff.o: ../include/openssl/stack.h ../include/openssl/tmdiff.h cryptlib.h