enginetest needs 'memset' defined.
[openssl.git] / crypto / Makefile.ssl
1 #
2 # SSLeay/crypto/Makefile
3 #
4
5 DIR=            crypto
6 TOP=            ..
7 CC=             cc
8 INCLUDE=        -I. -I$(TOP) -I../include
9 INCLUDES=       -I.. -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 MAKEDEPPROG=    makedepend
16 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
17 MAKEFILE=       Makefile.ssl
18 RM=             rm -f
19 AR=             ar r
20
21 PEX_LIBS=
22 EX_LIBS=
23  
24 CFLAGS= $(INCLUDE) $(CFLAG)
25
26
27 LIBS=
28
29 SDIRS=  md2 md5 sha mdc2 hmac ripemd \
30         des rc2 rc4 rc5 idea bf cast \
31         bn ec rsa dsa dh dso engine rijndael \
32         buffer bio stack lhash rand err objects \
33         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui
34
35 GENERAL=Makefile README crypto-lib.com install.com
36
37 LIB= $(TOP)/libcrypto.a
38 LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c
39 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o
40
41 SRC= $(LIBSRC)
42
43 EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
44         types.h
45 HEADER= cryptlib.h buildinf.h md32_common.h o_time.h $(EXHEADER)
46
47 ALL=    $(GENERAL) $(SRC) $(HEADER)
48
49 top:
50         @(cd ..; $(MAKE) DIRS=$(DIR) all)
51
52 all: buildinf.h lib subdirs
53
54 buildinf.h: ../Makefile.ssl
55         ( echo "#ifndef MK1MF_BUILD"; \
56         echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
57         echo "  #define CFLAGS \"$(CC) $(CFLAG)\""; \
58         echo "  #define PLATFORM \"$(PLATFORM)\""; \
59         echo "  #define DATE \"`date`\""; \
60         echo "#endif" ) >buildinf.h
61
62 testapps:
63         if echo ${SDIRS} | fgrep ' des '; \
64         then cd des && $(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}' des; fi
65         cd pkcs7 && $(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}' testapps
66
67 subdirs:
68         @for i in $(SDIRS) ;\
69         do \
70         (cd $$i && echo "making all in crypto/$$i..." && \
71         $(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; \
72         done;
73
74 files:
75         $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
76         @for i in $(SDIRS) ;\
77         do \
78         (cd $$i && echo "making 'files' in crypto/$$i..." && \
79         $(MAKE) PERL='${PERL}' files ); \
80         done;
81
82 links:
83         @$(TOP)/util/point.sh Makefile.ssl Makefile
84         @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
85         @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
86         @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
87         @$(TOP)/util/point.sh Makefile.ssl Makefile
88         @for i in $(SDIRS); do \
89         (cd $$i && echo "making links in crypto/$$i..." && \
90         $(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 ); \
91         done;
92
93 lib:    $(LIBOBJ)
94         $(AR) $(LIB) $(LIBOBJ)
95         $(RANLIB) $(LIB) || echo Never mind.
96         @touch lib
97
98 libs:
99         @for i in $(SDIRS) ;\
100         do \
101         (cd $$i && echo "making libs in crypto/$$i..." && \
102         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
103         done;
104
105 tests:
106         @for i in $(SDIRS) ;\
107         do \
108         (cd $$i && echo "making tests in crypto/$$i..." && \
109         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
110         done;
111
112 install:
113         @for i in $(EXHEADER) ;\
114         do \
115         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
116         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
117         done;
118         @for i in $(SDIRS) ;\
119         do \
120         (cd $$i && echo "making install in crypto/$$i..." && \
121         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}'  INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
122         done;
123
124 lint:
125         @for i in $(SDIRS) ;\
126         do \
127         (cd $$i && echo "making lint in crypto/$$i..." && \
128         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
129         done;
130
131 depend:
132         if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
133         $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
134         if [ ! -s buildinf.h ]; then rm buildinf.h; fi
135         @for i in $(SDIRS) ;\
136         do \
137         (cd $$i && echo "making depend in crypto/$$i..." && \
138         $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
139         done;
140
141 clean:
142         rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
143         @for i in $(SDIRS) ;\
144         do \
145         (cd $$i && echo "making clean in crypto/$$i..." && \
146         $(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
147         done;
148
149 dclean:
150         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
151         mv -f Makefile.new $(MAKEFILE)
152         @for i in $(SDIRS) ;\
153         do \
154         (cd $$i && echo "making dclean in crypto/$$i..." && \
155         $(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
156         done;
157
158 # DO NOT DELETE THIS LINE -- make depend depends on it.
159
160 cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
161 cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
162 cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
163 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
164 cpt_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cpt_err.c
165 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
166 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
167 cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
168 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
169 cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h
170 cryptlib.o: ../include/openssl/symhacks.h cryptlib.c cryptlib.h
171 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
172 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
173 cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
174 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
175 cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
176 cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c
177 ebcdic.o: ../include/openssl/opensslconf.h ebcdic.c
178 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
179 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
180 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
181 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
182 ex_data.o: ../include/openssl/safestack.h ../include/openssl/stack.h
183 ex_data.o: ../include/openssl/symhacks.h cryptlib.h ex_data.c
184 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
185 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
186 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
187 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
188 mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h
189 mem.o: ../include/openssl/symhacks.h cryptlib.h mem.c
190 mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
191 mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
192 mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
193 mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
194 mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
195 mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
196 o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
197 o_time.o: o_time.h
198 tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
199 tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
200 tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
201 tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
202 tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h
203 tmdiff.o: ../include/openssl/symhacks.h ../include/openssl/tmdiff.h cryptlib.h
204 tmdiff.o: tmdiff.c
205 uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
206 uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
207 uid.o: ../include/openssl/safestack.h ../include/openssl/stack.h
208 uid.o: ../include/openssl/symhacks.h uid.c