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