From ff96ae3ffb391fd75c4737a17461f8bb36d7e915 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 6 Sep 2020 19:57:11 +0300 Subject: [PATCH 1/8] travis: warnstack -- fix spaces We use tabs in json so make it consistent. No functional change. Signed-off-by: Cyrill Gorcunov --- travis/test/warnstack.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/travis/test/warnstack.json b/travis/test/warnstack.json index c462b75b..43dba671 100644 --- a/travis/test/warnstack.json +++ b/travis/test/warnstack.json @@ -1,11 +1,11 @@ [ { "description": "Test warning stack", - "id": "warnstack", - "format": "bin", - "source": "warnstack.asm", - "option": "-Ox", - "target": [ + "id": "warnstack", + "format": "bin", + "source": "warnstack.asm", + "option": "-Ox", + "target": [ { "output": "warnstack.bin" }, { "stderr": "warnstack.stderr" } ] From 463600ac229c71ef9a4075d960cab8dfd031bab0 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 6 Sep 2020 20:02:53 +0300 Subject: [PATCH 2/8] travis: nasm-t -- fix --error option Write "expected" or "over" if requested. Signed-off-by: Cyrill Gorcunov --- travis/nasm-t.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/travis/nasm-t.py b/travis/nasm-t.py index 2470ad45..adcdbab9 100755 --- a/travis/nasm-t.py +++ b/travis/nasm-t.py @@ -63,7 +63,7 @@ for cmd in ['new']: required = False) spp.add_argument('--error', dest = 'error', - help = 'Set to "y" if test is supposed to fail', + help = '"y" if test is supposed to fail or "i" to ignore', required = False) spp.add_argument('--output', dest = 'output', default = 'y', @@ -500,7 +500,9 @@ if args.cmd == 'new': if args.ref: acc.append("\t\t\"ref\": \"{}\"".format(args.ref)) if args.error == 'y': - acc.append("\t\t\"error\": \"true\"") + acc.append("\t\t\"error\": \"expected\"") + elif args.error == 'i': + acc.append("\t\t\"error\": \"over\"") f.write(",\n".join(acc).encode("utf-8")) if args.output or args.stdout or args.stderr: acc = [] From 08996ec2e522512bef26df766b3e45068fe825e1 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 6 Sep 2020 20:12:01 +0300 Subject: [PATCH 3/8] travis: add br3392707 Signed-off-by: Cyrill Gorcunov --- travis/test/br3392707-error.stderr | 1 + travis/test/br3392707.asm | 23 +++++++++++++++++++++++ travis/test/br3392707.bin.t | Bin 0 -> 531 bytes travis/test/br3392707.json | 22 ++++++++++++++++++++++ travis/test/br3392707.stderr | 22 ++++++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 travis/test/br3392707-error.stderr create mode 100644 travis/test/br3392707.asm create mode 100644 travis/test/br3392707.bin.t create mode 100644 travis/test/br3392707.json create mode 100644 travis/test/br3392707.stderr diff --git a/travis/test/br3392707-error.stderr b/travis/test/br3392707-error.stderr new file mode 100644 index 00000000..837c1842 --- /dev/null +++ b/travis/test/br3392707-error.stderr @@ -0,0 +1 @@ +./travis/test/br3392707.asm:6: error: expecting `)' \ No newline at end of file diff --git a/travis/test/br3392707.asm b/travis/test/br3392707.asm new file mode 100644 index 00000000..82e1676b --- /dev/null +++ b/travis/test/br3392707.asm @@ -0,0 +1,23 @@ + bits 32 + + db 33 + db (44) +%ifdef ERROR + db (44,55) +%endif + db %(44.55) + db %('XX','YY') + db ('AA') + db %('BB') + db ? + db 6 dup (33) + db 6 dup (33, 34) + db 6 dup (33, 34), 35 + db 7 dup (99) + db 7 dup (?,?) + dw byte (?,44) + + dw 0xcc, 4 dup byte ('PQR'), ?, 0xabcd + + dd 16 dup (0xaaaa, ?, 0xbbbbbb) + dd 64 dup (?) diff --git a/travis/test/br3392707.bin.t b/travis/test/br3392707.bin.t new file mode 100644 index 0000000000000000000000000000000000000000..59212a9cf89da2b38f3ab27e00d9fb9d1ce682ce GIT binary patch literal 531 zcmY$?Nsfq!jC6EzVo-ztB}J@IIT->NP=U@FhJe5zIAUNpyL#0sh?3pAcQXt{HmV0l G9uEMXUq~hZ literal 0 HcmV?d00001 diff --git a/travis/test/br3392707.json b/travis/test/br3392707.json new file mode 100644 index 00000000..158d39c9 --- /dev/null +++ b/travis/test/br3392707.json @@ -0,0 +1,22 @@ +[ + { + "description": "Test br3392707", + "id": "br3392707", + "format": "bin", + "source": "br3392707.asm", + "option": "-Ox", + "target": [ + { "output": "br3392707.bin" }, + { "stderr": "br3392707.stderr" } + ] + }, + { + "description": "Test br3392707 (error)", + "ref": "br3392707", + "option": "-o br3392707.bin -DERROR -Ox", + "target": [ + { "stderr": "br3392707-error.stderr" } + ], + "error": "expected" + } +] diff --git a/travis/test/br3392707.stderr b/travis/test/br3392707.stderr new file mode 100644 index 00000000..50b45dd2 --- /dev/null +++ b/travis/test/br3392707.stderr @@ -0,0 +1,22 @@ +./travis/test/br3392707.asm:10: warning: byte data exceeds bounds [-w+number-overflow] +./travis/test/br3392707.asm:12: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:17: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:18: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:20: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:22: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] +./travis/test/br3392707.asm:23: warning: uninitialized space declared in .text section: zeroing [-w+zeroing] \ No newline at end of file From 61265ecd15836a2d1fe696a6befcbc9a77cb39a0 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 7 Sep 2020 09:57:00 +0300 Subject: [PATCH 4/8] travis: add br3392442 Signed-off-by: Cyrill Gorcunov --- travis/test/br3392442.asm | 4 ++++ travis/test/br3392442.bin.t | Bin 0 -> 20 bytes travis/test/br3392442.json | 13 +++++++++++++ travis/test/br3392442.stderr | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 travis/test/br3392442.asm create mode 100644 travis/test/br3392442.bin.t create mode 100644 travis/test/br3392442.json create mode 100644 travis/test/br3392442.stderr diff --git a/travis/test/br3392442.asm b/travis/test/br3392442.asm new file mode 100644 index 00000000..5b19f09e --- /dev/null +++ b/travis/test/br3392442.asm @@ -0,0 +1,4 @@ + and byte [0], ~80h + and byte [0], 0xfff + and byte [0], -256 + and byte [0], -257 diff --git a/travis/test/br3392442.bin.t b/travis/test/br3392442.bin.t new file mode 100644 index 0000000000000000000000000000000000000000..c5c9e785b411fb18b4b89cb5d048c43a6b224c97 GIT binary patch literal 20 UcmZorV_>Ln022Q}1Ou1_05i-5761SM literal 0 HcmV?d00001 diff --git a/travis/test/br3392442.json b/travis/test/br3392442.json new file mode 100644 index 00000000..c0fd5e12 --- /dev/null +++ b/travis/test/br3392442.json @@ -0,0 +1,13 @@ +[ + { + "description": "Test br3392442", + "id": "br3392442", + "format": "bin", + "source": "br3392442.asm", + "option": "-Ox", + "target": [ + { "output": "br3392442.bin" }, + { "stderr": "br3392442.stderr" } + ] + } +] diff --git a/travis/test/br3392442.stderr b/travis/test/br3392442.stderr new file mode 100644 index 00000000..cce8581a --- /dev/null +++ b/travis/test/br3392442.stderr @@ -0,0 +1,2 @@ +./travis/test/br3392442.asm:2: warning: byte data exceeds bounds [-w+number-overflow] +./travis/test/br3392442.asm:4: warning: byte data exceeds bounds [-w+number-overflow] \ No newline at end of file From 52848e8abacb690d1a4eeb5055aca8303ca06fca Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 4 Sep 2020 11:33:38 -0700 Subject: [PATCH 5/8] doc: improve documentation of %ifid et al Clarify some of the semantics of %ifid, %ifnum, and %ifstr. Signed-off-by: H. Peter Anvin (Intel) --- doc/changes.src | 4 ++-- doc/nasmdoc.src | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index 7b9665a2..8aab8fc5 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -9,8 +9,8 @@ since 2007. \S{cl-2.15.05} Version 2.15.05 -\b Correct \c{%ifid $} and \c{%ifid $$} being treated as true. See -\k{iftyp}. +\b Fix \c{%ifid $} and \c{%ifid $$} incorrectly being treated as +true. See \k{iftyp}. \b Add \c{--reproducible} option to suppress NASM version numbers and timestamps in output files. See \k{opt-reproducible}. diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index efbf3b23..3c4f2093 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -3376,9 +3376,13 @@ string. The conditional assembly construct \c{%ifid}, taking one parameter (which may be blank), assembles the subsequent code if and only if -the first token in the parameter exists and is an identifier. -\c{%ifnum} works similarly, but tests for the token being a numeric -constant; \c{%ifstr} tests for it being a string. +\e{the first token} in the parameter exists and is an +identifier. \c{$} and \c{$$} are \e{not} considered identifiers by +\c{%ifid}. + +\c{%ifnum} works similarly, but tests for the token being an integer +numeric constant (not an expression!) possibly preceeded by \c{+} or +\c{-}; \c{%ifstr} tests for it being a quoted string. For example, the \c{writefile} macro defined in \k{mlmacgre} can be extended to take advantage of \c{%ifstr} in the following fashion: From eeccbfe6ece196ab29d51bf070f805e75a83a43e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 11 Sep 2020 16:27:29 -0700 Subject: [PATCH 6/8] .gitignore: ignore timestamp (*.time) files Ignore timestamp files, they are transient. Signed-off-by: H. Peter Anvin (Intel) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b22d2ab8..9e2e643c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ *.srec *.si *.swp +*.time *.win32 *.win64 *.xml From 1a3bf7a3d714f4205c12db0b1cdfe5f2f36a6a3b Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 11 Sep 2020 17:43:38 -0700 Subject: [PATCH 7/8] warnings.pl: again, don't update the timestamp unless we need to Don't update the timestamp unless we really have to do so. Signed-off-by: H. Peter Anvin (Intel) --- asm/warnings.pl | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/asm/warnings.pl b/asm/warnings.pl index 6660d17a..11356860 100755 --- a/asm/warnings.pl +++ b/asm/warnings.pl @@ -279,17 +279,20 @@ if ($what eq 'c') { close($out); # Write data to file if and only if it has changed -# Windows requires append mode here -open($out, '+>>', $outfile) - or die "$0: cannot open output file $outfile: $!\n"; -my $datalen = length($outdata); -my $oldlen = read($out, my $oldoutdata, $datalen+1); -if (!defined($oldlen) || $oldlen != $datalen || - !($oldoutdata eq $outdata)) { - # Data changed, must rewrite - truncate($out, 0); - seek($out, 0, SEEK_SET) - or die "$0: cannot rewind output file $outfile: $!\n"; - print $out $outdata; +# For some systems, even if we don't write, opening for append +# apparently touches the timestamp, so we need to read and write +# as separate operations. +if (open(my $out, '<', $outfile)) { + my $datalen = length($outdata); + my $oldlen = read($out, my $oldoutdata, $datalen+1); + close($out); + exit 0 if (defined($oldlen) && $oldlen == $datalen && + ($oldoutdata eq $outdata)); } + +# Data changed, must rewrite +open(my $out, '>', $outfile) + or die "$0: cannot open output file $outfile: $!\n"; + +print $out $outdata; close($out); From d85890aac74040abbddb32052f72eda0f52f4039 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 11 Sep 2020 18:11:51 -0700 Subject: [PATCH 8/8] Makefile.in: fix warning dependencies Fix circular dependency on asm/warnings.c by factoring out warnings.$(O) from the dependencies, and use a separate .time which "generate" the main source file as a "side effect", giving us a null target. Signed-off-by: H. Peter Anvin (Intel) --- Makefile.in | 59 +++++++++++++++++++++++++++++--------------- Mkfiles/msvc.mak | 36 +++++++++++++++++++++------ Mkfiles/openwcom.mak | 36 +++++++++++++++++++++------ 3 files changed, 95 insertions(+), 36 deletions(-) diff --git a/Makefile.in b/Makefile.in index baca4396..924ba9d6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ ifeq ($(TRACE),1) endif .SUFFIXES: -.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt +.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt .time .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf test .PHONY: install_doc everything install_everything strip perlreq dist tags TAGS @@ -100,7 +100,10 @@ endif NASM = asm/nasm.$(O) NDISASM = disasm/ndisasm.$(O) -LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ +PROGOBJ = $(NASM) $(NDISASM) +PROGS = nasm$(X) ndisasm$(X) + +LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) \ \ nasmlib/ver.$(O) \ @@ -122,7 +125,7 @@ LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ x86/regs.$(O) x86/regvals.$(O) x86/regflags.$(O) x86/regdis.$(O) \ x86/disp8.$(O) x86/iflag.$(O) \ \ - asm/error.$(O) asm/warnings.$(O) \ + asm/error.$(O) \ asm/floats.$(O) \ asm/directiv.$(O) asm/directbl.$(O) \ asm/pragma.$(O) \ @@ -147,7 +150,12 @@ LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ \ disasm/disasm.$(O) disasm/sync.$(O) -ALLOBJ = $(NASM) $(NDISASM) $(LIBOBJ) +# Warnings depend on all source files, so handle them separately +WARNOBJ = asm/warnings.$(O) + +LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ) +ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW) +ALLOBJ = $(PROGOBJ) $(LIBOBJ) SUBDIRS = stdlib nasmlib output asm disasm x86 common macros XSUBDIRS = test doc nsis rdoff @@ -155,7 +163,7 @@ DEPDIRS = . include config x86 rdoff $(SUBDIRS) #-- End File Lists --# all: dirs - $(MAKE) nasm$(X) ndisasm$(X) rdf + $(MAKE) $(PROGS) rdf NASMLIB = libnasm.$(A) @@ -271,18 +279,30 @@ warnings: $(RM_F) $(WARNFILES) $(MAKE) asm/warnings.time -asm/warnings.time: $(ALLOBJ:.@OBJEXT@=.c) +asm/warnings.time: $(ALLOBJ_NW:.$(O)=.c) : > asm/warnings.time - $(MAKE) $(WARNFILES) + $(MAKE) $(WARNFILES:=.time) -asm/warnings.c: asm/warnings.pl asm/warnings.time +asm/warnings.c.time: asm/warnings.pl asm/warnings.time $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings.c $(srcdir) + : > asm/warnings.c.time -include/warnings.h: asm/warnings.pl asm/warnings.time +asm/warnings.c: asm/warnings.c.time + @: Side effect + +include/warnings.h.time: asm/warnings.pl asm/warnings.time $(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h $(srcdir) + : > include/warnings.h.time -doc/warnings.src: asm/warnings.pl asm/warnings.time +include/warnings.h: include/warnings.h.time + @: Side effect + +doc/warnings.src.time: asm/warnings.pl asm/warnings.time $(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src $(srcdir) + : > doc/warnings.src.time + +doc/warnings.src : doc/warnings.src.time + @: Side effect # Assembler token hash asm/tokhash.c: x86/insns.dat x86/regs.dat asm/tokens.dat asm/tokhash.pl \ @@ -385,10 +405,9 @@ nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh # Generated manpages, also pregenerated for distribution manpages: nasm.1 ndisasm.1 -install: nasm$(X) ndisasm$(X) +install: $(PROGS) $(MKDIR_P) $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) nasm$(X) $(DESTDIR)$(bindir)/nasm$(X) - $(INSTALL_PROGRAM) ndisasm$(X) $(DESTDIR)$(bindir)/ndisasm$(X) + $(INSTALL_PROGRAM) $(PROGS) $(DESTDIR)$(bindir)/ $(MKDIR_P) $(DESTDIR)$(mandir)/man1 $(INSTALL_DATA) $(srcdir)/nasm.1 $(DESTDIR)$(mandir)/man1/nasm.1 $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(DESTDIR)$(mandir)/man1/ndisasm.1 @@ -397,7 +416,7 @@ clean: for d in . $(SUBDIRS) $(XSUBDIRS); do \ $(RM_F) "$$d"/*.$(O) "$$d"/*.s "$$d"/*.i "$$d"/*.$(A) ; \ done - $(RM_F) nasm$(X) ndisasm$(X) + $(RM_F) $(PROGS) $(RM_F) nasm-*-installer-*.exe $(RM_F) tags TAGS $(RM_F) nsis/arch.nsh @@ -412,18 +431,18 @@ distclean: clean done $(RM_F) test/*.$(O) $(RM_RF) autom4te*.cache - $(RM_F) Makefile *.dep asm/warnings.time + $(RM_F) Makefile *.dep cleaner: clean $(RM_F) $(PERLREQ) *.1 nasm.spec $(MAKE) -C doc clean - $(RM_F) *.dep asm/warnings.time + $(RM_F) *.dep */*.time spotless: distclean cleaner $(RM_F) doc/Makefile strip: - $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X) + $(STRIP) --strip-unneeded $(PROGS) TAGS: $(RM_F) TAGS @@ -496,13 +515,13 @@ nasm.spec: nasm.spec.in nasm.spec.sed version.sed perlbreq.si splint: splint -weak *.c -test: nasm$(X) +test: $(PROGS) cd test && $(RUNPERL) performtest.pl --nasm=../nasm *.asm -golden: nasm$(X) +golden: $(PROGS) cd test && $(RUNPERL) performtest.pl --golden --nasm=../nasm *.asm -travis: nasm$(X) +travis: $(PROGS) $(PYTHON3) travis/nasm-t.py run # diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index ee2022d3..f0b3944b 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -64,7 +64,10 @@ X = .exe NASM = asm\nasm.$(O) NDISASM = disasm\ndisasm.$(O) -LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) \ +PROGOBJ = $(NASM) $(NDISASM) +PROGS = nasm$(X) ndisasm$(X) + +LIBOBJ_NW = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) \ stdlib\strnlen.$(O) stdlib\strrchrnul.$(O) \ \ nasmlib\ver.$(O) \ @@ -86,7 +89,7 @@ LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) \ x86\regs.$(O) x86\regvals.$(O) x86\regflags.$(O) x86\regdis.$(O) \ x86\disp8.$(O) x86\iflag.$(O) \ \ - asm\error.$(O) asm\warnings.$(O) \ + asm\error.$(O) \ asm\floats.$(O) \ asm\directiv.$(O) asm\directbl.$(O) \ asm\pragma.$(O) \ @@ -111,7 +114,12 @@ LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) \ \ disasm\disasm.$(O) disasm\sync.$(O) -ALLOBJ = $(NASM) $(NDISASM) $(LIBOBJ) +# Warnings depend on all source files, so handle them separately +WARNOBJ = asm\warnings.$(O) + +LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ) +ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW) +ALLOBJ = $(PROGOBJ) $(LIBOBJ) SUBDIRS = stdlib nasmlib output asm disasm x86 common macros XSUBDIRS = test doc nsis rdoff @@ -230,18 +238,30 @@ warnings: $(RM_F) $(WARNFILES) $(MAKE) asm\warnings.time -asm\warnings.time: $(ALLOBJ:.@OBJEXT@=.c) +asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c) : > asm\warnings.time - $(MAKE) $(WARNFILES) + $(MAKE) $(WARNFILES:=.time) -asm\warnings.c: asm\warnings.pl asm\warnings.time +asm\warnings.c.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir) + : > asm\warnings.c.time -include\warnings.h: asm\warnings.pl asm\warnings.time +asm\warnings.c: asm\warnings.c.time + @: Side effect + +include\warnings.h.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h $(srcdir) + : > include\warnings.h.time -doc\warnings.src: asm\warnings.pl asm\warnings.time +include\warnings.h: include\warnings.h.time + @: Side effect + +doc\warnings.src.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src $(srcdir) + : > doc\warnings.src.time + +doc\warnings.src : doc\warnings.src.time + @: Side effect # Assembler token hash asm\tokhash.c: x86\insns.dat x86\regs.dat asm\tokens.dat asm\tokhash.pl \ diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index 9d080290..ab49a3a5 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -53,7 +53,10 @@ X = .exe NASM = asm\nasm.$(O) NDISASM = disasm\ndisasm.$(O) -LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) & +PROGOBJ = $(NASM) $(NDISASM) +PROGS = nasm$(X) ndisasm$(X) + +LIBOBJ_NW = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) & stdlib\strnlen.$(O) stdlib\strrchrnul.$(O) & & nasmlib\ver.$(O) & @@ -75,7 +78,7 @@ LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) & x86\regs.$(O) x86\regvals.$(O) x86\regflags.$(O) x86\regdis.$(O) & x86\disp8.$(O) x86\iflag.$(O) & & - asm\error.$(O) asm\warnings.$(O) & + asm\error.$(O) & asm\floats.$(O) & asm\directiv.$(O) asm\directbl.$(O) & asm\pragma.$(O) & @@ -100,7 +103,12 @@ LIBOBJ = stdlib\snprintf.$(O) stdlib\vsnprintf.$(O) stdlib\strlcpy.$(O) & & disasm\disasm.$(O) disasm\sync.$(O) -ALLOBJ = $(NASM) $(NDISASM) $(LIBOBJ) +# Warnings depend on all source files, so handle them separately +WARNOBJ = asm\warnings.$(O) + +LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ) +ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW) +ALLOBJ = $(PROGOBJ) $(LIBOBJ) SUBDIRS = stdlib nasmlib output asm disasm x86 common macros XSUBDIRS = test doc nsis rdoff @@ -243,18 +251,30 @@ warnings: $(RM_F) $(WARNFILES) $(MAKE) asm\warnings.time -asm\warnings.time: $(ALLOBJ:.@OBJEXT@=.c) +asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c) : > asm\warnings.time - $(MAKE) $(WARNFILES) + $(MAKE) $(WARNFILES:=.time) -asm\warnings.c: asm\warnings.pl asm\warnings.time +asm\warnings.c.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir) + : > asm\warnings.c.time -include\warnings.h: asm\warnings.pl asm\warnings.time +asm\warnings.c: asm\warnings.c.time + @: Side effect + +include\warnings.h.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h $(srcdir) + : > include\warnings.h.time -doc\warnings.src: asm\warnings.pl asm\warnings.time +include\warnings.h: include\warnings.h.time + @: Side effect + +doc\warnings.src.time: asm\warnings.pl asm\warnings.time $(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src $(srcdir) + : > doc\warnings.src.time + +doc\warnings.src : doc\warnings.src.time + @: Side effect # Assembler token hash asm\tokhash.c: x86\insns.dat x86\regs.dat asm\tokens.dat asm\tokhash.pl &