Skip to content

Commit cd5dfb8

Browse files
author
H. Peter Anvin
committed
warnings: always regenerate outputs; tidy up unnecessary rules
With warnings disaggregated, there is no reason to play games with not updating the output timestamp. Always write the files as usual. Remove unnecessary Makefile rules. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> 1# Please enter the commit message for your changes. Lines starting
1 parent 69f1aa6 commit cd5dfb8

File tree

4 files changed

+40
-20
lines changed

4 files changed

+40
-20
lines changed

Makefile.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ NDISASM = disasm/ndisasm.$(O)
134134
PROGOBJ = $(NASM) $(NDISASM)
135135
PROGS = nasm$(X) ndisasm$(X)
136136

137-
# Files dependent on extracted warnings
137+
# Files dependent on warnings.dat
138138
WARNOBJ = asm/warnings.$(O)
139139
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
140140

@@ -260,9 +260,6 @@ ndisasm$(X): $(NDISASM) $(MANIFEST) $(DISLIB) $(NASMLIB)
260260
$(CC) $(ALL_LDFLAGS) -o $@ $(NDISASM) $(MANIFEST) \
261261
$(DISLIB) $(NASMLIB) $(LIBS)
262262

263-
# These are specific to certain Makefile syntaxes...
264-
WARNSRCS = $(ALLOBJ_W:.$(O)=.c)
265-
266263
# Make sure we have subdirectories set up...
267264
$(LIBOBJ) $(LIBOBJ_DIS): $(DIRS)
268265

@@ -532,7 +529,7 @@ editor_builtin: nasm$(X)
532529

533530
dist:
534531
$(MAKE) alldeps
535-
$(MAKE) perlreq warnings spec
532+
$(MAKE) perlreq spec
536533
$(MAKE) editor_builtin
537534
$(MAKE) editors $(MANPAGES)
538535
$(MAKE) distclean

Mkfiles/msvc.mak

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,25 @@ editors\nasmtok.json: editors\nasmtok.pl asm\tokhash.c asm\pptok.c \
344344
version.mak
345345
$(RUNPERL) $(srcdir)\editors\nasmtok.pl -json $@ $(srcdir) $(objdir)
346346

347-
editors: $(EDITORS)
347+
editors: $(EDITORS) $(PHONY)
348+
349+
asm\warnings_c.h: asm\warnings.pl asm\warnings.dat
350+
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h \
351+
$(srcdir)\asm\warnings.dat
352+
353+
include\warnings.h: asm\warnings.pl asm\warnings.dat
354+
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h \
355+
$(srcdir)\asm\warnings.dat
356+
357+
doc\warnings.src: asm\warnings.pl asm\warnings.dat
358+
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src \
359+
$(srcdir)\asm\warnings.dat
360+
361+
$(PERLREQ): $(DIRS)
362+
363+
perlreq: $(PERLREQ) $(PHONY)
364+
365+
warnings: $(WARNFILES) $(PHONY)
348366

349367
#-- End Generated File Rules --#
350368

Mkfiles/openwcom.mak

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,25 @@ editors\nasmtok.json: editors\nasmtok.pl asm\tokhash.c asm\pptok.c &
353353
version.mak
354354
$(RUNPERL) $(srcdir)\editors\nasmtok.pl -json $@ $(srcdir) $(objdir)
355355

356-
editors: $(EDITORS)
356+
editors: $(EDITORS) $(PHONY)
357+
358+
asm\warnings_c.h: asm\warnings.pl asm\warnings.dat
359+
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h &
360+
$(srcdir)\asm\warnings.dat
361+
362+
include\warnings.h: asm\warnings.pl asm\warnings.dat
363+
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h &
364+
$(srcdir)\asm\warnings.dat
365+
366+
doc\warnings.src: asm\warnings.pl asm\warnings.dat
367+
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src &
368+
$(srcdir)\asm\warnings.dat
369+
370+
$(PERLREQ): $(DIRS)
371+
372+
perlreq: $(PERLREQ) $(PHONY)
373+
374+
warnings: $(WARNFILES) $(PHONY)
357375

358376
#-- End Generated File Rules --#
359377

asm/warnings.pl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,6 @@ sub sort_warnings {
288288

289289
close($out);
290290

291-
# Write data to file if and only if it has changed
292-
# For some systems, even if we don't write, opening for append
293-
# apparently touches the timestamp, so we need to read and write
294-
# as separate operations.
295-
if (open(my $out, '<', $outfile)) {
296-
my $datalen = length($outdata);
297-
my $oldlen = read($out, my $oldoutdata, $datalen+1);
298-
close($out);
299-
exit 0 if (defined($oldlen) && $oldlen == $datalen &&
300-
($oldoutdata eq $outdata));
301-
}
302-
303-
# Data changed, must rewrite
304291
open(my $out, '>', $outfile)
305292
or die "$0: cannot open output file $outfile: $!\n";
306293

0 commit comments

Comments
 (0)