diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 14:21:29 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 14:21:29 -0700 |
commit | a4835d466c50237afcc30ff99bc980aeb5d17ce6 (patch) | |
tree | 66357bce22a451743c6b1b02e71f6860d9d84bd2 /insns.pl | |
parent | 73252a92ae00ab63a6f52f9c987d4550c20b9100 (diff) | |
download | nasm-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 'insns.pl')
-rw-r--r-- | insns.pl | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -231,6 +231,7 @@ if ( !defined($output) || $output eq 'i' ) { print I "\tI_none = -1\n"; print I "\n};\n\n"; print I "#define MAX_INSLEN ", $maxlen, "\n\n"; + print I "#define NCOND_OPCODES ", scalar @opcodes_cc, "\n\n"; print I "#endif /* NASM_INSNSI_H */\n"; close I; @@ -243,9 +244,9 @@ if ( !defined($output) || $output eq 'n' ) { print N "/* This file is auto-generated from insns.dat by insns.pl" . " - don't edit it */\n\n"; - print N "/* This file in included by names.c */\n\n"; + print N "#include \"tables.h\"\n\n"; - print N "static const char * const insn_names[] = {"; + print N "const char * const nasm_insn_names[] = {"; $first = 1; foreach $i (@opcodes) { print N "," if ( !$first ); @@ -256,7 +257,7 @@ if ( !defined($output) || $output eq 'n' ) { } print N "\n};\n\n"; print N "/* Conditional instructions */\n"; - print N "static const char *icn[] = {"; + print N "const char * const nasm_cond_insn_names[] = {"; $first = 1; foreach $i (@opcodes_cc) { print N "," if ( !$first ); @@ -269,7 +270,7 @@ if ( !defined($output) || $output eq 'n' ) { print N "\n};\n\n"; print N "/* and the corresponding opcodes */\n"; - print N "static const enum opcode ico[] = {"; + print N "const enum opcode nasm_cond_insn_opcodes[] = {"; $first = 1; foreach $i (@opcodes_cc) { print N "," if ( !$first ); @@ -278,7 +279,6 @@ if ( !defined($output) || $output eq 'n' ) { } print N "\n};\n"; - close N; } |