Identify and move OpenSSL internal header files
[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
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 depend:
114         @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
115         @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
116         @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
117         @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
118         @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
119
120 clean:
121         rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
122         @target=clean; $(RECURSIVE_MAKE)
123
124 dclean:
125         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
126         mv -f Makefile.new $(MAKEFILE)
127         @target=dclean; $(RECURSIVE_MAKE)
128
129 # DO NOT DELETE THIS LINE -- make depend depends on it.
130
131 cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
132 cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
133 cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
134 cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
135 cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
136 cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
137 cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
138 cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
139 cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
140 cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
141 cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
142 cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
143 cryptlib.o: cryptlib.h
144 cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
145 cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
146 cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
147 cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
148 cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
149 cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
150 cversion.o: cryptlib.h cversion.c
151 ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
152 ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
153 ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
154 ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
155 ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
156 ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
157 ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
158 ex_data.o: ex_data.c
159 fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
160 lock.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
161 lock.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
162 lock.o: ../include/openssl/err.h ../include/openssl/lhash.h
163 lock.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
164 lock.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
165 lock.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
166 lock.o: lock.c
167 mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
168 mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
169 mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
170 mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
171 mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
172 mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
173 mem.o: mem.c
174 mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
175 mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
176 mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
177 mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
178 mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
179 mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
180 mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
181 mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
182 mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
183 mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
184 mem_dbg.o: mem_dbg.c
185 o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
186 o_dir.o: LPdir_unix.c o_dir.c o_dir.h
187 o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
188 o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
189 o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
190 o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
191 o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
192 o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
193 o_fips.o: o_fips.c
194 o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
195 o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
196 o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
197 o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
198 o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
199 o_init.o: ../include/openssl/symhacks.h o_init.c
200 o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
201 o_str.o: o_str.c o_str.h
202 o_time.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
203 o_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
204 o_time.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
205 o_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h o_time.c
206 thr_id.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
207 thr_id.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
208 thr_id.o: ../include/openssl/err.h ../include/openssl/lhash.h
209 thr_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
210 thr_id.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
211 thr_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
212 thr_id.o: thr_id.c
213 uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
214 uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
215 uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
216 uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c