提交 29eed3dd 编写于 作者: R Richard Levitte

Adapt unix Makefile template to 'no-makedepend'

This change is a bit more complex, as it involves several recipe
variants.

Also, remove the $(CROSS_COMPILE) prefix for the makedepend program.
When we use the program "makedepend", this doesn't serve anything,
and when we use the compiler, this value isn't even used.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 952a9d1a
...@@ -79,9 +79,11 @@ ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -} ...@@ -79,9 +79,11 @@ ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test/| } @{$unified_info{programs}}) -} PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test/| } @{$unified_info{programs}}) -}
TESTPROGS={- join(" ", map { $_.$exeext } grep { m|^test/| } @{$unified_info{programs}}) -} TESTPROGS={- join(" ", map { $_.$exeext } grep { m|^test/| } @{$unified_info{programs}}) -}
SCRIPTS={- join(" ", @{$unified_info{scripts}}) -} SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
{- output_off() if $disabled{makedepend}; "" -}
DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; } DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ } grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
keys %{$unified_info{sources}}); -} keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \ MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
...@@ -178,7 +180,7 @@ RM= rm -f ...@@ -178,7 +180,7 @@ RM= rm -f
RMDIR= rmdir RMDIR= rmdir
TAR= {- $target{tar} || "tar" -} TAR= {- $target{tar} || "tar" -}
TARFLAGS= {- $target{tarflags} -} TARFLAGS= {- $target{tarflags} -}
MAKEDEPEND=$(CROSS_COMPILE){- $config{makedepprog} -} MAKEDEPEND={- $config{makedepprog} -}
BASENAME= openssl BASENAME= openssl
NAME= $(BASENAME)-$(VERSION) NAME= $(BASENAME)-$(VERSION)
...@@ -259,6 +261,7 @@ clean: libclean ...@@ -259,6 +261,7 @@ clean: libclean
# was true, 1 if false, and most importantly, 2 if it doesn't # was true, 1 if false, and most importantly, 2 if it doesn't
# recognise the operator. # recognise the operator.
depend: depend:
@: {- output_off() if $disabled{makedepend}; "" -}
@catdepends=false; \ @catdepends=false; \
if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \ if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \
for d in $(DEPS); do \ for d in $(DEPS); do \
...@@ -283,6 +286,7 @@ depend: ...@@ -283,6 +286,7 @@ depend:
rm -f Makefile.new; \ rm -f Makefile.new; \
fi; \ fi; \
fi fi
@: {- output_on() if $disabled{makedepend}; "" -}
# Install helper targets ############################################# # Install helper targets #############################################
...@@ -874,19 +878,26 @@ EOF ...@@ -874,19 +878,26 @@ EOF
dso => '$(DSO_CFLAGS)', dso => '$(DSO_CFLAGS)',
bin => '$(BIN_CFLAGS)' } -> {$args{intent}}; bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
my $makedepprog = $config{makedepprog}; my $makedepprog = $config{makedepprog};
if ($makedepprog eq "makedepend") { my $recipe = "";
return <<"EOF"; if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
$recipe .= <<"EOF";
$obj$depext: $deps $obj$depext: $deps
rm -f \$\@.tmp; touch \$\@.tmp rm -f \$\@.tmp; touch \$\@.tmp
-\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS) $ecflags$incs -- $srcs \\ -\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
2>/dev/null 2>/dev/null
sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@ sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
rm \$\@.tmp rm \$\@.tmp
$obj$objext: $obj$depext EOF
$deps = $obj.$depext;
}
if ($disabled{makedepend} || $makedepprog =~ /\/makedepend/) {
$recipe .= <<"EOF";
$obj$objext: $deps
\$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
EOF EOF
} }
return <<"EOF"; if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
$recipe .= <<"EOF";
$obj$objext: $deps $obj$objext: $deps
\$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs \$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
\@touch $obj$depext.tmp \@touch $obj$depext.tmp
...@@ -894,6 +905,8 @@ $obj$objext: $deps ...@@ -894,6 +905,8 @@ $obj$objext: $deps
mv $obj$depext.tmp $obj$depext; \\ mv $obj$depext.tmp $obj$depext; \\
fi fi
EOF EOF
}
return $recipe;
} }
# On Unix, we build shlibs from static libs, so we're ignoring the # On Unix, we build shlibs from static libs, so we're ignoring the
# object file array. We *know* this routine is only called when we've # object file array. We *know* this routine is only called when we've
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册