Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfacf9a

Browse files
author
H. Peter Anvin
committed
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) <[email protected]>
1 parent 205512f commit dfacf9a

File tree

3 files changed

+45
-120
lines changed

3 files changed

+45
-120
lines changed

Makefile.in

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ PROGOBJ = $(NASM) $(NDISASM)
121121
PROGS = nasm$(X) ndisasm$(X)
122122

123123
# Files dependent on extracted warnings
124-
# WARNTIMES is explicit to avoid breaking some apparently problematic make
125-
# versions, e.g. Microsoft NMAKE
126124
WARNOBJ = asm/warnings.$(O)
127125
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
128-
WARNTIMES = asm/warnings_c.h.time include/warnings.h.time doc/warnings.src.time
129126

130127
OUTPUTOBJ = \
131128
output/outform.$(O) output/outlib.$(O) \
@@ -341,43 +338,6 @@ x86/regs.h: x86/regs.dat x86/regs.pl
341338
$(RUNPERL) $(srcdir)/x86/regs.pl h \
342339
$(srcdir)/x86/regs.dat > x86/regs.h
343340

344-
# Extract warnings from source code. This is done automatically if any
345-
# C files have changed; the script is fast enough that that is
346-
# reasonable, but doesn't update the time stamp if the files aren't
347-
# changed, to avoid rebuilding everything every time. Track the actual
348-
# dependency by the empty file asm/warnings.time.
349-
.PHONY: warnings
350-
warnings:
351-
$(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time
352-
$(MAKE) asm/warnings.time
353-
354-
asm/warnings.time: $(WARNSRCS) asm/warnings.pl
355-
$(EMPTY) asm/warnings.time
356-
$(MAKE) $(WARNTIMES)
357-
358-
asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
359-
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h \
360-
$(srcdir) $(WARNSRCS)
361-
$(EMPTY) asm/warnings_c.h.time
362-
363-
asm/warnings_c.h: asm/warnings_c.h.time
364-
$(SIDE)
365-
366-
include/warnings.h.time: asm/warnings.pl asm/warnings.time
367-
$(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h \
368-
$(srcdir) $(WARNSRCS)
369-
$(EMPTY) include/warnings.h.time
370-
371-
include/warnings.h: include/warnings.h.time
372-
$(SIDE)
373-
374-
doc/warnings.src.time: asm/warnings.pl asm/warnings.time
375-
$(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src \
376-
$(srcdir) $(WARNSRCS)
377-
$(EMPTY) doc/warnings.src.time
378-
379-
doc/warnings.src : doc/warnings.src.time
380-
$(SIDE)
381341

382342
# Assembler token hash
383343
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 \
422382

423383
#-- End Generated File Rules --#
424384

385+
# Extract warnings from source code. This is done automatically if any
386+
# C files have changed; the script is fast enough that that is
387+
# reasonable, but doesn't update the time stamp if the files aren't
388+
# changed, to avoid rebuilding everything every time. Track the actual
389+
# dependency by the empty file asm/warnings.time.
390+
#
391+
# This doesn't seem to work for non-Unix Makefile variants, so don't
392+
# export those rules here (non-Unix Makefiles only guaranteed to build
393+
# a distribution ball anyway.)
394+
395+
WARNTIMES = $(WARNFILES:=.time)
396+
397+
.PHONY: warnings
398+
warnings:
399+
$(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time
400+
$(MAKE) asm/warnings.time
401+
402+
asm/warnings.time: $(WARNSRCS) asm/warnings.pl
403+
$(EMPTY) asm/warnings.time
404+
$(MAKE) $(WARNTIMES)
405+
406+
asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
407+
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h \
408+
$(srcdir) $(WARNSRCS)
409+
$(EMPTY) asm/warnings_c.h.time
410+
411+
asm/warnings_c.h: asm/warnings_c.h.time
412+
$(SIDE)
413+
414+
include/warnings.h.time: asm/warnings.pl asm/warnings.time
415+
$(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h \
416+
$(srcdir) $(WARNSRCS)
417+
$(EMPTY) include/warnings.h.time
418+
419+
include/warnings.h: include/warnings.h.time
420+
$(SIDE)
421+
422+
doc/warnings.src.time: asm/warnings.pl asm/warnings.time
423+
$(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src \
424+
$(srcdir) $(WARNSRCS)
425+
$(EMPTY) doc/warnings.src.time
426+
427+
doc/warnings.src : doc/warnings.src.time
428+
$(SIDE)
429+
425430
$(PERLREQ): $(DIRS)
426431

427432
perlreq: $(PERLREQ)

Mkfiles/msvc.mak

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@ PROGOBJ = $(NASM) $(NDISASM)
8383
PROGS = nasm$(X) ndisasm$(X)
8484

8585
# Files dependent on extracted warnings
86-
# WARNTIMES is explicit to avoid breaking some apparently problematic make
87-
# versions, e.g. Microsoft NMAKE
8886
WARNOBJ = asm\warnings.obj
8987
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
90-
WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time
9188

9289
OUTPUTOBJ = \
9390
output\outform.obj output\outlib.obj \
@@ -291,43 +288,6 @@ x86\regs.h: x86\regs.dat x86\regs.pl
291288
$(RUNPERL) $(srcdir)\x86\regs.pl h \
292289
$(srcdir)\x86\regs.dat > x86\regs.h
293290

294-
# Extract warnings from source code. This is done automatically if any
295-
# C files have changed; the script is fast enough that that is
296-
# reasonable, but doesn't update the time stamp if the files aren't
297-
# changed, to avoid rebuilding everything every time. Track the actual
298-
# dependency by the empty file asm\warnings.time.
299-
.PHONY: warnings
300-
warnings:
301-
$(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time
302-
$(MAKE) asm\warnings.time
303-
304-
asm\warnings.time: $(WARNSRCS) asm\warnings.pl
305-
$(EMPTY) asm\warnings.time
306-
$(MAKE) $(WARNTIMES)
307-
308-
asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
309-
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h \
310-
$(srcdir) $(WARNSRCS)
311-
$(EMPTY) asm\warnings_c.h.time
312-
313-
asm\warnings_c.h: asm\warnings_c.h.time
314-
$(SIDE)
315-
316-
include\warnings.h.time: asm\warnings.pl asm\warnings.time
317-
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h \
318-
$(srcdir) $(WARNSRCS)
319-
$(EMPTY) include\warnings.h.time
320-
321-
include\warnings.h: include\warnings.h.time
322-
$(SIDE)
323-
324-
doc\warnings.src.time: asm\warnings.pl asm\warnings.time
325-
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src \
326-
$(srcdir) $(WARNSRCS)
327-
$(EMPTY) doc\warnings.src.time
328-
329-
doc\warnings.src : doc\warnings.src.time
330-
$(SIDE)
331291

332292
# Assembler token hash
333293
asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl \

Mkfiles/openwcom.mak

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,8 @@ PROGOBJ = $(NASM) $(NDISASM)
7272
PROGS = nasm$(X) ndisasm$(X)
7373

7474
# Files dependent on extracted warnings
75-
# WARNTIMES is explicit to avoid breaking some apparently problematic make
76-
# versions, e.g. Microsoft NMAKE
7775
WARNOBJ = asm\warnings.obj
7876
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
79-
WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time
8077

8178
OUTPUTOBJ = &
8279
output\outform.obj output\outlib.obj &
@@ -306,43 +303,6 @@ x86\regs.h: x86\regs.dat x86\regs.pl
306303
$(RUNPERL) $(srcdir)\x86\regs.pl h &
307304
$(srcdir)\x86\regs.dat > x86\regs.h
308305

309-
# Extract warnings from source code. This is done automatically if any
310-
# C files have changed; the script is fast enough that that is
311-
# reasonable, but doesn't update the time stamp if the files aren't
312-
# changed, to avoid rebuilding everything every time. Track the actual
313-
# dependency by the empty file asm\warnings.time.
314-
.PHONY: warnings
315-
warnings:
316-
$(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time
317-
$(MAKE) asm\warnings.time
318-
319-
asm\warnings.time: $(WARNSRCS) asm\warnings.pl
320-
$(EMPTY) asm\warnings.time
321-
$(MAKE) $(WARNTIMES)
322-
323-
asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
324-
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h &
325-
$(srcdir) $(WARNSRCS)
326-
$(EMPTY) asm\warnings_c.h.time
327-
328-
asm\warnings_c.h: asm\warnings_c.h.time
329-
$(SIDE)
330-
331-
include\warnings.h.time: asm\warnings.pl asm\warnings.time
332-
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h &
333-
$(srcdir) $(WARNSRCS)
334-
$(EMPTY) include\warnings.h.time
335-
336-
include\warnings.h: include\warnings.h.time
337-
$(SIDE)
338-
339-
doc\warnings.src.time: asm\warnings.pl asm\warnings.time
340-
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src &
341-
$(srcdir) $(WARNSRCS)
342-
$(EMPTY) doc\warnings.src.time
343-
344-
doc\warnings.src : doc\warnings.src.time
345-
$(SIDE)
346306

347307
# Assembler token hash
348308
asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl &

0 commit comments

Comments
 (0)