ENGINESDIR={- use File::Spec::Functions;
catdir($prefix,$libdir,"engines") -}
-MANDIR=$(OPENSSLDIR)/man
-HTMLDIR=$(OPENSSLDIR)/html
+MANDIR=$(INSTALLTOP)/share/man
+HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
MANSUFFIX=ssl
HTMLSUFFIX=html
# $prefix is not /usr.
. ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
+SHARED_RCFLAGS={- $target{shared_rcflag} -}
PERL={- $config{perl} -}
# The main targets ###################################################
-all: Makefile libcrypto.pc libssl.pc openssl.pc $(ENGINES) $(PROGRAMS) $(SCRIPTS) $(TESTPROGS) link-utils
+all: build_libs build_engines build_apps link-utils
-test tests: $(TESTPROGS) rehash
+# The pkg-config files depend on the libraries as well as Makefile
+build_libs: libcrypto.pc libssl.pc openssl.pc
+build_engines: $(ENGINES)
+build_apps: $(PROGRAMS) $(SCRIPTS)
+build_tests: $(TESTPROGS)
+
+test tests: build_tests build_apps build_engines rehash
( cd test; \
SRCTOP=../$(SRCDIR) \
BLDTOP=../$(BLDDIR) \
libclean:
-rm -f `find $(BLDDIR) -name '*$(LIB_EXT)' -o -name '*$(SHLIB_EXT)'`
-install: install_sw install_docs
+install: install_sw install_ssldirs install_docs
uninstall: uninstall_docs uninstall_sw
uninstall_docs: uninstall_man_docs uninstall_html_docs
+install_ssldirs:
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
+
install_dev:
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@echo "*** Installing development files"
names=`cat $$p | $(EXTRACT_NAMES)`; \
( cd $$top/man$$SEC; \
for n in $$names; do \
- if [ "$$n" != "$$fn" ]; then \
+ comp_n="$$n"; \
+ comp_fn="$$fn"; \
+ case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
+ comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
+ comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
+ ;; \
+ esac; \
+ if [ "$$comp_n" != "$$comp_fn" ]; then \
echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
fi; \
$(RM) $$top/man$$SEC/$$fn$$suf; \
names=`cat $$p | $(EXTRACT_NAMES)`; \
for n in $$names; do \
- if [ "$$n" != "$$fn" ]; then \
+ comp_n="$$n"; \
+ comp_fn="$$fn"; \
+ case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
+ comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
+ comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
+ ;; \
+ esac; \
+ if [ "$$comp_n" != "$$comp_fn" ]; then \
echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
$(RM) $$top/man$$SEC/$$n$$suf; \
fi; \
# Helper targets #####################################################
-rehash: link-utils copy-certs
+rehash: link-utils copy-certs build_apps
@if [ -z "$(CROSS_COMPILE)" ]; then \
(OPENSSL="$(BLDDIR)/util/shlib_wrap.sh apps/openssl"; \
[ -x "$(BLDDIR)/openssl.exe" ] && OPENSSL="$(BLDDIR)/openssl.exe" || :; \
CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
CROSS_COMPILE="\$(CROSS_COMPILE)" \\
SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=\$(SHLIB_EXT) \\
+ SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
link_a.$shlib_target
EOF
. (windowsdll() ? <<"EOF" : "");
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
APPNAME=$bin OBJECTS="$objs" \\
- LIBDEPS="\$(PLIB_LDFLAGS) \$(LDFLAGS) $linklibs \$(EX_LIBS)" \\
+ LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
link_app.$shlib_target
rel2abs($config{builddir}));
return <<"EOF";
$script : $sources
- \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" $sources > "$script"
+ \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $sources > "$script"
chmod a+x $script
EOF
}