Makefile 7.9 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)
36
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
37
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)
38 39 40

SRC= $(LIBSRC)

41
EXHEADER= crypto.h tmdiff.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 98

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

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

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

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

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

depend:
A
Andy Polyakov 已提交
123 124 125 126
	@[ -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) )
127
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
128 129

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

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

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

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