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

DIR=		crypto
TOP=		..
CC=		cc
8
INCLUDE=	-I. -I$(TOP) -I../include
9
# INCLUDES targets sudbirs!
10
INCLUDES=	-I.. -I../.. -I../../include
11
CFLAG=		-g
12 13
MAKEDEPPROG=	makedepend
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
B
Ben Laurie 已提交
14
MAKEFILE=       Makefile
15
RM=             rm -f
16 17
AR=		ar r

A
Andy Polyakov 已提交
18 19 20 21 22
RECURSIVE_MAKE=	[ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
		    (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
		    $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='${INCLUDES}' $$target ) || exit 1; \
		done;

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

30 31
LIBS=

U
Ulf Möller 已提交
32
GENERAL=Makefile README crypto-lib.com install.com
33 34

LIB= $(TOP)/libcrypto.a
35
SHARED_LIB= libcrypto$(SHLIB_EXT)
A
Andy Polyakov 已提交
36 37
LIBSRC=	cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ)
38 39 40

SRC= $(LIBSRC)

A
Andy Polyakov 已提交
41
EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
42
	ossl_typ.h
43
HEADER=	cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
44 45 46 47 48 49

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

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

50
all: shared
51

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

60 61
x86cpuid-elf.s:	x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
62 63
x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
64 65
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
66

67 68 69 70 71 72
uplink.o:	../ms/uplink.c
	$(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c

uplink-cof.s:	../ms/uplink.pl
	$(PERL) ../ms/uplink.pl coff > $@

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

U
Ulf Möller 已提交
78
testapps:
A
Andy Polyakov 已提交
79 80 81
	[ -z "$(THIS)" ] || (	if echo ${SDIRS} | fgrep ' des '; \
				then cd des && $(MAKE) -e des; fi )
	[ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
82
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
U
Ulf Möller 已提交
83

84
subdirs:
A
Andy Polyakov 已提交
85
	@target=all; $(RECURSIVE_MAKE)
86 87

files:
B
Ben Laurie 已提交
88
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
A
Andy Polyakov 已提交
89
	@target=files; $(RECURSIVE_MAKE)
90 91

links:
92 93 94
	@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
	@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
	@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
A
Andy Polyakov 已提交
95
	@target=links; $(RECURSIVE_MAKE)
96

97
# lib: $(LIB): are splitted to avoid end-less loop
98 99 100
lib:	$(LIB)
	@touch lib
$(LIB):	$(LIBOBJ)
101
	$(AR) $(LIB) $(LIBOBJ)
102
	$(RANLIB) $(LIB) || echo Never mind.
103

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

109
libs:
A
Andy Polyakov 已提交
110
	@target=lib; $(RECURSIVE_MAKE)
111 112

install:
113
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
114
	@headerlist="$(EXHEADER)"; for i in $$headerlist ;\
115
	do \
116 117
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
118
	done;
A
Andy Polyakov 已提交
119
	@target=install; $(RECURSIVE_MAKE)
120 121

lint:
A
Andy Polyakov 已提交
122
	@target=lint; $(RECURSIVE_MAKE)
123 124

depend:
A
Andy Polyakov 已提交
125 126 127 128
	@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
	@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
	@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
	@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
129
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
130 131

clean:
132
	rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
A
Andy Polyakov 已提交
133
	@target=clean; $(RECURSIVE_MAKE)
134 135

dclean:
136
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
137
	mv -f Makefile.new $(MAKEFILE)
A
Andy Polyakov 已提交
138
	@target=dclean; $(RECURSIVE_MAKE)
139 140

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

142
cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
143 144
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 已提交
145 146 147
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
148 149 150 151
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 已提交
152 153 154
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
155 156 157 158
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 已提交
159 160 161
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 已提交
162
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
163 164 165 166
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 已提交
167 168 169
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
170 171 172 173
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 已提交
174 175 176
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
177 178
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
179 180
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
181 182 183 184
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 已提交
185 186 187
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
188 189
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
190 191
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 已提交
192 193
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
o_time.o: o_time.h
194 195
uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
196 197
uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c