X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/fa2cb13d4940a616f7d35151d0c9c341a52e5e98..e8b58d59f9e1c77093c4082b7c1ea3f88049be5c:/mkfiles.pl diff --git a/mkfiles.pl b/mkfiles.pl index c81d64d..cefd365 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -131,11 +131,22 @@ readinput: while (1) { $type = substr($i,1,(length $i)-2); } else { if ($i =~ /\?$/) { - # Source files with a trailing question mark are optional: + # Object files with a trailing question mark are optional: # the build can proceed fine without them, so we only use - # them if they're present. + # them if their primary source files are present. $i =~ s/\?$//; $i = undef unless defined &finddep($i); + } elsif ($i =~ /\|/) { + # Object file descriptions containing a vertical bar are + # lists of choices: we use the _first_ one whose primary + # source file is present. + @options = split /\|/, $i; + $j = undef; + foreach $k (@options) { + $j=$k, last if defined &finddep($k); + } + die "no alternative found for $i\n" unless defined $j; + $i = $j; } if (defined $i) { push @$listref, $i; @@ -476,12 +487,13 @@ if (defined $makefiles{'cygwin'}) { "# RCINC = --include-dir c:\\cygwin\\include\\\n". "\n". &splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT". - " -D_NO_OLDNAMES -DNO_MULTIMON " . + " -D_NO_OLDNAMES -DNO_MULTIMON -DNO_HTMLHELP " . (join " ", map {"-I$dirpfx$_"} @srcdirs)) . "\n". "LDFLAGS = -mno-cygwin -s\n". &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1". - " --define WINVER=0x0400 --define MINGW32_FIX=1")."\n". + " --define WINVER=0x0400 --define MINGW32_FIX=1 " . + (join " ", map {"--include $dirpfx$_"} @srcdirs) )."\n". "\n"; print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C")); print "\n\n";