Makefile.ssl 9.9 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 14
INSTALLTOP=	/usr/local/ssl
MAKE=           make -f Makefile.ssl
15 16
MAKEDEPPROG=	makedepend
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
17
MAKEFILE=       Makefile.ssl
18
RM=             rm -f
19 20 21 22 23
AR=		ar r

PEX_LIBS=
EX_LIBS=
 
24
CFLAGS= $(INCLUDE) $(CFLAG)
25

26

27 28
LIBS=

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

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

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

SRC= $(LIBSRC)

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

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

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

55
all: shared
56

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

U
Ulf Möller 已提交
65
testapps:
B
Bodo Möller 已提交
66 67
	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
U
Ulf Möller 已提交
68
	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
U
Ulf Möller 已提交
69

70 71 72
subdirs:
	@for i in $(SDIRS) ;\
	do \
73
	(cd $$i && echo "making all in crypto/$$i..." && \
74
	$(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}' all ) || exit 1; \
75 76 77
	done;

files:
78
	$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
79 80
	@for i in $(SDIRS) ;\
	do \
81
	(cd $$i && echo "making 'files' in crypto/$$i..." && \
U
Ulf Möller 已提交
82
	$(MAKE) PERL='${PERL}' files ); \
83 84 85
	done;

links:
86
	@sh $(TOP)/util/point.sh Makefile.ssl Makefile
87 88 89
	@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
	@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
	@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
90
	@sh $(TOP)/util/point.sh Makefile.ssl Makefile
91
	@for i in $(SDIRS); do \
92
	(cd $$i && echo "making links in crypto/$$i..." && \
93
	$(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 ); \
94 95 96 97
	done;

lib:	$(LIBOBJ)
	$(AR) $(LIB) $(LIBOBJ)
98
	$(RANLIB) $(LIB) || echo Never mind.
99 100
	@touch lib

101
shared: buildinf.h lib subdirs
102
	if [ -n "$(SHARED_LIBS)" ]; then \
103
		(cd ..; $(MAKE) $(SHARED_LIB)); \
104 105
	fi

106 107 108
libs:
	@for i in $(SDIRS) ;\
	do \
109
	(cd $$i && echo "making libs in crypto/$$i..." && \
110
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
111 112 113 114 115
	done;

tests:
	@for i in $(SDIRS) ;\
	do \
116
	(cd $$i && echo "making tests in crypto/$$i..." && \
117 118 119 120 121 122
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
	done;

install:
	@for i in $(EXHEADER) ;\
	do \
123 124
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
125 126 127
	done;
	@for i in $(SDIRS) ;\
	do \
128
	(cd $$i && echo "making install in crypto/$$i..." && \
129
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}'  INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
130 131 132 133 134
	done;

lint:
	@for i in $(SDIRS) ;\
	do \
135
	(cd $$i && echo "making lint in crypto/$$i..." && \
136 137 138 139
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
	done;

depend:
B
Bodo Möller 已提交
140
	if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
141
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
B
Bodo Möller 已提交
142
	if [ ! -s buildinf.h ]; then rm buildinf.h; fi
143 144
	@for i in $(SDIRS) ;\
	do \
145
	(cd $$i && echo "making depend in crypto/$$i..." && \
146
	$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ); \
147 148 149
	done;

clean:
150
	rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
151 152
	@for i in $(SDIRS) ;\
	do \
153
	(cd $$i && echo "making clean in crypto/$$i..." && \
154 155 156 157
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
	done;

dclean:
158
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
159 160 161
	mv -f Makefile.new $(MAKEFILE)
	@for i in $(SDIRS) ;\
	do \
162
	(cd $$i && echo "making dclean in crypto/$$i..." && \
U
Ulf Möller 已提交
163
	$(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
164 165 166
	done;

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

168
cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
169 170
cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
D
 
Dr. Stephen Henson 已提交
171
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
172
cpt_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cpt_err.c
173 174 175 176 177 178 179 180 181 182 183 184
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
cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h
cryptlib.o: ../include/openssl/symhacks.h cryptlib.c cryptlib.h
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
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c
L
Lutz Jänicke 已提交
185
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
186 187 188 189 190 191 192 193 194 195 196 197
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
ex_data.o: ../include/openssl/safestack.h ../include/openssl/stack.h
ex_data.o: ../include/openssl/symhacks.h cryptlib.h ex_data.c
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
mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem.o: ../include/openssl/symhacks.h cryptlib.h mem.c
198 199 200 201
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
mem_clr.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem_clr.o: ../include/openssl/symhacks.h mem_clr.c
202 203 204 205 206 207
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
mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
208 209
o_str.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_str.c
o_str.o: o_str.h
R
Richard Levitte 已提交
210 211
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
o_time.o: o_time.h
212 213 214 215 216 217 218
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
tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h
tmdiff.o: ../include/openssl/symhacks.h ../include/openssl/tmdiff.h cryptlib.h
tmdiff.o: tmdiff.c
219 220
uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
R
Richard Levitte 已提交
221
uid.o: ../include/openssl/safestack.h ../include/openssl/stack.h
222
uid.o: ../include/openssl/symhacks.h uid.c