Skip to content

Commit 4e02919

Browse files
committed
openwcom.mak: generate .time files correctly
Signed-off-by: KO Myung-Hun <[email protected]>
1 parent 3472f36 commit 4e02919

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

Mkfiles/openwcom.mak

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ LDEBUG =
2323
LDFLAGS = op q $(%TARGET_LFLAGS) $(LDEBUG)
2424
LIBS =
2525
STRIP = wstrip
26+
RUNMAKE = $(MAKE) -f Mkfiles\openwcom.mak
2627

2728
PERL = perl
2829
PERLFLAGS = -I$(srcdir)\perllib -I$(srcdir)
@@ -72,8 +73,11 @@ PROGOBJ = $(NASM) $(NDISASM)
7273
PROGS = 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
7578
WARNOBJ = asm\warnings.obj
7679
WARNFILES = 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

7882
OUTPUTOBJ = &
7983
output\outform.obj output\outlib.obj &
@@ -211,10 +215,8 @@ nasm.lib: $(LIBOBJ)
211215
ndisasm.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)\x86\regs.pl h &
306308
$(srcdir)\x86\regs.dat > x86\regs.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\warnings.time
317+
$(RUNMAKE) asm\warnings.time
318+
319+
asm\warnings.time: $(WARNSRCS) asm\warnings.pl
320+
$(EMPTY) asm\warnings.time
321+
$(RUNMAKE) $(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)
308346

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

0 commit comments

Comments
 (0)