Add new function, EVP_MD_CTX_copy() to replace frequent use of memcpy.
[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=             /bin/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 ERR=crypto
24 ERRC=cpt_err
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 pem x509 x509v3 asn1 conf txt_db pkcs7 comp
33
34 GENERAL=Makefile README
35
36 LIB= $(TOP)/libcrypto.a
37 LIBSRC= cryptlib.c mem.c cversion.c ex_data.c tmdiff.c $(ERRC).c
38 LIBOBJ= cryptlib.o mem.o cversion.o ex_data.o tmdiff.o $(ERRC).o
39
40 SRC= $(LIBSRC)
41
42 EXHEADER= crypto.h cryptall.h tmdiff.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 $$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}' 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 $$i..."; \
67         $(MAKE) files ); \
68         done;
69
70 links:
71         /bin/rm -f Makefile 
72         $(TOP)/util/point.sh Makefile.ssl Makefile
73         $(TOP)/util/mklink.sh ../include $(HEADER)
74         $(TOP)/util/mklink.sh ../test $(TEST)
75         $(TOP)/util/mklink.sh ../apps $(APPS)
76         $(TOP)/util/point.sh Makefile.ssl Makefile
77         @for i in $(SDIRS) ;\
78         do \
79         (cd $$i; echo "making links in $$i..."; \
80         $(MAKE) links ); \
81         done;
82
83 lib:    $(LIBOBJ)
84         $(AR) $(LIB) $(LIBOBJ)
85         sh $(TOP)/util/ranlib.sh $(LIB)
86         @touch lib
87
88 libs:
89         @for i in $(SDIRS) ;\
90         do \
91         (cd $$i; echo "making libs in $$i..."; \
92         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
93         done;
94
95 tests:
96         @for i in $(SDIRS) ;\
97         do \
98         (cd $$i; echo "making tests in $$i..."; \
99         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
100         done;
101
102 install:
103         @for i in $(EXHEADER) ;\
104         do \
105         (cp $$i $(INSTALLTOP)/include/$$i; \
106         chmod 644 $(INSTALLTOP)/include/$$i ); \
107         done;
108         @for i in $(SDIRS) ;\
109         do \
110         (cd $$i; echo "making install in $$i..."; \
111         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
112         done;
113
114 lint:
115         @for i in $(SDIRS) ;\
116         do \
117         (cd $$i; echo "making lint in $$i..."; \
118         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
119         done;
120
121 depend:
122         $(MAKEDEPEND) $(INCLUDE) $(PROGS) $(LIBSRC)
123         @for i in $(SDIRS) ;\
124         do \
125         (cd $$i; echo "making depend in $$i..."; \
126         $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' depend ); \
127         done;
128
129 clean:
130         /bin/rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
131         @for i in $(SDIRS) ;\
132         do \
133         (cd $$i; echo "making clean in $$i..."; \
134         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
135         done;
136
137 dclean:
138         perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
139         mv -f Makefile.new $(MAKEFILE)
140         @for i in $(SDIRS) ;\
141         do \
142         (cd $$i; echo "making dclean in $$i..."; \
143         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
144         done;
145
146 errors: errgen $(ERRC).c
147
148 $(ERRC).c: $(ERR).err
149         perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h
150         perl err/err_genc.pl -s $(ERR).h $(ERRC).c
151
152 errgen:
153         perl ./err/err_code.pl -conf err/ssleay.ec *.c */*.c ../ssl/*.c ../rsaref/*.c
154         @for i in $(SDIRS) ;\
155         do \
156         (cd $$i; echo "making errors in $$i..."; \
157         $(MAKE) errors ); \
158         done;
159
160
161 # DO NOT DELETE THIS LINE -- make depend depends on it.
162
163 cpt_err.o: ../include/err.h ../include/stack.h crypto.h
164 cryptlib.o: ../include/bio.h ../include/buffer.h ../include/e_os.h
165 cryptlib.o: ../include/err.h ../include/stack.h cryptlib.h crypto.h date.h
166 cversion.o: ../include/bio.h ../include/buffer.h ../include/e_os.h
167 cversion.o: ../include/err.h ../include/stack.h cryptlib.h crypto.h date.h
168 ex_data.o: ../include/bio.h ../include/buffer.h ../include/e_os.h
169 ex_data.o: ../include/err.h ../include/lhash.h ../include/stack.h cryptlib.h
170 ex_data.o: crypto.h
171 mem.o: ../include/bio.h ../include/buffer.h ../include/e_os.h ../include/err.h
172 mem.o: ../include/lhash.h ../include/stack.h cryptlib.h crypto.h
173 tmdiff.o: ../include/bio.h ../include/buffer.h ../include/e_os.h
174 tmdiff.o: ../include/err.h ../include/stack.h cryptlib.h crypto.h tmdiff.h