1fc3bd8e750d869e29f0e55f73e588b1813b415d
[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) -DCFLAGS="\"$(CC) $(CFLAG)\"" -DPLATFORM="\"$(PLATFORM)\""
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
43 HEADER= cryptlib.h date.h $(EXHEADER)
44
45 ALL=    $(GENERAL) $(SRC) $(HEADER)
46
47 top:
48         @(cd ..; $(MAKE) DIRS=$(DIR) all)
49
50 all: date.h lib subdirs
51
52 date.h: ../Makefile.ssl
53         echo "#define DATE \"`date`\"" >date.h
54
55 subdirs:
56         @for i in $(SDIRS) ;\
57         do \
58         (cd $$i && echo "making all in crypto/$$i..." && \
59         $(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; \
60         done;
61
62 files:
63         $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
64         @for i in $(SDIRS) ;\
65         do \
66         (cd $$i; echo "making 'files' in crypto/$$i..."; \
67         $(MAKE) PERL='${PERL}' files ); \
68         done;
69
70 links:
71         @$(TOP)/util/point.sh Makefile.ssl Makefile
72         @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
73         @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
74         @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
75         @$(TOP)/util/point.sh Makefile.ssl Makefile
76         @$(TOP)/util/point.sh ../e_os.h e_os.h
77         @for i in $(SDIRS); do \
78         (cd $$i; echo "making links in crypto/$$i..."; \
79         $(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 ); \
80         done;
81
82 lib:    $(LIBOBJ)
83         $(AR) $(LIB) $(LIBOBJ)
84         $(RANLIB) $(LIB)
85         @touch lib
86
87 libs:
88         @for i in $(SDIRS) ;\
89         do \
90         (cd $$i; echo "making libs in crypto/$$i..."; \
91         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
92         done;
93
94 tests:
95         @for i in $(SDIRS) ;\
96         do \
97         (cd $$i; echo "making tests in crypto/$$i..."; \
98         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
99         done;
100
101 install:
102         @for i in $(EXHEADER) ;\
103         do \
104         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
105         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
106         done;
107         @for i in $(SDIRS) ;\
108         do \
109         (cd $$i; echo "making install in crypto/$$i..."; \
110         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
111         done;
112
113 lint:
114         @for i in $(SDIRS) ;\
115         do \
116         (cd $$i; echo "making lint in crypto/$$i..."; \
117         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
118         done;
119
120 depend:
121         $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
122         @for i in $(SDIRS) ;\
123         do \
124         (cd $$i; echo "making depend in crypto/$$i..."; \
125         $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
126         done;
127
128 clean:
129         rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
130         @for i in $(SDIRS) ;\
131         do \
132         (cd $$i; echo "making clean in crypto/$$i..."; \
133         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
134         done;
135
136 dclean:
137         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
138         mv -f Makefile.new $(MAKEFILE)
139         @for i in $(SDIRS) ;\
140         do \
141         (cd $$i; echo "making dclean in crypto/$$i..."; \
142         $(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
143         done;
144
145 # DO NOT DELETE THIS LINE -- make depend depends on it.
146
147 cpt_err.o: ../include/openssl/crypto.h ../include/openssl/err.h
148 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/stack.h
149 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
150 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
151 cryptlib.o: ../include/openssl/err.h ../include/openssl/opensslconf.h
152 cryptlib.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
153 cryptlib.o: date.h
154 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
155 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
156 cversion.o: ../include/openssl/err.h ../include/openssl/opensslconf.h
157 cversion.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
158 cversion.o: date.h
159 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
160 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
161 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
162 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
163 ex_data.o: ../include/openssl/stack.h cryptlib.h
164 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
165 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
166 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
167 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
168 mem.o: ../include/openssl/stack.h cryptlib.h
169 tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
170 tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
171 tmdiff.o: ../include/openssl/err.h ../include/openssl/opensslconf.h
172 tmdiff.o: ../include/openssl/opensslv.h ../include/openssl/stack.h
173 tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h