PACKETise ServerHello processing
[openssl.git] / crypto / Makefile
1 #
2 # OpenSSL/crypto/Makefile
3 #
4
5 DIR=            crypto
6 TOP=            ..
7 CC=             cc
8 INCLUDE=        -I. -I$(TOP) -I../include -Iinclude $(ZLIB_INCLUDE)
9 # INCLUDES targets sudbirs!
10 INCLUDES=       -I.. -I../.. -I../modes -I../include -I../../include $(ZLIB_INCLUDE)
11 CFLAG=          -g
12 MAKEDEPPROG=    makedepend
13 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
14 MAKEFILE=       Makefile
15 RM=             rm -f
16 AR=             ar r
17
18 RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
19                     (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
20                     $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$target ) || exit 1; \
21                 done;
22
23 PEX_LIBS=
24 EX_LIBS=
25  
26 CFLAGS= $(INCLUDE) $(CFLAG)
27 ASFLAGS= $(INCLUDE) $(ASFLAG)
28 AFLAGS=$(ASFLAGS)
29 CPUID_OBJ=mem_clr.o
30
31 LIBS=
32
33 GENERAL=Makefile README crypto-lib.com install.com
34
35 LIB= $(TOP)/libcrypto.a
36 SHARED_LIB= libcrypto$(SHLIB_EXT)
37 LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
38         ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c fips_ers.c \
39         o_init.c o_fips.c sec_mem.c
40 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
41         ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o fips_ers.o \
42         o_init.o o_fips.o sec_mem.o $(CPUID_OBJ)
43
44 SRC= $(LIBSRC)
45
46 HEADER= buildinf.h arm_arch.h ppc_arch.h sparc_arch.h
47
48 ALL=    $(GENERAL) $(SRC) $(HEADER)
49
50 top:
51         @(cd ..; $(MAKE) DIRS=$(DIR) all)
52
53 all: shared
54
55 fips: cryptlib.o thr_id.o uid.o $(CPUID_OBJ)
56         [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
57                     ( obj=`$(PERL) $(TOP)/util/fipsobj.pl $$i` && \
58                         cd $$i && echo "making fips in $(DIR)/$$i..." && \
59                     $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$obj ) || exit 1; \
60                 done;
61
62 buildinf.h: ../Makefile
63         $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
64
65 x86cpuid.s:     x86cpuid.pl perlasm/x86asm.pl
66         $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
67
68 applink.o:      $(TOP)/ms/applink.c
69         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
70
71 uplink.o:       $(TOP)/ms/uplink.c applink.o
72         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
73
74 uplink-x86.s:   $(TOP)/ms/uplink-x86.pl
75         $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
76
77 x86_64cpuid.s:  x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
78 ia64cpuid.s:    ia64cpuid.S;    $(CC) $(CFLAGS) -E ia64cpuid.S > $@
79 ppccpuid.s:     ppccpuid.pl;    $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
80 pariscid.s:     pariscid.pl;    $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
81 alphacpuid.s:   alphacpuid.pl
82         (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
83         $(PERL) alphacpuid.pl > $$preproc && \
84         $(CC) -E -P $$preproc > $@ && rm $$preproc)
85 arm64cpuid.S:   arm64cpuid.pl;  $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@
86 armv4cpuid.S:   armv4cpuid.pl;  $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@
87
88 subdirs:
89         @target=all; $(RECURSIVE_MAKE)
90
91 files:
92         $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
93         @target=files; $(RECURSIVE_MAKE)
94
95 # lib: $(LIB): are splitted to avoid end-less loop
96 lib:    $(LIB)
97         @touch lib
98 $(LIB): $(LIBOBJ)
99         $(AR) $(LIB) $(LIBOBJ)
100         $(RANLIB) $(LIB) || echo Never mind.
101
102 shared: buildinf.h lib subdirs
103         if [ -n "$(SHARED_LIBS)" ]; then \
104                 (cd ..; $(MAKE) $(SHARED_LIB)); \
105         fi
106
107 libs:
108         @target=lib; $(RECURSIVE_MAKE)
109
110 lint:
111         @target=lint; $(RECURSIVE_MAKE)
112
113 update: local_depend
114         @[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
115         @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
116
117 depend: local_depend
118         @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
119         @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
120 local_depend:
121         @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
122         @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
123         @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
124
125 clean:
126         rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
127         @target=clean; $(RECURSIVE_MAKE)
128
129 dclean:
130         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
131         mv -f Makefile.new $(MAKEFILE)
132         @target=dclean; $(RECURSIVE_MAKE)
133
134 # DO NOT DELETE THIS LINE -- make depend depends on it.
135
136 cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
137 cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
138 cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
139 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
140 cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
141 cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
142 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
143 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
144 cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
145 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
146 cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
147 cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
148 cryptlib.o: include/internal/cryptlib.h
149 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
150 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
151 cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
152 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
153 cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
154 cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
155 cversion.o: cversion.c include/internal/cryptlib.h
156 ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
157 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
158 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
159 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
160 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
161 ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
162 ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h ex_data.c
163 ex_data.o: include/internal/cryptlib.h
164 fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
165 lock.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
166 lock.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
167 lock.o: ../include/openssl/err.h ../include/openssl/lhash.h
168 lock.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
169 lock.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
170 lock.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
171 lock.o: include/internal/cryptlib.h lock.c
172 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
173 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
174 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
175 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
176 mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
177 mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
178 mem.o: include/internal/cryptlib.h mem.c
179 mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
180 mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
181 mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
182 mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
183 mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
184 mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
185 mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
186 mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
187 mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
188 mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
189 mem_dbg.o: include/internal/cryptlib.h mem_dbg.c
190 o_dir.o: ../e_os.h ../include/internal/o_dir.h ../include/openssl/e_os2.h
191 o_dir.o: ../include/openssl/opensslconf.h LPdir_unix.c o_dir.c
192 o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
193 o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
194 o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
195 o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
196 o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
197 o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
198 o_fips.o: include/internal/cryptlib.h o_fips.c
199 o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
200 o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
201 o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
202 o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
203 o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
204 o_init.o: ../include/openssl/symhacks.h o_init.c
205 o_str.o: ../e_os.h ../include/internal/o_str.h ../include/openssl/e_os2.h
206 o_str.o: ../include/openssl/opensslconf.h o_str.c
207 o_time.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
208 o_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
209 o_time.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
210 o_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h o_time.c
211 sec_mem.o: ../e_os.h ../include/openssl/crypto.h ../include/openssl/e_os2.h
212 sec_mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
213 sec_mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
214 sec_mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h sec_mem.c
215 thr_id.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
216 thr_id.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
217 thr_id.o: ../include/openssl/err.h ../include/openssl/lhash.h
218 thr_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
219 thr_id.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
220 thr_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
221 thr_id.o: include/internal/cryptlib.h thr_id.c
222 uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
223 uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
224 uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
225 uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c