@@ -103,9 +103,12 @@ endif
103103.SUFFIXES :
104104.SUFFIXES : $(X ) .$(O ) .$(A ) .xml .1 .c .i .s .txt .time
105105
106+ # Use to mark phony targets in global lists
107+ PHONY =
108+
106109.PHONY : all doc misc install clean distclean cleaner spotless test
107- .PHONY : install_doc everything install_everything strip perlreq dist tags TAGS
108- .PHONY : nothing manpages nsis editors
110+ .PHONY : install_doc everything install_everything strip perlreq warnings
111+ .PHONY : dist tags TAGS nothing manpages nsis editors
109112
110113.c.$(O ) :
111114 $(CC ) -c $(ALL_CFLAGS ) -o $@ $<
@@ -131,7 +134,7 @@ NDISASM = disasm/ndisasm.$(O)
131134PROGOBJ = $(NASM ) $(NDISASM )
132135PROGS = nasm$(X ) ndisasm$(X )
133136
134- # Files dependent on extracted warnings
137+ # Files dependent on warnings.dat
135138WARNOBJ = asm/warnings.$(O )
136139WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
137140
@@ -257,11 +260,8 @@ ndisasm$(X): $(NDISASM) $(MANIFEST) $(DISLIB) $(NASMLIB)
257260 $(CC ) $(ALL_LDFLAGS ) -o $@ $(NDISASM ) $(MANIFEST ) \
258261 $(DISLIB ) $(NASMLIB ) $(LIBS )
259262
260- # These are specific to certain Makefile syntaxes...
261- WARNSRCS = $(ALLOBJ_W:.$(O ) =.c )
262-
263263# Make sure we have subdirectories set up...
264- $(LIBOBJ ) $(LIBOBJ_DIS ) $( WARNTIMES ) $( WARNSRCS ) : $(DIRS )
264+ $(LIBOBJ ) $(LIBOBJ_DIS ) : $(DIRS )
265265
266266# -- Begin Generated File Rules --#
267267
@@ -399,58 +399,27 @@ editors/nasmtok.json: editors/nasmtok.pl asm/tokhash.c asm/pptok.c \
399399 version.mak
400400 $(RUNPERL ) $(srcdir ) /editors/nasmtok.pl -json $@ $(srcdir ) $(objdir )
401401
402- editors : $(EDITORS )
403-
404- # -- End Generated File Rules --#
405-
406- # Extract warnings from source code. This is done automatically if any
407- # C files have changed; the script is fast enough that that is
408- # reasonable, but doesn't update the time stamp if the files aren't
409- # changed, to avoid rebuilding everything every time. Track the actual
410- # dependency by the empty file asm/warnings.time.
411- #
412- # This doesn't seem to work for non-Unix Makefile variants, so don't
413- # export those rules here (non-Unix Makefiles only guaranteed to build
414- # a distribution ball anyway.)
415-
416- WARNTIMES = $(WARNFILES:=.time )
417-
418- .PHONY : warnings
419- warnings :
420- $(RM_F ) $(WARNFILES ) $(WARNTIMES ) asm/warnings.time
421- $(MAKE ) asm/warnings.time
402+ editors : $(EDITORS ) $(PHONY )
422403
423- asm/warnings.time : $(WARNSRCS ) asm/warnings.pl
424- $(EMPTY ) asm/warnings.time
425- $(MAKE ) $(WARNTIMES )
426-
427- asm/warnings_c.h.time : asm/warnings.pl asm/warnings.time
404+ asm/warnings_c.h : asm/warnings.pl asm/warnings.dat
428405 $(RUNPERL ) $(srcdir ) /asm/warnings.pl c asm/warnings_c.h \
429- $(srcdir ) $(WARNSRCS )
430- $(EMPTY ) asm/warnings_c.h.time
431-
432- asm/warnings_c.h : asm/warnings_c.h.time
433- $(SIDE )
406+ $(srcdir ) /asm/warnings.dat
434407
435- include/warnings.h.time : asm/warnings.pl asm/warnings.time
408+ include/warnings.h : asm/warnings.pl asm/warnings.dat
436409 $(RUNPERL ) $(srcdir ) /asm/warnings.pl h include/warnings.h \
437- $(srcdir ) $(WARNSRCS )
438- $(EMPTY ) include/warnings.h.time
410+ $(srcdir ) /asm/warnings.dat
439411
440- include/warnings.h : include/warnings.h.time
441- $(SIDE )
442-
443- doc/warnings.src.time : asm/warnings.pl asm/warnings.time
412+ doc/warnings.src : asm/warnings.pl asm/warnings.dat
444413 $(RUNPERL ) $(srcdir ) /asm/warnings.pl doc doc/warnings.src \
445- $(srcdir ) $(WARNSRCS )
446- $(EMPTY ) doc/warnings.src.time
447-
448- doc/warnings.src : doc/warnings.src.time
449- $(SIDE )
414+ $(srcdir ) /asm/warnings.dat
450415
451416$(PERLREQ ) : $(DIRS )
452417
453- perlreq : $(PERLREQ )
418+ perlreq : $(PERLREQ ) $(PHONY )
419+
420+ warnings : $(WARNFILES ) $(PHONY )
421+
422+ # -- End Generated File Rules --#
454423
455424# -- Begin NSIS Rules --#
456425
@@ -560,7 +529,7 @@ editor_builtin: nasm$(X)
560529
561530dist :
562531 $(MAKE ) alldeps
563- $(MAKE ) perlreq warnings spec
532+ $(MAKE ) perlreq spec
564533 $(MAKE ) editor_builtin
565534 $(MAKE ) editors $(MANPAGES )
566535 $(MAKE ) distclean
0 commit comments