From d4ca24338b944a0334deba8eb65a2621f2bc6afd Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 9 Sep 2008 09:43:16 -0700 Subject: macros.pl: be a bit more careful with open() Be a bit more strict with open() calls. Signed-off-by: H. Peter Anvin --- macros.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.pl b/macros.pl index b1970cf5..165d09f7 100755 --- a/macros.pl +++ b/macros.pl @@ -37,7 +37,7 @@ sub charcify(@) { # # Generate macros.c # -open(OUT,">macros.c") or die "unable to open macros.c\n"; +open(OUT,"> macros.c\0") or die "unable to open macros.c\n"; print OUT "/*\n"; print OUT " * Do not edit - this file auto-generated by macros.pl from:\n"; @@ -60,7 +60,7 @@ my $lastname; my $z; foreach $fname ( @ARGV ) { - open(INPUT,$fname) or die "unable to open $fname\n"; + open(INPUT,"< $fname\0") or die "$0: $fname: $!\n"; while () { $line++; chomp; -- cgit v1.2.1 From 5618e0063d205ff1214ac5291f24b857144bf950 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 9 Sep 2008 09:53:20 -0700 Subject: outaout.mac: aoutb is an alias for aout aoutb is an alias format for aout (in the sense they use the same macro set.) Signed-off-by: H. Peter Anvin --- output/outaout.mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/outaout.mac b/output/outaout.mac index ef049a28..f00cb960 100644 --- a/output/outaout.mac +++ b/output/outaout.mac @@ -1,4 +1,4 @@ -OUT: aout +OUT: aout aoutb %define __SECT__ [section .text] %macro __NASM_CDecl__ 1 %endmacro -- cgit v1.2.1 From 49039ab636449017677cafca6549ca5c4ddf943c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 9 Sep 2008 09:54:03 -0700 Subject: macros.pl: don't include macros for disabled output formats Don't include macros for output formats we aren't compiling in. Signed-off-by: H. Peter Anvin --- macros.pl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/macros.pl b/macros.pl index 165d09f7..dd9c9618 100755 --- a/macros.pl +++ b/macros.pl @@ -47,7 +47,9 @@ print OUT "\n"; print OUT "#include \"tables.h\"\n"; print OUT "#include \"nasmlib.h\"\n"; print OUT "#include \"hashtbl.h\"\n"; +print OUT "#include \"outform.h\"\n"; print OUT "\n"; +print OUT "#if 1\n"; print OUT "const unsigned char nasm_stdmac[] = {"; my $npkg = 0; @@ -71,9 +73,15 @@ foreach $fname ( @ARGV ) { undef $pkg; my @out_alias = split(/\s+/, $1); printf OUT " /* %4d */ 0\n", $index++; - print OUT "};\n"; + print OUT "};\n#endif\n"; $index = 0; - printf OUT "const unsigned char %s_stdmac[] = {\n", $out_alias[0]; + print OUT "\n"; + my $pfx = '#if'; + foreach my $al (@out_alias) { + print OUT $pfx, " defined(OF_\U${al}\E)"; + $pfx = ' ||'; + } + printf OUT "\nconst unsigned char %s_stdmac[] = {\n", $out_alias[0]; print OUT " /* From $fname */\n"; $lastname = $fname; push(@out_list, $out_alias[0]); @@ -84,8 +92,9 @@ foreach $fname ( @ARGV ) { die "$0: $fname: duplicate package: $pkg\n"; } printf OUT " /* %4d */ 0\n", $index++; - print OUT "};\n"; + print OUT "};\n#endif\n"; $index = 0; + print OUT "\n#if 1\n"; printf OUT "static const unsigned char nasm_stdmac_%s[] = {\n", $pkg; print OUT " /* From $fname */\n"; $lastname = $fname; @@ -126,7 +135,7 @@ foreach $fname ( @ARGV ) { } close(INPUT); } -printf OUT " /* %4d */ 0\n};\n\n", $index++; +printf OUT " /* %4d */ 0\n};\n#endif\n\n", $index++; print OUT "const unsigned char * const nasm_stdmac_after_tasm = ", "&nasm_stdmac[$tasm_count];\n\n"; -- cgit v1.2.1 From 325a4bff508e5cdf8804c6ea3ce6b8eb08110625 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 9 Sep 2008 09:54:47 -0700 Subject: Run "make alldeps" --- Makefile.in | 4 ++-- Mkfiles/msvc.mak | 3 ++- Mkfiles/netware.mak | 3 ++- Mkfiles/openwcom.mak | 3 ++- Mkfiles/owlinux.mak | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3167f3ff..3126bd13 100644 --- a/Makefile.in +++ b/Makefile.in @@ -268,8 +268,8 @@ lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \ nasmlib.h pptok.h preproc.h regs.h version.h -macros.$(O): macros.c compiler.h config.h hashtbl.h insnsi.h nasmlib.h \ - tables.h +macros.$(O): macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h outform.h pptok.h preproc.h regs.h tables.h version.h nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \ insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \ preproc.h raa.h regs.h saa.h stdscan.h tokens.h version.h diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 0ec7e936..594bce69 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -207,7 +207,8 @@ lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \ pptok.h preproc.h regs.h version.h -macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasmlib.h tables.h +macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \ + outform.h pptok.h preproc.h regs.h tables.h version.h nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \ labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \ raa.h regs.h saa.h stdscan.h tokens.h version.h diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak index 672221cf..873043b2 100644 --- a/Mkfiles/netware.mak +++ b/Mkfiles/netware.mak @@ -148,7 +148,8 @@ snprintf.o: snprintf.c compiler.h config.h nasmlib.h vsnprintf.o: vsnprintf.c compiler.h config.h nasmlib.h listing.o: listing.c compiler.h config.h insnsi.h listing.h nasm.h nasmlib.h \ pptok.h preproc.h regs.h version.h -macros.o: macros.c compiler.h config.h hashtbl.h insnsi.h nasmlib.h tables.h +macros.o: macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h nasmlib.h \ + outform.h pptok.h preproc.h regs.h tables.h version.h nasm.o: nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \ insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \ preproc.h raa.h regs.h saa.h stdscan.h tokens.h version.h diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index 6ef4c4da..b10ceb54 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -236,7 +236,8 @@ lib\snprintf.$(O): lib\snprintf.c compiler.h nasmlib.h lib\vsnprintf.$(O): lib\vsnprintf.c compiler.h nasmlib.h listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h & pptok.h preproc.h regs.h version.h -macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasmlib.h tables.h +macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h & + outform.h pptok.h preproc.h regs.h tables.h version.h nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h & labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h & raa.h regs.h saa.h stdscan.h tokens.h version.h diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak index acdfa78a..1c7d44d7 100644 --- a/Mkfiles/owlinux.mak +++ b/Mkfiles/owlinux.mak @@ -246,7 +246,8 @@ lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \ pptok.h preproc.h regs.h version.h -macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasmlib.h tables.h +macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \ + outform.h pptok.h preproc.h regs.h tables.h version.h nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \ labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \ raa.h regs.h saa.h stdscan.h tokens.h version.h -- cgit v1.2.1