From dfacf9a3d7620e64b82c4ea203e992bf5e245abe Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 1 Oct 2025 13:45:03 -0700 Subject: [PATCH] Makefiles: remove warnings generation from auxiliary Makefiles The .time trick doesn't seem to work in general, and auxiliary Makefiles aren't guaranteed to build modified sources anyway. Signed-off-by: H. Peter Anvin (Intel) --- Makefile.in | 85 +++++++++++++++++++++++--------------------- Mkfiles/msvc.mak | 40 --------------------- Mkfiles/openwcom.mak | 40 --------------------- 3 files changed, 45 insertions(+), 120 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3c5be8837..c75fa6602 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,11 +121,8 @@ PROGOBJ = $(NASM) $(NDISASM) PROGS = nasm$(X) ndisasm$(X) # Files dependent on extracted warnings -# WARNTIMES is explicit to avoid breaking some apparently problematic make -# versions, e.g. Microsoft NMAKE WARNOBJ = asm/warnings.$(O) WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src -WARNTIMES = asm/warnings_c.h.time include/warnings.h.time doc/warnings.src.time OUTPUTOBJ = \ output/outform.$(O) output/outlib.$(O) \ @@ -341,43 +338,6 @@ x86/regs.h: x86/regs.dat x86/regs.pl $(RUNPERL) $(srcdir)/x86/regs.pl h \ $(srcdir)/x86/regs.dat > x86/regs.h -# Extract warnings from source code. This is done automatically if any -# C files have changed; the script is fast enough that that is -# reasonable, but doesn't update the time stamp if the files aren't -# changed, to avoid rebuilding everything every time. Track the actual -# dependency by the empty file asm/warnings.time. -.PHONY: warnings -warnings: - $(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time - $(MAKE) asm/warnings.time - -asm/warnings.time: $(WARNSRCS) asm/warnings.pl - $(EMPTY) asm/warnings.time - $(MAKE) $(WARNTIMES) - -asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time - $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h \ - $(srcdir) $(WARNSRCS) - $(EMPTY) asm/warnings_c.h.time - -asm/warnings_c.h: asm/warnings_c.h.time - $(SIDE) - -include/warnings.h.time: asm/warnings.pl asm/warnings.time - $(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h \ - $(srcdir) $(WARNSRCS) - $(EMPTY) include/warnings.h.time - -include/warnings.h: include/warnings.h.time - $(SIDE) - -doc/warnings.src.time: asm/warnings.pl asm/warnings.time - $(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src \ - $(srcdir) $(WARNSRCS) - $(EMPTY) doc/warnings.src.time - -doc/warnings.src : doc/warnings.src.time - $(SIDE) # Assembler token hash asm/tokhash.c: x86/insns.xda x86/insnsn.c asm/tokens.dat asm/tokhash.pl \ @@ -422,6 +382,51 @@ misc/nasmtok.el: misc/emacstbl.pl asm/tokhash.c asm/pptok.c \ #-- End Generated File Rules --# +# Extract warnings from source code. This is done automatically if any +# C files have changed; the script is fast enough that that is +# reasonable, but doesn't update the time stamp if the files aren't +# changed, to avoid rebuilding everything every time. Track the actual +# dependency by the empty file asm/warnings.time. +# +# This doesn't seem to work for non-Unix Makefile variants, so don't +# export those rules here (non-Unix Makefiles only guaranteed to build +# a distribution ball anyway.) + +WARNTIMES = $(WARNFILES:=.time) + +.PHONY: warnings +warnings: + $(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time + $(MAKE) asm/warnings.time + +asm/warnings.time: $(WARNSRCS) asm/warnings.pl + $(EMPTY) asm/warnings.time + $(MAKE) $(WARNTIMES) + +asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time + $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h \ + $(srcdir) $(WARNSRCS) + $(EMPTY) asm/warnings_c.h.time + +asm/warnings_c.h: asm/warnings_c.h.time + $(SIDE) + +include/warnings.h.time: asm/warnings.pl asm/warnings.time + $(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h \ + $(srcdir) $(WARNSRCS) + $(EMPTY) include/warnings.h.time + +include/warnings.h: include/warnings.h.time + $(SIDE) + +doc/warnings.src.time: asm/warnings.pl asm/warnings.time + $(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src \ + $(srcdir) $(WARNSRCS) + $(EMPTY) doc/warnings.src.time + +doc/warnings.src : doc/warnings.src.time + $(SIDE) + $(PERLREQ): $(DIRS) perlreq: $(PERLREQ) diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 6f9a8f067..d0ebcaac5 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -83,11 +83,8 @@ PROGOBJ = $(NASM) $(NDISASM) PROGS = nasm$(X) ndisasm$(X) # Files dependent on extracted warnings -# WARNTIMES is explicit to avoid breaking some apparently problematic make -# versions, e.g. Microsoft NMAKE WARNOBJ = asm\warnings.obj WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src -WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time OUTPUTOBJ = \ output\outform.obj output\outlib.obj \ @@ -291,43 +288,6 @@ x86\regs.h: x86\regs.dat x86\regs.pl $(RUNPERL) $(srcdir)\x86\regs.pl h \ $(srcdir)\x86\regs.dat > x86\regs.h -# Extract warnings from source code. This is done automatically if any -# C files have changed; the script is fast enough that that is -# reasonable, but doesn't update the time stamp if the files aren't -# changed, to avoid rebuilding everything every time. Track the actual -# dependency by the empty file asm\warnings.time. -.PHONY: warnings -warnings: - $(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time - $(MAKE) asm\warnings.time - -asm\warnings.time: $(WARNSRCS) asm\warnings.pl - $(EMPTY) asm\warnings.time - $(MAKE) $(WARNTIMES) - -asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h \ - $(srcdir) $(WARNSRCS) - $(EMPTY) asm\warnings_c.h.time - -asm\warnings_c.h: asm\warnings_c.h.time - $(SIDE) - -include\warnings.h.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h \ - $(srcdir) $(WARNSRCS) - $(EMPTY) include\warnings.h.time - -include\warnings.h: include\warnings.h.time - $(SIDE) - -doc\warnings.src.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src \ - $(srcdir) $(WARNSRCS) - $(EMPTY) doc\warnings.src.time - -doc\warnings.src : doc\warnings.src.time - $(SIDE) # Assembler token hash asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl \ diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index d27412cfa..0638623f2 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -72,11 +72,8 @@ PROGOBJ = $(NASM) $(NDISASM) PROGS = nasm$(X) ndisasm$(X) # Files dependent on extracted warnings -# WARNTIMES is explicit to avoid breaking some apparently problematic make -# versions, e.g. Microsoft NMAKE WARNOBJ = asm\warnings.obj WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src -WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time OUTPUTOBJ = & output\outform.obj output\outlib.obj & @@ -306,43 +303,6 @@ x86\regs.h: x86\regs.dat x86\regs.pl $(RUNPERL) $(srcdir)\x86\regs.pl h & $(srcdir)\x86\regs.dat > x86\regs.h -# Extract warnings from source code. This is done automatically if any -# C files have changed; the script is fast enough that that is -# reasonable, but doesn't update the time stamp if the files aren't -# changed, to avoid rebuilding everything every time. Track the actual -# dependency by the empty file asm\warnings.time. -.PHONY: warnings -warnings: - $(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time - $(MAKE) asm\warnings.time - -asm\warnings.time: $(WARNSRCS) asm\warnings.pl - $(EMPTY) asm\warnings.time - $(MAKE) $(WARNTIMES) - -asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h & - $(srcdir) $(WARNSRCS) - $(EMPTY) asm\warnings_c.h.time - -asm\warnings_c.h: asm\warnings_c.h.time - $(SIDE) - -include\warnings.h.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h & - $(srcdir) $(WARNSRCS) - $(EMPTY) include\warnings.h.time - -include\warnings.h: include\warnings.h.time - $(SIDE) - -doc\warnings.src.time: asm\warnings.pl asm\warnings.time - $(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src & - $(srcdir) $(WARNSRCS) - $(EMPTY) doc\warnings.src.time - -doc\warnings.src : doc\warnings.src.time - $(SIDE) # Assembler token hash asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl &