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