summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-13 14:29:47 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-13 14:29:47 -0700
commit2c94c44f35f3406f64765fe1f78448788580fcaf (patch)
tree714f1ce146079c125d6a1aea2f4979170ecff12a
parent0a4d23219ec3237e5ca54e9ff06a44cfdcd9581a (diff)
downloadnasm-2c94c44f35f3406f64765fe1f78448788580fcaf.tar.gz
nasm-2c94c44f35f3406f64765fe1f78448788580fcaf.tar.bz2
nasm-2c94c44f35f3406f64765fe1f78448788580fcaf.zip
Make insnsb.c an actual compilation unit
"make alldeps" doesn't really like it when included files end in *.c. Instead of renaming insnsb.c to insnsb.h, make it an actual compilation unit, since there really isn't any reason for it not to be.
-rw-r--r--Makefile.in15
-rw-r--r--Mkfiles/msvc.mak15
-rw-r--r--Mkfiles/netware.mak10
-rw-r--r--Mkfiles/openwcom.mak15
-rw-r--r--Mkfiles/owlinux.mak15
-rw-r--r--insns.h3
-rw-r--r--insns.pl8
7 files changed, 46 insertions, 35 deletions
diff --git a/Makefile.in b/Makefile.in
index a0308c0..914c874 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -58,8 +58,8 @@ X = @EXEEXT@
.1.man:
$(NROFF) -man $< > $@
-NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
- labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) insnsb.$(O) \
+ assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
outform.$(O) output/outbin.$(O) \
output/outaout.$(O) output/outcoff.$(O) \
output/outelf32.$(O) output/outelf64.$(O) \
@@ -68,7 +68,8 @@ NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
preproc.$(O) pptok.$(O) \
listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
-NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
+ insnsd.$(O) insnsb.$(O)
all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
cd rdoff && $(MAKE) all
@@ -240,12 +241,12 @@ float.$(O): float.c compiler.h config.h float.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
hashtbl.$(O): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
nasmlib.h regs.h version.h
-insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
+insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
+ regs.h tokens.h version.h
insnsb.$(O): insnsb.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
regs.h tokens.h version.h
-insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
+ regs.h tokens.h version.h
insnsn.$(O): insnsn.c
labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
nasmlib.h regs.h version.h
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index e154634..e4b4db2 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -32,8 +32,8 @@ X = .exe
.c.obj:
$(CC) /c $(ALL_CFLAGS) /Fo$@ $<
-NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
- labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) insnsb.$(O) \
+ assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
outform.$(O) output/outbin.$(O) \
output/outaout.$(O) output/outcoff.$(O) \
output/outelf32.$(O) output/outelf64.$(O) \
@@ -42,7 +42,8 @@ NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
preproc.$(O) pptok.$(O) \
listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
-NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
+ insnsd.$(O) insnsb.$(O)
all: nasm$(X) ndisasm$(X)
rem cd rdoff && $(MAKE) all
@@ -188,12 +189,12 @@ float.$(O): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h regs.h \
version.h
hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
-insnsa.$(O): insnsa.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
insnsb.$(O): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
tokens.h version.h
-insnsd.$(O): insnsd.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
insnsn.$(O): insnsn.c
labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
version.h
diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak
index 639b138..62c89be 100644
--- a/Mkfiles/netware.mak
+++ b/Mkfiles/netware.mak
@@ -31,6 +31,7 @@ NASM_OBJ = \
$(OBJDIR)/nasmlib.o\
$(OBJDIR)/float.o\
$(OBJDIR)/insnsa.o\
+ $(OBJDIR)/insnsb.o\
$(OBJDIR)/assemble.o\
$(OBJDIR)/labels.o\
$(OBJDIR)/hashtbl.o\
@@ -63,6 +64,7 @@ NDIS_OBJ = \
$(OBJDIR)/disasm.o\
$(OBJDIR)/sync.o\
$(OBJDIR)/insnsd.o\
+ $(OBJDIR)/insnsb.o\
$(EOLIST)
VPATH = *.c $(PROOT) $(PROOT)/output
@@ -151,12 +153,12 @@ float.o: float.c compiler.h config.h float.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
hashtbl.o: hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
-insnsa.o: insnsa.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
+insnsa.o: insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
+ regs.h tokens.h version.h
insnsb.o: insnsb.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
regs.h tokens.h version.h
-insnsd.o: insnsd.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
- nasmlib.h regs.h tokens.h version.h
+insnsd.o: insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
+ regs.h tokens.h version.h
insnsn.o: insnsn.c
labels.o: labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak
index a9cc5c7..5168e90 100644
--- a/Mkfiles/openwcom.mak
+++ b/Mkfiles/openwcom.mak
@@ -44,8 +44,8 @@ X = .exe
$(CC) -c $(ALL_CFLAGS) -fo=$^@ $[@
# Note: wcl386 is broken if forward slashes are used as path separators.
-NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) &
- labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) &
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) insnsb.$(O) &
+ assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) &
outform.$(O) output\outbin.$(O) &
output\outaout.$(O) output\outcoff.$(O) &
output\outelf32.$(O) output\outelf64.$(O) &
@@ -54,7 +54,8 @@ NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) &
preproc.$(O) pptok.$(O) &
listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
-NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) &
+ insnsd.$(O) insnsb.$(O)
what: .SYMBOLIC
@echo Please build "dos", "win32" or "os2"
@@ -214,12 +215,12 @@ float.$(O): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h regs.h &
version.h
hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h &
regs.h version.h
-insnsa.$(O): insnsa.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h &
- regs.h tokens.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
insnsb.$(O): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
tokens.h version.h
-insnsd.$(O): insnsd.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h &
- regs.h tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h &
+ tokens.h version.h
insnsn.$(O): insnsn.c
labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h &
version.h
diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak
index ce369ed..1306bad 100644
--- a/Mkfiles/owlinux.mak
+++ b/Mkfiles/owlinux.mak
@@ -55,8 +55,8 @@ X = .exe
.c.$(O):
$(CC) -c $(ALL_CFLAGS) -fo=$@ $<
-NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
- labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
+NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) insnsb.$(O) \
+ assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
outform.$(O) output/outbin.$(O) \
output/outaout.$(O) output/outcoff.$(O) \
output/outelf32.$(O) output/outelf64.$(O) \
@@ -65,7 +65,8 @@ NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
preproc.$(O) pptok.$(O) \
listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
-NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
+NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
+ insnsd.$(O) insnsb.$(O)
what:
@echo 'Please build "dos", "win32" or "os2"'
@@ -224,12 +225,12 @@ float.$(O): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h regs.h \
version.h
hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
regs.h version.h
-insnsa.$(O): insnsa.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
+insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
insnsb.$(O): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
tokens.h version.h
-insnsd.$(O): insnsd.c compiler.h insns.h insnsb.c insnsi.h nasm.h nasmlib.h \
- regs.h tokens.h version.h
+insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
+ tokens.h version.h
insnsn.$(O): insnsn.c
labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
version.h
diff --git a/insns.h b/insns.h
index 49cdc8c..474e715 100644
--- a/insns.h
+++ b/insns.h
@@ -33,6 +33,9 @@ struct disasm_index {
extern const struct itemplate * const nasm_instructions[];
extern const struct disasm_index itable[256];
+/* Common table for the byte codes */
+extern const uint8_t nasm_bytecodes[];
+
/*
* this define is used to signify the end of an itemplate
*/
diff --git a/insns.pl b/insns.pl
index 0110121..f3f2f8f 100644
--- a/insns.pl
+++ b/insns.pl
@@ -109,7 +109,7 @@ if ( !defined($output) || $output eq 'b') {
print B "#include \"nasm.h\"\n";
print B "#include \"insns.h\"\n\n";
- print B "static const uint8_t nasm_bytecodes[$bytecode_next] = {\n";
+ print B "const uint8_t nasm_bytecodes[$bytecode_next] = {\n";
$p = 0;
foreach $bl (@bytecode_array) {
@@ -133,7 +133,8 @@ if ( !defined($output) || $output eq 'a' ) {
print A "/* This file auto-generated from insns.dat by insns.pl" .
" - don't edit it */\n\n";
- print A "#include \"insnsb.c\"\n\n";
+ print A "#include \"nasm.h\"\n";
+ print A "#include \"insns.h\"\n\n";
foreach $i (@opcodes, @opcodes_cc) {
print A "static const struct itemplate instrux_${i}[] = {\n";
@@ -160,7 +161,8 @@ if ( !defined($output) || $output eq 'd' ) {
print D "/* This file auto-generated from insns.dat by insns.pl" .
" - don't edit it */\n\n";
- print D "#include \"insnsb.c\"\n\n";
+ print D "#include \"nasm.h\"\n";
+ print D "#include \"insns.h\"\n\n";
print D "static const struct itemplate instrux[] = {\n";
$n = 0;