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
+# MANSUFFIX is for the benefit of anyone who may want to have a suffix
+# appended after the manpage file section number. "ssl" is popular,
+# resulting in files such as config.5ssl rather than config.5.
+MANSUFFIX=
HTMLSUFFIX=html
# $prefix is not /usr.
. ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
+SHARED_RCFLAGS={- $target{shared_rcflag} -}
PERL={- $config{perl} -}
RM= rm -f
TAR= {- $target{tar} || "tar" -}
TARFLAGS= {- $target{tarflags} -}
+MAKEDEPEND=$(CROSS_COMPILE){- $config{makedepprog} -}
BASENAME= openssl
NAME= $(BASENAME)-$(VERSION)
# The main targets ###################################################
-all: Makefile libcrypto.pc libssl.pc openssl.pc $(ENGINES) $(PROGRAMS) $(SCRIPTS) $(TESTPROGS)
+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
-rm -f `find $(BLDDIR) -type l`
rm -f $(TARFILE)
-DCLEAN_CMD=sed -e '/^DO NOT DELETE.*/,$$d'
+DCLEAN_CMD=sed -e '/^. DO NOT DELETE.*/,$$d'
dclean:
$(DCLEAN_CMD) < Makefile >Makefile.new
mv -f Makefile.new Makefile
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"
chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new; \
mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new \
$(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
- : {- output_on() -}; \
+ : {- output_on() unless windowsdll(); "" -}; \
done
- @ : {- output_on() -}
+ @ : {- output_on() if $config{no_shared}; "" -}
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
@echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
@cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
: {- output_off() unless windowsdll(); "" -}; \
echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a"; \
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
- : {- output_on() -}; \
+ : {- output_on() unless windowsdll(); "" -}; \
done
@echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
@$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
done
- : {- output_on() -};
+ : {- output_on() unless windowsdll(); "" -};
@set -e; for x in $(PROGRAMS); do \
fn=`basename $$x`; \
echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
done
- : {- output_on() -};
+ : {- output_on() unless windowsdll(); "" -};
$(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
# A method to extract all names from a .pod file
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" || :; \
my $dep = $args{obj}.'$(DEP_EXT)';
my $obj = $args{obj}.'$(OBJ_EXT)';
my $srcs = join(" ", @{$args{srcs}});
+ my $deps = join(" ", @{$args{srcs}}, @{$args{deps}});
my $incs = join(" ", map { " -I".$_ } @{$args{incs}});
my $makedepprog = $config{makedepprog};
if ($makedepprog eq "makedepend") {
return <<"EOF";
-$dep : $srcs
+$dep : $deps
rm -f \$\@.tmp; touch \$\@.tmp
- \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj"\
- -- -DOPENSSL_DOING_MAKEDEPEND \$(DEPFLAGS)$incs \
- -- $srcs
- sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$/d' -e '/^\\(#.*\\| *\\)\$/d' \$\@.tmp > \$\@
+ \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" \\
+ -- -DOPENSSL_DOING_MAKEDEPEND \$(DEPFLAGS)$incs \\
+ -- $srcs \\
+ 2>/dev/null
+ sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
rm \$\@.tmp
EOF
}
return <<"EOF";
-$dep : $srcs Makefile
+$dep : $deps Makefile
\$(CC) -DOPENSSL_DOING_MAKEDEPEND \$(DEPFLAGS)$incs -MM -MF \$\@ -MQ $obj $srcs
EOF
}
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
}