Makefile.org 17.1 KB
Newer Older
1 2 3 4
##
## Makefile for OpenSSL
##

U
Ulf Möller 已提交
5 6 7
VERSION=
MAJOR=
MINOR=
8 9 10 11
SHLIB_VERSION_NUMBER=
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=
SHLIB_MINOR=
12
SHLIB_EXT=
13
PLATFORM=dist
14
OPTIONS=
15
CONFIGURE_ARGS=
16 17
SHLIB_TARGET=

18 19 20 21 22
# HERE indicates where this Makefile lives.  This can be used to indicate
# where sub-Makefiles are expected to be.  Currently has very limited usage,
# and should probably not be bothered with at all.
HERE=.

23 24 25 26
# INSTALL_PREFIX is for package builders so that they can configure
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
# Normally it is left empty.
INSTALL_PREFIX=
27 28 29 30
INSTALLTOP=/usr/local/ssl

# Do not edit this manually. Use Configure --openssldir=DIR do change this!
OPENSSLDIR=/usr/local/ssl
31

32 33 34 35
# NO_IDEA - Define to build without the IDEA algorithm
# NO_RC4  - Define to build without the RC4 algorithm
# NO_RC2  - Define to build without the RC2 algorithm
# THREADS - Define when building with threads, you will probably also need any
36
#           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
37 38 39 40
# TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
# TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
# DEVRANDOM - Give this the value of the 'random device' if your OS supports
41 42
#           one.  32 bytes will be read from this when the random
#           number generator is initalised.
43
# SSL_FORBID_ENULL - define if you want the server to be not able to use the
44
#           NULL encryption ciphers.
45 46 47
#
# LOCK_DEBUG - turns on lots of lock debug output :-)
# REF_CHECK - turn on some xyz_free() assertions.
48
# REF_PRINT - prints some stuff on structure free.
49 50
# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
# MFUNC - Make all Malloc/Free/Realloc calls call
51 52 53 54 55
#       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
#       call application defined callbacks via CRYPTO_set_mem_functions()
# MD5_ASM needs to be defined to use the x86 assembler for MD5
# SHA1_ASM needs to be defined to use the x86 assembler for SHA1
# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
56 57 58
# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
# equal 4.
# PKCS1_CHECK - pkcs1 tests.
59

60 61
CC= cc
CFLAG= -O
62
DEPFLAG= 
63
PEX_LIBS= 
64
EX_LIBS= 
65
EXE_EXT= 
66 67
ARFLAGS=
AR=ar $(ARFLAGS) r
68 69
RANLIB= ranlib
PERL= perl
70
TAR= tar
R
Richard Levitte 已提交
71
TARFLAGS= --no-recursion
72
MAKEDEPPROG=makedepend
73

74 75 76 77 78 79
# We let the C compiler driver to take care of .s files. This is done in
# order to be excused from maintaining a separate set of architecture
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
# gcc, then the driver will automatically translate it to -xarch=v8plus
# and pass it down to assembler.
AS=$(CC) -c
80
ASFLAG=$(CFLAG)
81

82 83 84 85 86 87
# For x86 assembler: Set PROCESSOR to 386 if you want to support
# the 80386.
PROCESSOR=

# CPUID module collects small commonly used assembler snippets
CPUID_OBJ= 
88
BN_ASM= bn_asm.o
89
DES_ENC= des_enc.o fcrypt_b.o
90
AES_ASM_OBJ=aes_core.o aes_cbc.o
91 92 93 94 95 96 97
BF_ENC= bf_enc.o
CAST_ENC= c_enc.o
RC4_ENC= rc4_enc.o
RC5_ENC= rc5_enc.o
MD5_ASM_OBJ= 
SHA1_ASM_OBJ= 
RMD160_ASM_OBJ= 
98

99 100
# KRB5 stuff
KRB5_INCLUDES=
101
LIBKRB5=
102

103
DIRS=   crypto ssl engines apps test tools
U
Ulf Möller 已提交
104 105
SHLIBDIRS= crypto ssl

106 107
# dirs in crypto to build
SDIRS=  \
108
	objects \
109
	md2 md4 md5 sha mdc2 hmac ripemd \
110 111
	des aes rc2 rc4 rc5 idea bf cast \
	bn ec rsa dsa ecdsa dh ecdh dso engine \
112
	buffer bio stack lhash rand err \
113
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
B
Ben Laurie 已提交
114
	store pqueue
115

116 117 118 119
# tests to perform.  "alltests" is a special word indicating that all tests
# should be performed.
TESTS = alltests

B
Ben Laurie 已提交
120
MAKEFILE= Makefile
121
NEWMAKE=  make
B
Ben Laurie 已提交
122
MAKE=     $(NEWMAKE)
123

124
MANDIR=$(OPENSSLDIR)/man
125 126
MAN1=1
MAN3=3
127
MANSUFFIX=
128 129
SHELL=/bin/sh

130
TOP=    .
131
ONEDIRS=out tmp
U
Ulf Möller 已提交
132
EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
133
WDIRS=  windows
134
LIBS=   libcrypto.a libssl.a
135 136 137 138
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
SHARED_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS=
SHARED_LIBS_LINK_EXTS=
139
SHARED_LDFLAGS=
140 141

GENERAL=        Makefile
R
Ralf S. Engelschall 已提交
142
BASENAME=       openssl
143 144 145
NAME=           $(BASENAME)-$(VERSION)
TARFILE=        $(NAME).tar
WTARFILE=       $(NAME)-win.tar
146
EXHEADER=       e_os2.h
147
HEADER=         e_os.h
148

B
Ben Laurie 已提交
149
all: Makefile build_all openssl.pc
150

151 152 153
BUILDENV=	PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
		SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}'	\
		CC='${CC}' CFLAG='${CFLAG}' 			\
154
		AS='${CC}' ASFLAG='${CFLAG} -c'			\
155 156 157 158 159 160
		AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'	\
		LDFLAGS="$(LDFLAGS)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)"	\
		KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'	\
		EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'	\
		SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}'	\
		PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}'	\
161
		CPUID_OBJ='${CPUID_OBJ}'			\
162 163 164 165 166 167 168 169
		BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' 	\
		AES_ASM_OBJ='${AES_ASM_OBJ}'			\
		BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}'	\
		RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'	\
		SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'			\
		MD5_ASM_OBJ='${MD5_ASM_OBJ}'			\
		RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'

170 171 172
BUILD_CMD=if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
	if [ -d "$$dir" ]; then \
		(cd $$dir && echo "making $$target in $$dir..." && \
A
Andy Polyakov 已提交
173
		$(MAKE) -e $(BUILDENV) $$target ) || exit 1; \
174
	else \
175
		$(MAKE) $$dir; \
176 177
	fi; fi

178
sub_all: build_all
179 180
build_all: build_libs build_apps build_tests build_tools

181
build_libs: build_crypto build_ssl build_engines
182 183

build_crypto:
184
	@dir=crypto; target=all; $(BUILD_CMD)
185
build_ssl:
186
	@dir=ssl; target=all; $(BUILD_CMD)
187
build_engines:
188
	@dir=engines; target=all; $(BUILD_CMD)
189
build_apps:
190
	@dir=apps; target=all; $(BUILD_CMD)
191
build_tests:
192
	@dir=test; target=all; $(BUILD_CMD)
193
build_tools:
194 195 196 197 198
	@dir=tools; target=all; $(BUILD_CMD)

all_testapps: build_libs build_testapps
build_testapps:
	@dir=crypto; target=testapps; $(BUILD_CMD)
199

200
libcrypto$(SHLIB_EXT): libcrypto.a
201
	@if [ "$(SHLIB_TARGET)" != "" ]; then \
202
		$(MAKE) SHLIBDIRS=crypto build-shared; \
203 204
	else \
		echo "There's no support for shared libraries on this platform" >&2; \
205
		exit 1; \
206
	fi
207

208
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
209
	@if [ "$(SHLIB_TARGET)" != "" ]; then \
210
		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
211 212
	else \
		echo "There's no support for shared libraries on this platform" >&2; \
213
		exit 1; \
214
	fi
215 216

clean-shared:
217
	@set -e; for i in $(SHLIBDIRS); do \
218 219 220 221 222 223 224
		if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
			tmp="$(SHARED_LIBS_LINK_EXTS)"; \
			for j in $${tmp:-x}; do \
				( set -x; rm -f lib$$i$$j ); \
			done; \
		fi; \
		( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
225
		if [ "$(PLATFORM)" = "Cygwin" ]; then \
226 227
			( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
		fi; \
228
	done
229

230
link-shared:
231
	@ set -e; for i in ${SHLIBDIRS}; do \
232
		$(NEWMAKE) -f $(HERE)/Makefile.shared \
233 234 235
			LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
			LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
			symlink.$(SHLIB_TARGET); \
236
		libs="$$libs -l$$i"; \
237 238
	done

239 240 241
build-shared: do_$(SHLIB_TARGET) link-shared

do_$(SHLIB_TARGET):
242
	@ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
243 244 245
		if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
			libs="$(LIBKRB5) $$libs"; \
		fi; \
246
		$(NEWMAKE) -f Makefile.shared \
247
			$(BUILDENV) \
248 249 250
			LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
			LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
			LIBDEPS="$$libs $(EX_LIBS)" \
251
			LIBRPATH="$(INSTALLTOP)/lib" \
252
			link_a.$(SHLIB_TARGET); \
253
		libs="-l$$i $$libs"; \
254 255
	done

B
Ben Laurie 已提交
256
openssl.pc: Makefile
257 258 259 260 261 262 263 264 265 266
	@ ( echo 'prefix=$(INSTALLTOP)'; \
	    echo 'exec_prefix=$${prefix}'; \
	    echo 'libdir=$${exec_prefix}/lib'; \
	    echo 'includedir=$${prefix}/include'; \
	    echo ''; \
	    echo 'Name: OpenSSL'; \
	    echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
	    echo 'Version: '$(VERSION); \
	    echo 'Requires: '; \
	    echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
267
	    echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
268

269 270
Makefile: Makefile.org Configure config
	@echo "Makefile is older than Makefile.org, Configure or config."
271
	@echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
272 273
	@false

274
libclean:
275
	rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
276

277 278
clean:	libclean
	rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
279
	@set -e; for i in $(DIRS) ;\
280
	do \
281
	if [ -d "$$i" ]; then \
282 283 284 285
		(cd $$i && echo "making clean in $$i..." && \
		$(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
		rm -f $(LIBS); \
	fi; \
286
	done;
287
	rm -f openssl.pc
288
	rm -f speed.* .pure
289
	rm -f $(TARFILE)
290
	@set -e; for i in $(ONEDIRS) ;\
291
	do \
292
	rm -fr $$i/*; \
293 294 295
	done

makefile.one: files
296
	$(PERL) util/mk1mf.pl >makefile.one; \
297 298
	sh util/do_ms.sh

U
Ulf Möller 已提交
299
files:
B
Ben Laurie 已提交
300
	$(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
301
	@set -e; for i in $(DIRS) ;\
302
	do \
303
	if [ -d "$$i" ]; then \
304 305 306
		(cd $$i && echo "making 'files' in $$i..." && \
		$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
	fi; \
307 308 309
	done;

links:
310
	@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
311
	@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
312
	@set -e; target=links; for dir in $(DIRS); do $(BUILD_CMD); done
313

314 315
gentests:
	@(cd test && echo "generating dummy tests (if needed)..." && \
316
	$(MAKE) $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
317

318
dclean:
319
	rm -f *.bak
320
	@set -e; for i in $(DIRS) ;\
321
	do \
322
	if [ -d "$$i" ]; then \
323 324 325
		(cd $$i && echo "making dclean in $$i..." && \
		$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
	fi; \
326 327
	done;

328 329
rehash: rehash.time
rehash.time: certs
330 331
	@(OPENSSL="`pwd`/util/opensslwrap.sh"; \
	  OPENSSL_DEBUG_MEMORY=on; \
332 333
	  export OPENSSL OPENSSL_DEBUG_MEMORY; \
	  $(PERL) tools/c_rehash certs)
B
Bodo Möller 已提交
334
	touch rehash.time
335

336
test:   tests
337

338
tests: rehash
339
	@(cd test && echo "testing..." && \
340 341
	$(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
	util/opensslwrap.sh version -a
342

343 344 345
report:
	@$(PERL) util/selftest.pl

346
depend:
347
	@set -e; for i in $(DIRS) ;\
348
	do \
349
	if [ -d "$$i" ]; then \
350
		(cd $$i && echo "making dependencies $$i..." && \
351
		$(MAKE) SDIRS='${SDIRS}' CFLAG='-DOPENSSL_NO_DEPRECATED ${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
352
	fi; \
353 354 355
	done;

lint:
356
	@set -e; for i in $(DIRS) ;\
357
	do \
358
	if [ -d "$$i" ]; then \
359 360 361
		(cd $$i && echo "making lint $$i..." && \
		$(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
	fi; \
362 363 364
	done;

tags:
B
Ben Laurie 已提交
365 366
	rm -f TAGS
	find . -name '[^.]*.[ch]' | xargs etags -a
367 368

errors:
369
	$(PERL) util/mkerr.pl -recurse -write
370
	(cd engines; $(MAKE) PERL=$(PERL) errors)
371

372
stacks:
373
	$(PERL) util/mkstack.pl -write
374

375
util/libeay.num::
376
	$(PERL) util/mkdef.pl crypto update
377 378

util/ssleay.num::
379
	$(PERL) util/mkdef.pl ssl update
380

381
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
382
	$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
B
typo  
Bodo Möller 已提交
383
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
384
	$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
385

386 387 388
apps/openssl-vms.cnf: apps/openssl.cnf
	$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf

389
TABLE: Configure
B
Bodo Möller 已提交
390
	(echo 'Output of `Configure TABLE'"':"; \
391
	$(PERL) Configure TABLE) > TABLE
392

393
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf TABLE
394

395 396 397 398 399
# Build distribution tar-file. As the list of files returned by "find" is
# pretty long, on several platforms a "too many arguments" error or similar
# would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option.
400
tar:
401 402 403
	find . -type d -print | xargs chmod 755
	find . -type f -print | xargs chmod a+r
	find . -type f -perm -0100 -print | xargs chmod a+x
404 405
	find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
	$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
406
	tardy --user_number=0  --user_name=openssl \
R
Ralf S. Engelschall 已提交
407 408
	      --group_number=0 --group_name=openssl \
	      --prefix=openssl-$(VERSION) - |\
409
	gzip --best >../$(TARFILE).gz; \
410
	rm -f ../$(TARFILE).list; \
411
	ls -l ../$(TARFILE).gz
412

413 414
tar-snap:
	@$(TAR) $(TARFLAGS) -cvf - \
415
		`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
416 417 418 419 420
	tardy --user_number=0  --user_name=openssl \
	      --group_number=0 --group_name=openssl \
	      --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
	ls -l ../$(TARFILE)

421
dist:   
422
	$(PERL) Configure dist
423 424
	@$(MAKE) dist_pem_h
	@$(MAKE) SDIRS='${SDIRS}' clean
425
	@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
426 427

dist_pem_h:
428
	(cd crypto/pem; $(MAKE) $(BUILDENV) pem.h; $(MAKE) clean)
429

430 431 432
install: all install_docs install_sw

install_sw:
B
Bodo Möller 已提交
433 434
	@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
		$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
435
		$(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
436
		$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
B
Bodo Möller 已提交
437 438 439
		$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
		$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
		$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
440
		$(INSTALL_PREFIX)$(OPENSSLDIR)/private
441
	@set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
B
Bodo Möller 已提交
442 443 444 445
	do \
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
	done;
446
	@set -e; for i in $(DIRS) ;\
447
	do \
448
	if [ -d "$$i" ]; then \
449
		(cd $$i; echo "installing $$i..."; \
450
		$(MAKE) $(BUILDENV) INSTALL_PREFIX='${INSTALL_PREFIX}' OPENSSLDIR='${OPENSSLDIR}' install ); \
451
	fi; \
452
	done
453
	@set -e; for i in $(LIBS) ;\
454
	do \
455 456
		if [ -f "$$i" ]; then \
		(       echo installing $$i; \
457 458 459
			cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
			$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
			chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
460
			mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
L
Lutz Jänicke 已提交
461 462
		fi; \
	done;
463
	@set -e; if [ -n "$(SHARED_LIBS)" ]; then \
464 465 466
		tmp="$(SHARED_LIBS)"; \
		for i in $${tmp:-x}; \
		do \
467
			if [ -f "$$i" -o -f "$$i.a" ]; then \
468
			(       echo installing $$i; \
469
				if [ "$(PLATFORM)" != "Cygwin" ]; then \
470 471
					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
					chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
472
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
473 474
				else \
					c=`echo $$i | sed 's/^lib/cyg/'`; \
475 476
					cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
					chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
477
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
478 479
					cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
					chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
480
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
481
				fi ); \
L
Lutz Jänicke 已提交
482
			fi; \
483 484 485
		done; \
		(	here="`pwd`"; \
			cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
486
			$(NEWMAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
487 488 489 490
		if [ "$(INSTALLTOP)" != "/usr" ]; then \
			echo 'OpenSSL shared libraries have been installed in:'; \
			echo '  $(INSTALLTOP)'; \
			echo ''; \
491
			sed -e '1,/^$$/d' doc/openssl-shared.txt; \
492
		fi; \
493
	fi
494
	cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
495
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
496 497 498

install_docs:
	@$(PERL) $(TOP)/util/mkdir-p.pl \
499 500 501 502
		$(INSTALL_PREFIX)$(MANDIR)/man1 \
		$(INSTALL_PREFIX)$(MANDIR)/man3 \
		$(INSTALL_PREFIX)$(MANDIR)/man5 \
		$(INSTALL_PREFIX)$(MANDIR)/man7
503
	@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
504 505 506 507 508
	here="`pwd`"; \
	filecase=; \
	if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
		filecase=-i; \
	fi; \
509
	set -e; for i in doc/apps/*.pod; do \
510
		fn=`basename $$i .pod`; \
511
		sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
512
		echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
513
		(cd `$(PERL) util/dirname.pl $$i`; \
514
		sh -c "$$pod2man \
515 516
			--section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`") \
517
			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
518 519
		$(PERL) util/extract-names.pl < $$i | \
			grep -v $$filecase "^$$fn\$$" | \
520
			grep -v "[	]" | \
521 522
			(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
			 while read n; do \
R
Richard Levitte 已提交
523
				$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
524
			 done); \
525
	done; \
526
	set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
527
		fn=`basename $$i .pod`; \
528
		sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
529
		echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
530
		(cd `$(PERL) util/dirname.pl $$i`; \
531
		sh -c "$$pod2man \
532 533
			--section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`") \
534
			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
535 536
		$(PERL) util/extract-names.pl < $$i | \
			grep -v $$filecase "^$$fn\$$" | \
R
Richard Levitte 已提交
537
			grep -v "[	]" | \
538 539
			(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
			 while read n; do \
R
Richard Levitte 已提交
540
				$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
541
			 done); \
542
	done
543 544

# DO NOT DELETE THIS LINE -- make depend depends on it.