2 # OpenSSL/crypto/Makefile
8 INCLUDE= -I. -I$(TOP) -I../include
9 # INCLUDES targets sudbirs!
10 INCLUDES= -I.. -I../.. -I../../include
12 MAKEDEPPROG= makedepend
13 MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
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; \
26 CFLAGS= $(INCLUDE) $(CFLAG)
27 ASFLAGS= $(INCLUDE) $(ASFLAG)
32 GENERAL=Makefile README crypto-lib.com install.com
33 TEST=constant_time_test.c
35 LIB= $(TOP)/libcrypto.a
36 SHARED_LIB= libcrypto$(SHLIB_EXT)
37 LIBSRC= cryptlib.c dyn_lck.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c o_init.c fips_err.c
38 LIBOBJ= cryptlib.o dyn_lck.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_init.o fips_err.o $(CPUID_OBJ)
42 EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
44 HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
45 constant_time_locl.h $(EXHEADER)
47 ALL= $(GENERAL) $(SRC) $(HEADER)
50 @(cd ..; $(MAKE) DIRS=$(DIR) all)
54 buildinf.h: ../Makefile
55 ( echo "#ifndef MK1MF_BUILD"; \
56 echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
57 echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
58 echo ' #define PLATFORM "$(PLATFORM)"'; \
59 echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
60 echo '#endif' ) >buildinf.h
62 x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
63 $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
64 x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
65 $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
66 x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
67 $(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
69 uplink.o: ../ms/uplink.c
70 $(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
72 uplink-cof.s: ../ms/uplink.pl
73 $(PERL) ../ms/uplink.pl coff > $@
75 x86_64cpuid.s: x86_64cpuid.pl
76 $(PERL) x86_64cpuid.pl $@
77 ia64cpuid.s: ia64cpuid.S
78 $(CC) $(CFLAGS) -E ia64cpuid.S > $@
81 [ -z "$(THIS)" ] || ( if echo ${SDIRS} | fgrep ' des '; \
82 then cd des && $(MAKE) -e des; fi )
83 [ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
84 @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
87 @target=all; $(RECURSIVE_MAKE)
90 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
91 @target=files; $(RECURSIVE_MAKE)
94 @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
95 @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
96 @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
97 @target=links; $(RECURSIVE_MAKE)
99 # lib: and $(LIB): are splitted to avoid end-less loop
100 lib: buildinf.h $(LIB) subdirs
103 $(ARX) $(LIB) $(LIBOBJ)
104 $(RANLIB) $(LIB) || echo Never mind.
106 shared: buildinf.h lib subdirs
107 if [ -n "$(SHARED_LIBS)" ]; then \
108 (cd ..; $(MAKE) $(SHARED_LIB)); \
112 @target=lib; $(RECURSIVE_MAKE)
115 @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
116 @headerlist="$(EXHEADER)"; for i in $$headerlist ;\
118 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
119 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
121 @target=install; $(RECURSIVE_MAKE)
124 @target=lint; $(RECURSIVE_MAKE)
127 @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
128 @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
129 @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
130 @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
131 @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
134 rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
135 @target=clean; $(RECURSIVE_MAKE)
138 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
139 mv -f Makefile.new $(MAKEFILE)
140 @target=dclean; $(RECURSIVE_MAKE)
142 # DO NOT DELETE THIS LINE -- make depend depends on it.
144 cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
145 cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
146 cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
147 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
148 cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
149 cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
150 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
151 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
152 cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
153 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
154 cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
155 cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
156 cryptlib.o: cryptlib.h
157 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
158 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
159 cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
160 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
161 cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
162 cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
163 cversion.o: cryptlib.h cversion.c
164 dyn_lck.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
165 dyn_lck.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
166 dyn_lck.o: ../include/openssl/err.h ../include/openssl/lhash.h
167 dyn_lck.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
168 dyn_lck.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
169 dyn_lck.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
171 ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
172 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
173 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
174 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
175 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
176 ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
177 ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
179 fips_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
180 fips_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
181 fips_err.o: ../include/openssl/fips.h ../include/openssl/lhash.h
182 fips_err.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
183 fips_err.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
184 fips_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h fips_err.c
185 fips_err.o: fips_err.h
186 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
187 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
188 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
189 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
190 mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
191 mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
193 mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
194 mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
195 mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
196 mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
197 mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
198 mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
199 mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
200 mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
201 mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
202 mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
204 o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
205 o_dir.o: LPdir_unix.c o_dir.c o_dir.h
206 o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
207 o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
208 o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
209 o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
210 o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
211 o_init.o: ../include/openssl/symhacks.h o_init.c
212 o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
213 o_str.o: o_str.c o_str.h
214 o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
216 tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
217 tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
218 tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
219 tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
220 tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
221 tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
222 tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
223 uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
224 uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
225 uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
226 uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c