@@ -23,6 +23,7 @@ LDEBUG =
2323LDFLAGS = op q $(%TARGET_LFLAGS ) $(LDEBUG )
2424LIBS =
2525STRIP = wstrip
26+ RUNMAKE = $(MAKE ) -f Mkfiles\openwcom.mak
2627
2728PERL = perl
2829PERLFLAGS = -I$(srcdir ) \perllib -I$(srcdir )
@@ -72,8 +73,11 @@ PROGOBJ = $(NASM) $(NDISASM)
7273PROGS = nasm$(X ) ndisasm$(X )
7374
7475# Files dependent on extracted warnings
76+ # WARNTIMES is explicit to avoid breaking some apparently problematic make
77+ # versions, e.g. Microsoft NMAKE
7578WARNOBJ = asm\warnings.obj
7679WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
80+ WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time
7781
7882OUTPUTOBJ = &
7983 output\outform.obj output\outlib.obj &
@@ -211,10 +215,8 @@ nasm.lib: $(LIBOBJ)
211215ndisasm.lib : $(LIBOBJ_DIS )
212216 wlib -q -b -n $@ $(LIBOBJ_DIS)
213217
214- # These are specific to certain Makefile syntaxes (what are they
215- # actually supposed to look like for wmake?)
216- WARNTIMES = $(WARNFILES:=.time )
217- WARNSRCS = $(LIBOBJ_NW:.obj=.c )
218+ # These are specific to certain Makefile syntaxes...
219+ WARNSRCS = $(ALLOBJ_W:.obj=.c )
218220
219221# -- Begin Generated File Rules --#
220222# Edit in Makefile.in, not here!
@@ -305,6 +307,42 @@ x86\regs.h: x86\regs.dat x86\regs.pl
305307 $(RUNPERL ) $(srcdir ) \x 86\r egs.pl h &
306308 $(srcdir ) \x 86\r egs.dat > x86\r egs.h
307309
310+ # Extract warnings from source code. This is done automatically if any
311+ # C files have changed; the script is fast enough that that is
312+ # reasonable, but doesn't update the time stamp if the files aren't
313+ # changed, to avoid rebuilding everything every time. Track the actual
314+ # dependency by the empty file asm\warnings.time.
315+ warnings : .SYMBOLIC
316+ $(RM_F ) $(WARNFILES ) $(WARNTIMES ) asm\w arnings.time
317+ $(RUNMAKE ) asm\w arnings.time
318+
319+ asm\warnings.time : $(WARNSRCS ) asm\warnings.pl
320+ $(EMPTY ) asm\w arnings.time
321+ $(RUNMAKE ) $(WARNTIMES )
322+
323+ asm\warnings_c.h.time : asm\warnings.pl asm\warnings.time
324+ $(RUNPERL ) $(srcdir ) \a sm\w arnings.pl c asm\w arnings_c.h &
325+ $(srcdir ) $(WARNSRCS )
326+ $(EMPTY ) asm\w arnings_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 ) \a sm\w arnings.pl h include\w arnings.h &
333+ $(srcdir ) $(WARNSRCS )
334+ $(EMPTY ) include\w arnings.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 ) \a sm\w arnings.pl doc doc\w arnings.src &
341+ $(srcdir ) $(WARNSRCS )
342+ $(EMPTY ) doc\w arnings.src.time
343+
344+ doc\warnings.src : doc\warnings.src.time
345+ $(SIDE )
308346
309347# Assembler token hash
310348asm\tokhash.c : x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl &
0 commit comments