From 1052394ef6e7601973eab7be9cdc098370a56355 Mon Sep 17 00:00:00 2001 From: Marat Dukhan Date: Sun, 30 Jun 2013 01:30:44 +0400 Subject: [PATCH] make: Fix nasm build with MSVC http://bugzilla.nasm.us/show_bug.cgi?id=3392258 Signed-off-by: Marat Dukhan Signed-off-by: Cyrill Gorcunov --- Mkfiles/msvc.mak | 16 ++++++++++++++-- directiv.pl | 4 +++- pptok.pl | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 65efd6c..583cc2c 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 01af235..51d0ec3 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 be85b94..1ea2e7e 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 = )) { - 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 ''); -- 2.7.4