summaryrefslogtreecommitdiff
path: root/macros.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-20 14:21:29 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-20 14:21:29 -0700
commita4835d466c50237afcc30ff99bc980aeb5d17ce6 (patch)
tree66357bce22a451743c6b1b02e71f6860d9d84bd2 /macros.pl
parent73252a92ae00ab63a6f52f9c987d4550c20b9100 (diff)
downloadnasm-a4835d466c50237afcc30ff99bc980aeb5d17ce6.tar.gz
nasm-a4835d466c50237afcc30ff99bc980aeb5d17ce6.tar.bz2
nasm-a4835d466c50237afcc30ff99bc980aeb5d17ce6.zip
Avoid #including .c files; instead compile as separate units
Don't #include .c files, even if they are auto-generated; instead compile them as separate compilation units and let the linker do its job.
Diffstat (limited to 'macros.pl')
-rw-r--r--macros.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/macros.pl b/macros.pl
index e4f60a4..98f97ee 100644
--- a/macros.pl
+++ b/macros.pl
@@ -21,9 +21,9 @@ open(OUTPUT,">macros.c") or die "unable to open macros.c\n";
print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" .
" - don't edit it */\n";
print OUTPUT "\n";
-print OUTPUT "#include \"compiler.h\"\n";
+print OUTPUT "#include \"tables.h\"\n";
print OUTPUT "\n";
-print OUTPUT "static const char * const stdmac[] = {\n";
+print OUTPUT "const char * const nasm_stdmac[] = {\n";
foreach $fname ( @ARGV ) {
open(INPUT,$fname) or die "unable to open $fname\n";
@@ -46,7 +46,8 @@ foreach $fname ( @ARGV ) {
}
close(INPUT);
}
-print OUTPUT " NULL\n};\n";
+print OUTPUT " NULL\n};\n\n";
$tasm_count = $index unless ( defined($tasm_count) );
-print OUTPUT "#define TASM_MACRO_COUNT $tasm_count\n";
+print OUTPUT "const char * const * nasm_stdmac_after_tasm = ",
+ "&nasm_stdmac[$tasm_count];\n";
close(OUTPUT);