Makefile 10.4 KB
Newer Older
1 2 3 4 5 6 7
#
# SSLeay/crypto/Makefile
#

DIR=		crypto
TOP=		..
CC=		cc
8 9
INCLUDE=	-I. -I$(TOP) -I../include
INCLUDES=	-I.. -I../.. -I../../include
10
CFLAG=		-g
11 12
INSTALL_PREFIX=
OPENSSLDIR=     /usr/local/ssl
13
INSTALLTOP=	/usr/local/ssl
B
Ben Laurie 已提交
14
MAKE=           make
15 16
MAKEDEPPROG=	makedepend
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
B
Ben Laurie 已提交
17
MAKEFILE=       Makefile
18
RM=             rm -f
19 20 21 22 23
AR=		ar r

PEX_LIBS=
EX_LIBS=
 
24
CFLAGS= $(INCLUDE) $(CFLAG)
25
ASFLAGS= $(INCLUDE) $(ASFLAG)
26
AFLAGS=$(ASFLAGS)
27

28 29
LIBS=

30 31
SDIRS=	objects \
	md2 md4 md5 sha mdc2 hmac ripemd \
32
	des rc2 rc4 rc5 idea bf cast \
B
Bodo Möller 已提交
33
	bn ec rsa dsa ecdsa ecdh dh dso engine aes \
34
	buffer bio stack lhash rand err \
35 36
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
	store
37

U
Ulf Möller 已提交
38
GENERAL=Makefile README crypto-lib.com install.com
39 40

LIB= $(TOP)/libcrypto.a
41
SHARED_LIB= libcrypto$(SHLIB_EXT)
42
LIBSRC=	cryptlib.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
43
LIBOBJ= cryptlib.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 $(CPUID_OBJ)
44 45 46

SRC= $(LIBSRC)

47
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
48
	ossl_typ.h
49
HEADER=	cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
50 51 52 53 54 55

ALL=    $(GENERAL) $(SRC) $(HEADER)

top:
	@(cd ..; $(MAKE) DIRS=$(DIR) all)

56
all: shared
57

B
Ben Laurie 已提交
58
buildinf.h: ../Makefile
59
	( echo "#ifndef MK1MF_BUILD"; \
B
Ben Laurie 已提交
60
	echo '  /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
61 62
	echo '  #define CFLAGS "$(CC) $(CFLAG)"'; \
	echo '  #define PLATFORM "$(PLATFORM)"'; \
63
	echo "  #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
64
	echo '#endif' ) >buildinf.h
65

66 67
x86cpuid-elf.s:	x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
68 69
x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
70 71
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
72

73 74 75 76 77
amd64cpuid.s: amd64cpuid.pl
	$(PERL) amd64cpuid.pl $@
ia64cpuid.s: ia64cpuid.S
	$(CC) $(CFLAGS) -E ia64cpuid.S > $@

U
Ulf Möller 已提交
78
testapps:
B
Bodo Möller 已提交
79 80
	if echo ${SDIRS} | fgrep ' des '; \
	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
81 82
	if echo ${SDIRS} | fgrep ' pkcs7 '; \
	then 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; fi
U
Ulf Möller 已提交
83

84 85 86
subdirs:
	@for i in $(SDIRS) ;\
	do \
87
	(cd $$i && echo "making all in crypto/$$i..." && \
A
Andy Polyakov 已提交
88
	$(MAKE) -e INCLUDES='${INCLUDES}' all ) || exit 1; \
89 90 91
	done;

files:
B
Ben Laurie 已提交
92
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
93 94
	@for i in $(SDIRS) ;\
	do \
95
	(cd $$i && echo "making 'files' in crypto/$$i..." && \
U
Ulf Möller 已提交
96
	$(MAKE) PERL='${PERL}' files ); \
97 98 99
	done;

links:
100 101 102
	@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
	@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
	@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
103
	@for i in $(SDIRS); do \
104
	(cd $$i && echo "making links in crypto/$$i..." && \
105
	$(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 ); \
106 107 108 109
	done;

lib:	$(LIBOBJ)
	$(AR) $(LIB) $(LIBOBJ)
110
	$(RANLIB) $(LIB) || echo Never mind.
111 112
	@touch lib

113
shared: buildinf.h lib subdirs
114
	if [ -n "$(SHARED_LIBS)" ]; then \
115
		(cd ..; $(MAKE) $(SHARED_LIB)); \
116 117
	fi

118 119 120
libs:
	@for i in $(SDIRS) ;\
	do \
121
	(cd $$i && echo "making libs in crypto/$$i..." && \
122
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
123 124 125 126 127
	done;

tests:
	@for i in $(SDIRS) ;\
	do \
128
	(cd $$i && echo "making tests in crypto/$$i..." && \
129 130 131 132
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
	done;

install:
133
	@headerlist="$(EXHEADER)"; for i in $$headerlist ;\
134
	do \
135 136
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
137 138 139
	done;
	@for i in $(SDIRS) ;\
	do \
140
	(cd $$i && echo "making install in crypto/$$i..." && \
141
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}'  INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
142 143 144 145 146
	done;

lint:
	@for i in $(SDIRS) ;\
	do \
147
	(cd $$i && echo "making lint in crypto/$$i..." && \
148 149 150 151
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
	done;

depend:
B
Bodo Möller 已提交
152
	if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
153
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
B
Bodo Möller 已提交
154
	if [ ! -s buildinf.h ]; then rm buildinf.h; fi
155 156
	@for i in $(SDIRS) ;\
	do \
157
	(cd $$i && echo "making depend in crypto/$$i..." && \
158
	$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ); \
159 160 161
	done;

clean:
162
	rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
163 164
	@for i in $(SDIRS) ;\
	do \
165
	(cd $$i && echo "making clean in crypto/$$i..." && \
166 167 168 169
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
	done;

dclean:
170
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
171 172 173
	mv -f Makefile.new $(MAKEFILE)
	@for i in $(SDIRS) ;\
	do \
174
	(cd $$i && echo "making dclean in crypto/$$i..." && \
U
Ulf Möller 已提交
175
	$(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
176 177 178
	done;

# DO NOT DELETE THIS LINE -- make depend depends on it.
B
Ben Laurie 已提交
179

180
cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
181 182
cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
G
Geoff Thorpe 已提交
183 184 185
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
186 187 188 189
cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
190 191 192
cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
cryptlib.o: cryptlib.h
193 194 195 196
cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
197 198 199
cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
cversion.o: cryptlib.h cversion.c
L
Lutz Jänicke 已提交
200
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
201 202 203 204
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
205 206 207
ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
ex_data.o: ex_data.c
208 209 210 211
mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
212 213 214
mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
mem.o: mem.c
215 216
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
217 218
mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
219 220 221 222
mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
223 224 225
mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
mem_dbg.o: mem_dbg.c
226 227
o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
o_dir.o: LPdir_unix.c o_dir.c o_dir.h
228 229
o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
o_str.o: o_str.c o_str.h
R
Richard Levitte 已提交
230 231
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
o_time.o: o_time.h
232 233 234 235
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
G
Geoff Thorpe 已提交
236 237 238
tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
239 240
uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
241 242
uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c