Correctly set Z_is_one on the return value in the NISTZ256 implementation.
[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 $(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
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 $(CPUID_OBJ)
43
44 SRC= $(LIBSRC)
45
46 HEADER= cryptlib.h buildinf.h md32_common.h o_str.h o_dir.h \
47         constant_time_locl.h
48
49 ALL=    $(GENERAL) $(SRC) $(HEADER)
50
51 top:
52         @(cd ..; $(MAKE) DIRS=$(DIR) all)
53
54 all: shared
55
56 fips: cryptlib.o thr_id.o uid.o $(CPUID_OBJ)
57         [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
58                     ( obj=`$(PERL) $(TOP)/util/fipsobj.pl $$i` && \
59                         cd $$i && echo "making fips in $(DIR)/$$i..." && \
60                     $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$obj ) || exit 1; \
61                 done;
62
63 buildinf.h: ../Makefile
64         $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
65
66 x86cpuid.s:     x86cpuid.pl perlasm/x86asm.pl
67         $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
68
69 applink.o:      $(TOP)/ms/applink.c
70         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
71
72 uplink.o:       $(TOP)/ms/uplink.c applink.o
73         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
74
75 uplink-x86.s:   $(TOP)/ms/uplink-x86.pl
76         $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
77
78 x86_64cpuid.s:  x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
79 ia64cpuid.s:    ia64cpuid.S;    $(CC) $(CFLAGS) -E ia64cpuid.S > $@
80 ppccpuid.s:     ppccpuid.pl;    $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
81 pariscid.s:     pariscid.pl;    $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
82 alphacpuid.s:   alphacpuid.pl
83         (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
84         $(PERL) alphacpuid.pl > $$preproc && \
85         $(CC) -E -P $$preproc > $@ && rm $$preproc)
86 arm64cpuid.S:   arm64cpuid.pl;  $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@
87 armv4cpuid.S:   armv4cpuid.pl;  $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@
88
89 subdirs:
90         @target=all; $(RECURSIVE_MAKE)
91
92 files:
93         $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
94         @target=files; $(RECURSIVE_MAKE)
95
96 # lib: $(LIB): are splitted to avoid end-less loop
97 lib:    $(LIB)
98         @touch lib
99 $(LIB): $(LIBOBJ)
100         $(AR) $(LIB) $(LIBOBJ)
101         $(RANLIB) $(LIB) || echo Never mind.
102
103 shared: buildinf.h lib subdirs
104         if [ -n "$(SHARED_LIBS)" ]; then \
105                 (cd ..; $(MAKE) $(SHARED_LIB)); \
106         fi
107
108 libs:
109         @target=lib; $(RECURSIVE_MAKE)
110
111 lint:
112         @target=lint; $(RECURSIVE_MAKE)
113
114 depend:
115         @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
116         @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
117         @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
118         @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
119         @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
120
121 clean:
122         rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
123         @target=clean; $(RECURSIVE_MAKE)
124
125 dclean:
126         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
127         mv -f Makefile.new $(MAKEFILE)
128         @target=dclean; $(RECURSIVE_MAKE)
129
130 # DO NOT DELETE THIS LINE -- make depend depends on it.
131
132 cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
133 cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
134 cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
135 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
136 cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
137 cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
138 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
139 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
140 cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
141 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
142 cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
143 cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
144 cryptlib.o: cryptlib.h
145 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
146 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
147 cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
148 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
149 cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
150 cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
151 cversion.o: cryptlib.h cversion.c
152 ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
153 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
154 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
155 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
156 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
157 ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
158 ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
159 ex_data.o: ex_data.c
160 fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
161 lock.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
162 lock.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
163 lock.o: ../include/openssl/err.h ../include/openssl/lhash.h
164 lock.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
165 lock.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
166 lock.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
167 lock.o: lock.c
168 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
169 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
170 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
171 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
172 mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
173 mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
174 mem.o: mem.c
175 mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
176 mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
177 mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
178 mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
179 mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
180 mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
181 mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
182 mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
183 mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
184 mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
185 mem_dbg.o: mem_dbg.c
186 o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
187 o_dir.o: LPdir_unix.c o_dir.c o_dir.h
188 o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
189 o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
190 o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
191 o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
192 o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
193 o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
194 o_fips.o: o_fips.c
195 o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
196 o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
197 o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
198 o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
199 o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
200 o_init.o: ../include/openssl/symhacks.h o_init.c
201 o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
202 o_str.o: o_str.c o_str.h
203 o_time.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
204 o_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
205 o_time.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
206 o_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h o_time.c
207 thr_id.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
208 thr_id.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
209 thr_id.o: ../include/openssl/err.h ../include/openssl/lhash.h
210 thr_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
211 thr_id.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
212 thr_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
213 thr_id.o: thr_id.c
214 uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
215 uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
216 uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
217 uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c