Skip to content

Commit b11cd3a

Browse files
author
H. Peter Anvin
committed
warnings: more improvements to warnings generation
Try to better sort out the necessary dependencies for warning generation. Fix regex for cleaning up nasmdoc markup: nasmdoc markup does not nest, although it may include \} sequences. Signed-off-by: H. Peter Anvin <[email protected]>
1 parent 5a03edf commit b11cd3a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Makefile.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ ifeq ($(TRACE),1)
7979
CFLAGS += -DNASM_TRACE
8080
endif
8181

82+
# Don't delete intermediate files
83+
.SECONDARY:
84+
85+
# Delete files on error
86+
.DELETE_ON_ERROR:
87+
8288
.SUFFIXES:
8389
.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt .time
8490

@@ -191,7 +197,7 @@ ndisasm$(X): $(NDISASM) $(MANIFEST) $(NASMLIB)
191197

192198
# These are specific to certain Makefile syntaxes...
193199
WARNTIMES = $(WARNFILES:=.time)
194-
WARNSRCS = $(LIBOBJ_NW:.$(O)=.c)
200+
WARNSRCS = $(LIBOBJ_NW:.$(O)=.c) asm/nasm.c
195201

196202
#-- Begin Generated File Rules --#
197203

@@ -286,11 +292,12 @@ x86/regs.h: x86/regs.dat x86/regs.pl
286292
# reasonable, but doesn't update the time stamp if the files aren't
287293
# changed, to avoid rebuilding everything every time. Track the actual
288294
# dependency by the empty file asm/warnings.time.
295+
.PHONY: warnings
289296
warnings:
290-
$(RM_F) $(WARNFILES) $(WARNTIMES)
297+
$(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time
291298
$(MAKE) asm/warnings.time
292299

293-
asm/warnings.time: $(WARNSRCS)
300+
asm/warnings.time: $(WARNSRCS) asm/warnings.pl
294301
$(EMPTY) asm/warnings.time
295302
$(MAKE) $(WARNTIMES)
296303

asm/warnings.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ (@)
1818
return $s;
1919
}
2020

21+
# Remove a subset of nasmdoc markup
2122
sub remove_markup(@) {
2223
my $s = join('', @_);
2324

24-
$s =~ s/\\[\w+](\{((?:(?>[^{}]+)|(?1))*)\})?/$2/g;
25+
$s =~ s/\\[\w+](?:\{((?:[^\}]|\\\})*)\})/$1/g;
2526
$s =~ s/\\(\W)/$1/g;
2627
return $s;
2728
}

doc/Makefile.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ SRCS = nasmdoc.src inslist.src changes.src warnings.src version.src
4343
OUT = html nasmdoc.txt nasmdoc.pdf $(XZFILES)
4444
XZOUT = nasmdoc.pdf.xz
4545

46+
# Don't delete intermediate files
47+
.SECONDARY:
48+
49+
# Delete files on error
50+
.DELETE_ON_ERROR:
51+
4652
.SUFFIXES:
4753
.SUFFIXES: .pfa .ph
4854

0 commit comments

Comments
 (0)