grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
+GENERATED={- join(" ", map { (my $x = $_) =~ s|\.S$|\.s|; $x } keys %{$unified_info{generate}}) -}
BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
SRCTOP=../$(SRCDIR) \
BLDTOP=../$(BLDDIR) \
EXE_EXT={- $exeext -} \
+ OPENSSL_ENGINES=../$(BLDDIR)/engines \
$(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
list-tests:
uninstall: uninstall_docs uninstall_sw
clean: libclean
- rm -f $(PROGRAMS) $(TESTPROGS)
- rm -f `find $(BLDDIR) -name '*{- $depext -}'`
- rm -f `find $(BLDDIR) -name '*{- $objext -}'`
- rm -f $(BLDDIR)/core
- rm -f $(BLDDIR)/tags $(BLDDIR)/TAGS
- rm -f $(BLDDIR)/openssl.pc $(BLDDIR)/libcrypto.pc $(BLDDIR)/libssl.pc
- -rm -f `find $(BLDDIR) -type l`
+ rm -f $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
+ rm -f $(GENERATED)
+ -rm -f `find . -name '*{- $depext -}'`
+ -rm -f `find . -name '*{- $objext -}'`
+ rm -f core
+ rm -f tags TAGS
+ rm -f openssl.pc libcrypto.pc libssl.pc
+ -rm -f `find . -type l`
rm -f $(TARFILE)
# This exists solely for those who still type 'make depend'
#
# We check if any depfile is newer than Makefile and decide to
-# concatenate only if that is true, or if 'test' (a.k.a [ )
-# doesn't have the option to figure it out (-nt).
-#
-# To check if test has the file age comparison operator, we
-# simply try, and rely test to exit with 0 if the comparison
-# was true, 1 if false, and most importantly, 2 if it doesn't
-# recognise the operator.
+# concatenate only if that is true.
depend:
@: {- output_off() if $disabled{makedepend}; "" -}
- @catdepends=false; \
- if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \
- for d in $(DEPS); do \
- if [ $$d -nt Makefile ]; then \
- catdepends=true; \
- break; \
- fi; \
- done; \
- else \
- catdepends=true; \
- fi; \
- if [ $$catdepends = true ]; then \
+ @if [ -z "`find $(DEPS) -newer Makefile`" ]; then \
( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
echo; \
- for d in $(DEPS); do \
- if [ -f $$d ]; then cat $$d; fi; \
+ for f in $(DEPS); do \
+ if [ -f $$f ]; then cat $$f; fi; \
done ) > Makefile.new; \
- if ! cmp Makefile.new Makefile >/dev/null 2>&1; then \
- mv -f Makefile.new Makefile; \
- else \
+ if cmp Makefile.new Makefile >/dev/null 2>&1; then \
rm -f Makefile.new; \
+ else \
+ mv -f Makefile.new Makefile; \
fi; \
fi
@: {- output_on() if $disabled{makedepend}; "" -}
# wasn't passed down automatically. It's quite safe to use it like we do
# below; if it doesn't exist, the result will be empty and 'make' will pick
# up $(MAKEFLAGS) which is passed down as an environment variable.
-configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
+configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
@echo "Detected changed: $?"
@echo "Reconfiguring..."
$(SRCDIR)/Configure reconf
rm -f \$\@.tmp; touch \$\@.tmp
-\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
2>/dev/null
- perl -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; #\\
- \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); #\\
- \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' \$\@.tmp
- \@if ! cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
- mv \$\@.tmp \$\@; \\
- else \\
+ -\$(PERL) -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' \$\@.tmp
+ \@if cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
rm -f \$\@.tmp; \\
+ else \\
+ mv \$\@.tmp \$\@; \\
fi
EOF
$deps = $obj.$depext;
$obj$objext: $deps
\$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
\@touch $obj$depext.tmp
- \@if ! cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
- mv $obj$depext.tmp $obj$depext; \\
- else \\
+ \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
rm -f $obj$depext.tmp; \\
+ else \\
+ mv $obj$depext.tmp $obj$depext; \\
fi
EOF
}
$target: $lib$libext $deps $ordinalsfile
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PLATFORM=\$(PLATFORM) \\
- PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
- INSTALLTOP="\$(INSTALLTOP)" LIBDIR="\$(LIBDIR)" \\
- LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
+ PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
- LIBCOMPATVERSIONS=";\$(SHLIB_VERSION_HISTORY)" \\
- CC="\$(CC)" CFLAGS="\$(CFLAGS) \$(LIB_CFLAGS)" \\
- CROSS_COMPILE="\$(CROSS_COMPILE)" LDFLAGS="\$(LDFLAGS)" \\
- SHARED_LDFLAGS="\$(LIB_LDFLAGS)" SHLIB_EXT=$shlibext \\
- SHARED_RCFLAGS="\$(RCFLAGS)" \\
+ LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
+ CROSS_COMPILE='\$(CROSS_COMPILE)' LDFLAGS='\$(LDFLAGS)' \\
+ SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
+ SHARED_RCFLAGS='\$(RCFLAGS)' \\
link_shlib.$shlib_target
EOF
. (windowsdll() ? <<"EOF" : "");
$target: $objs $deps
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PLATFORM=\$(PLATFORM) \\
- PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
- LIBDEPS="\$(PLIB_LDFLAGS) $shlibdeps \$(EX_LIBS)" \\
- LIBNAME=$libname LDFLAGS="\$(LDFLAGS)" \\
- CC="\$(CC)" CFLAGS="\$(CFLAGS) \$(DSO_CFLAGS)" \\
- SHARED_LDFLAGS="\$(DSO_LDFLAGS)" \\
+ PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
+ LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
+ SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
SHLIB_EXT=$dsoext \\
LIBEXTRAS="$objs" \\
link_dso.$shlib_target
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
APPNAME=$bin$exeext OBJECTS="$objs" \\
- LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
- CC="\$(CC)" CFLAGS="\$(CFLAGS) \$(BIN_CFLAGS)" \\
- LDFLAGS="\$(LDFLAGS)" LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
+ LDFLAGS='\$(LDFLAGS)' LIBRPATH='\$(INSTALLTOP)/\$(LIBDIR)' \\
link_app.$shlib_target
EOF
}