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