summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@gmail.com>2013-06-30 01:30:44 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2013-06-30 01:31:15 +0400
commit1052394ef6e7601973eab7be9cdc098370a56355 (patch)
tree2bd2f380b374b212b57ac8fa9b1888c7087d3bbc
parent50a33b068bab4ec7e996c2bf869c8edb1fec5da2 (diff)
downloadnasm-1052394ef6e7601973eab7be9cdc098370a56355.tar.gz
make: Fix nasm build with MSVC
http://bugzilla.nasm.us/show_bug.cgi?id=3392258 Signed-off-by: Marat Dukhan <maratek@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--Mkfiles/msvc.mak16
-rwxr-xr-xdirectiv.pl4
-rwxr-xr-xpptok.pl2
3 files changed, 18 insertions, 4 deletions
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index 65efd6c9..583cc2c1 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -94,8 +94,10 @@ version.mac: version version.pl
# `standard.mac' by another Perl script. Again, it's part of the
# standard distribution.
-macros.c: macros.pl standard.mac version.mac
- $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
+macros.c: macros.pl pptok.ph standard.mac version.mac \
+ $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
+ $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac \
+ $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
# These source files are generated from regs.dat by yet another
# perl script.
@@ -105,6 +107,8 @@ regflags.c: regs.dat regs.pl
$(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
regdis.c: regs.dat regs.pl
$(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
+regdis.h: regs.dat regs.pl
+ $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
regvals.c: regs.dat regs.pl
$(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
regs.h: regs.dat regs.pl
@@ -125,6 +129,14 @@ pptok.h: pptok.dat pptok.pl perllib/phash.ph
$(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
pptok.c: pptok.dat pptok.pl perllib/phash.ph
$(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
+pptok.ph: pptok.dat pptok.pl perllib/phash.ph
+ $(PERL) $(srcdir)/pptok.pl ph $(srcdir)/pptok.dat pptok.ph
+
+# Directives hash
+directiv.h: directiv.dat directiv.pl perllib/phash.ph
+ $(PERL) $(srcdir)/directiv.pl h $(srcdir)/directiv.dat directiv.h
+directiv.c: directiv.dat directiv.pl perllib/phash.ph
+ $(PERL) $(srcdir)/directiv.pl c $(srcdir)/directiv.dat directiv.c
# This target generates all files that require perl.
# This allows easier generation of distribution (see dist target).
diff --git a/directiv.pl b/directiv.pl
index 01af2350..51d0ec38 100755
--- a/directiv.pl
+++ b/directiv.pl
@@ -35,7 +35,9 @@
#
# Generate a perfect hash for directive parsing
#
-# Usage: directiv.pl directiv.dat directiv.c directiv.h
+# Usage:
+# directiv.pl h directiv.dat directiv.h (to generate C header)
+# directiv.pl c directiv.dat directiv.c (to generate C source)
#
require 'phash.ph';
diff --git a/pptok.pl b/pptok.pl
index be85b942..1ea2e7e5 100755
--- a/pptok.pl
+++ b/pptok.pl
@@ -45,7 +45,7 @@ my($what, $in, $out) = @ARGV;
#
open(IN, "< $in") or die "$0: cannot open: $in\n";
while (defined($line = <IN>)) {
- chomp $line;
+ $line =~ s/\r?\n$//; # Remove trailing \r\n or \n
$line =~ s/^\s+//; # Remove leading whitespace
$line =~ s/\s*\#.*$//; # Remove comments and trailing whitespace
next if ($line eq '');