summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2018-06-18 13:50:25 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2018-06-18 13:54:43 -0700
commit5d8193367e638092f35f5e54128795329f42a746 (patch)
treeda09ed568973f3f311ffb1b6bd959e93180885ca /tools
parentef4e5e209fd1ad9e2ffff9112a66bb2b73225d8f (diff)
downloadnasm-5d8193367e638092f35f5e54128795329f42a746.tar.gz
MSVC: fix dependency generation and building RDOFF under MSVC
1. The mkdep.pl program didn't handle excluded dependencies correctly, causing it to error out due to config/config.h not existing. 2. NMAKE is sensitive to the order suffixes appear in .SUFFIXES, causing it to try to use the builtin rule .c.exe instead of .c.obj -> .obj.exe. 3. NMAKE doesn't handle the && operator between commands. 4. The !ifdef jungle around dependency generation was wrong. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mkdep.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/mkdep.pl b/tools/mkdep.pl
index e84cc358..8c89f39a 100755
--- a/tools/mkdep.pl
+++ b/tools/mkdep.pl
@@ -51,6 +51,9 @@ $barrier = "#-- Everything below is generated by mkdep.pl - do not edit --#\n";
# This converts from filenames to full pathnames for our dependencies
%dep_path = {};
+# List of files that cannot be found; these *must* be excluded
+@must_exclude = ();
+
#
# Scan files for dependencies
#
@@ -70,7 +73,8 @@ sub scandeps($) {
if ( $line =~ /^\s*\#\s*include\s+\"(.*)\"\s*$/ ) {
my $nf = $1;
if (!defined($dep_path{$nf})) {
- die "$0: cannot determine path for dependency: $file -> $nf\n";
+ push(@must_exclude, $nf);
+ next;
}
$nf = $dep_path{$nf};
$mdeps{$nf}++;
@@ -138,7 +142,7 @@ sub _insert_deps($$) {
my $selfrule = 0;
my $do_external = 0;
my $maxline = 78; # Seems like a reasonable default
- my @exclude = (); # Don't exclude anything
+ my %exclude = (); # Don't exclude anything
my @genhdrs = ();
my $external = undef;
my $raw_output = 0;
@@ -165,7 +169,7 @@ sub _insert_deps($$) {
} elsif ( $parm eq 'continuation' ) {
$cont = $val;
} elsif ( $parm eq 'exclude' ) {
- @exclude = split(/\,/, $val);
+ $excludes{$val}++;
} elsif ( $parm eq 'include-command' ) {
$include_command = $val;
} elsif ( $parm eq 'external' ) {
@@ -201,10 +205,6 @@ sub _insert_deps($$) {
}
my $e;
- my %do_exclude = ();
- foreach $e (@exclude) {
- $do_exclude{$e} = 1;
- }
foreach my $dfile ($external, sort(keys(%deps)) ) {
my $ofile;
@@ -222,7 +222,7 @@ sub _insert_deps($$) {
my $len = length($ofile);
print $out $ofile;
foreach my $dep (@deps) {
- unless ($do_exclude{$dep}) {
+ unless ($excludes{$dep}) {
my $str = convert_file($dep, $sep);
my $sl = length($str)+1;
if ( $len+$sl > $maxline-2 ) {