mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-07-24 10:25:42 -04:00
Make: handle warning files while building in a directory
The dependency on the warning files breaks when we are building in a directory *and* the files already exist from being shipped with the distribution tarballs. The make VPATH simply isn't sophisticated enough to deal with it, so let the C compiler handle it by #including the generated file from a dummy C file. Reported-by: Rudi Heitbaum <rudi@heitbaum.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
66a91c3796
commit
7e80d6b834
2
.gitignore
vendored
2
.gitignore
vendored
@ -50,7 +50,7 @@ TAGS
|
|||||||
/asm/pptok.ph
|
/asm/pptok.ph
|
||||||
/asm/tokens.h
|
/asm/tokens.h
|
||||||
/asm/tokhash.c
|
/asm/tokhash.c
|
||||||
/asm/warnings.c
|
/asm/warnings_c.h
|
||||||
/config/config.h.in
|
/config/config.h.in
|
||||||
/config/config.h
|
/config/config.h
|
||||||
/config.log
|
/config.log
|
||||||
|
38
Makefile.in
38
Makefile.in
@ -37,8 +37,10 @@ AR = @AR@
|
|||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
||||||
|
tools = $(top_srcdir)/tools
|
||||||
|
|
||||||
PERL = perl
|
PERL = perl
|
||||||
PERLFLAGS = -I$(srcdir)/perllib -I$(srcdir)
|
PERLFLAGS = -I$(top_srcdir)/perllib -I$(srcdir)
|
||||||
RUNPERL = $(PERL) $(PERLFLAGS)
|
RUNPERL = $(PERL) $(PERLFLAGS)
|
||||||
|
|
||||||
PYTHON3 = python3
|
PYTHON3 = python3
|
||||||
@ -65,8 +67,8 @@ LN_S = @LN_S@
|
|||||||
FIND = find
|
FIND = find
|
||||||
|
|
||||||
# Binary suffixes
|
# Binary suffixes
|
||||||
O = @OBJEXT@
|
O = @OBJEXT@
|
||||||
X = @EXEEXT@
|
X = @EXEEXT@
|
||||||
A = @LIBEXT@
|
A = @LIBEXT@
|
||||||
|
|
||||||
# Debug stuff
|
# Debug stuff
|
||||||
@ -194,14 +196,14 @@ PERLREQ = config/unconfig.h \
|
|||||||
x86/iflag.c x86/iflaggen.h \
|
x86/iflag.c x86/iflaggen.h \
|
||||||
macros/macros.c \
|
macros/macros.c \
|
||||||
asm/pptok.ph asm/directbl.c asm/directiv.h \
|
asm/pptok.ph asm/directbl.c asm/directiv.h \
|
||||||
asm/warnings.c include/warnings.h doc/warnings.src \
|
$(WARNFILES) \
|
||||||
misc/nasmtok.el \
|
misc/nasmtok.el \
|
||||||
version.h version.mac version.mak nsis/version.nsh
|
version.h version.mac version.mak nsis/version.nsh
|
||||||
|
|
||||||
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflags.ph
|
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflags.ph
|
||||||
|
|
||||||
config/unconfig.h: config/config.h.in
|
config/unconfig.h: config/config.h.in
|
||||||
$(RUNPERL) $(srcdir)/tools/unconfig.pl \
|
$(RUNPERL) $(tools)/unconfig.pl \
|
||||||
'$(srcdir)' config/config.h.in config/unconfig.h
|
'$(srcdir)' config/config.h.in config/unconfig.h
|
||||||
|
|
||||||
x86/iflag.c: $(INSDEP)
|
x86/iflag.c: $(INSDEP)
|
||||||
@ -273,7 +275,7 @@ x86/regs.h: x86/regs.dat x86/regs.pl
|
|||||||
# reasonable, but doesn't update the time stamp if the files aren't
|
# reasonable, but doesn't update the time stamp if the files aren't
|
||||||
# changed, to avoid rebuilding everything every time. Track the actual
|
# changed, to avoid rebuilding everything every time. Track the actual
|
||||||
# dependency by the empty file asm/warnings.time.
|
# dependency by the empty file asm/warnings.time.
|
||||||
WARNFILES = asm/warnings.c include/warnings.h doc/warnings.src
|
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
|
||||||
|
|
||||||
warnings:
|
warnings:
|
||||||
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
||||||
@ -283,11 +285,11 @@ asm/warnings.time: $(ALLOBJ_NW:.$(O)=.c)
|
|||||||
: > asm/warnings.time
|
: > asm/warnings.time
|
||||||
$(MAKE) $(WARNFILES:=.time)
|
$(MAKE) $(WARNFILES:=.time)
|
||||||
|
|
||||||
asm/warnings.c.time: asm/warnings.pl asm/warnings.time
|
asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
|
||||||
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings.c $(srcdir)
|
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
|
||||||
: > asm/warnings.c.time
|
: > asm/warnings_c.h.time
|
||||||
|
|
||||||
asm/warnings.c: asm/warnings.c.time
|
asm/warnings_c.h: asm/warnings_c.h.time
|
||||||
@: Side effect
|
@: Side effect
|
||||||
|
|
||||||
include/warnings.h.time: asm/warnings.pl asm/warnings.time
|
include/warnings.h.time: asm/warnings.pl asm/warnings.time
|
||||||
@ -506,8 +508,8 @@ EXTERNAL_DEPENDENCIES = 1
|
|||||||
# the dependency information will remain external, so it doesn't
|
# the dependency information will remain external, so it doesn't
|
||||||
# pollute the git logs.
|
# pollute the git logs.
|
||||||
#
|
#
|
||||||
Makefile.dep: $(PERLREQ) tools/mkdep.pl config.status
|
Makefile.dep: $(PERLREQ) $(tools)/mkdep.pl config.status
|
||||||
$(RUNPERL) tools/mkdep.pl -M Makefile.in -- $(DEPDIRS)
|
$(RUNPERL) $(tools)/mkdep.pl -M Makefile.in -- $(DEPDIRS)
|
||||||
|
|
||||||
dep: Makefile.dep
|
dep: Makefile.dep
|
||||||
|
|
||||||
@ -517,9 +519,9 @@ dep: Makefile.dep
|
|||||||
# be invoked manually or via "make dist". It should be run before
|
# be invoked manually or via "make dist". It should be run before
|
||||||
# creating release archives.
|
# creating release archives.
|
||||||
#
|
#
|
||||||
alldeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
|
alldeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
|
||||||
$(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
|
$(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
|
||||||
$(RUNPERL) tools/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
|
$(RUNPERL) $(tools)/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
|
||||||
$(DEPDIRS)
|
$(DEPDIRS)
|
||||||
$(RM_F) *.dep
|
$(RM_F) *.dep
|
||||||
if [ -f config.status ]; then \
|
if [ -f config.status ]; then \
|
||||||
@ -528,9 +530,9 @@ alldeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
|
|||||||
|
|
||||||
# Strip internal dependency information from all Makefiles; this makes
|
# Strip internal dependency information from all Makefiles; this makes
|
||||||
# the output good for git checkin
|
# the output good for git checkin
|
||||||
cleandeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
|
cleandeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
|
||||||
$(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
|
$(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
|
||||||
$(RUNPERL) tools/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
|
$(RUNPERL) $(tools)/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
|
||||||
$(DEPDIRS)
|
$(DEPDIRS)
|
||||||
$(RM_F) *.dep
|
$(RM_F) *.dep
|
||||||
if [ -f config.status ]; then \
|
if [ -f config.status ]; then \
|
||||||
|
@ -153,14 +153,14 @@ PERLREQ = config\unconfig.h \
|
|||||||
x86\iflag.c x86\iflaggen.h \
|
x86\iflag.c x86\iflaggen.h \
|
||||||
macros\macros.c \
|
macros\macros.c \
|
||||||
asm\pptok.ph asm\directbl.c asm\directiv.h \
|
asm\pptok.ph asm\directbl.c asm\directiv.h \
|
||||||
asm\warnings.c include\warnings.h doc\warnings.src \
|
$(WARNFILES) \
|
||||||
misc\nasmtok.el \
|
misc\nasmtok.el \
|
||||||
version.h version.mac version.mak nsis\version.nsh
|
version.h version.mac version.mak nsis\version.nsh
|
||||||
|
|
||||||
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
|
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
|
||||||
|
|
||||||
config\unconfig.h: config\config.h.in
|
config\unconfig.h: config\config.h.in
|
||||||
$(RUNPERL) $(srcdir)\tools\unconfig.pl \
|
$(RUNPERL) $(tools)\unconfig.pl \
|
||||||
'$(srcdir)' config\config.h.in config\unconfig.h
|
'$(srcdir)' config\config.h.in config\unconfig.h
|
||||||
|
|
||||||
x86\iflag.c: $(INSDEP)
|
x86\iflag.c: $(INSDEP)
|
||||||
@ -232,7 +232,7 @@ x86\regs.h: x86\regs.dat x86\regs.pl
|
|||||||
# reasonable, but doesn't update the time stamp if the files aren't
|
# reasonable, but doesn't update the time stamp if the files aren't
|
||||||
# changed, to avoid rebuilding everything every time. Track the actual
|
# changed, to avoid rebuilding everything every time. Track the actual
|
||||||
# dependency by the empty file asm\warnings.time.
|
# dependency by the empty file asm\warnings.time.
|
||||||
WARNFILES = asm\warnings.c include\warnings.h doc\warnings.src
|
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
|
||||||
|
|
||||||
warnings:
|
warnings:
|
||||||
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
||||||
@ -242,11 +242,11 @@ asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c)
|
|||||||
: > asm\warnings.time
|
: > asm\warnings.time
|
||||||
$(MAKE) $(WARNFILES:=.time)
|
$(MAKE) $(WARNFILES:=.time)
|
||||||
|
|
||||||
asm\warnings.c.time: asm\warnings.pl asm\warnings.time
|
asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
|
||||||
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir)
|
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h $(srcdir)
|
||||||
: > asm\warnings.c.time
|
: > asm\warnings_c.h.time
|
||||||
|
|
||||||
asm\warnings.c: asm\warnings.c.time
|
asm\warnings_c.h: asm\warnings_c.h.time
|
||||||
@: Side effect
|
@: Side effect
|
||||||
|
|
||||||
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||||
|
@ -166,14 +166,14 @@ PERLREQ = config\unconfig.h &
|
|||||||
x86\iflag.c x86\iflaggen.h &
|
x86\iflag.c x86\iflaggen.h &
|
||||||
macros\macros.c &
|
macros\macros.c &
|
||||||
asm\pptok.ph asm\directbl.c asm\directiv.h &
|
asm\pptok.ph asm\directbl.c asm\directiv.h &
|
||||||
asm\warnings.c include\warnings.h doc\warnings.src &
|
$(WARNFILES) &
|
||||||
misc\nasmtok.el &
|
misc\nasmtok.el &
|
||||||
version.h version.mac version.mak nsis\version.nsh
|
version.h version.mac version.mak nsis\version.nsh
|
||||||
|
|
||||||
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
|
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
|
||||||
|
|
||||||
config\unconfig.h: config\config.h.in
|
config\unconfig.h: config\config.h.in
|
||||||
$(RUNPERL) $(srcdir)\tools\unconfig.pl &
|
$(RUNPERL) $(tools)\unconfig.pl &
|
||||||
'$(srcdir)' config\config.h.in config\unconfig.h
|
'$(srcdir)' config\config.h.in config\unconfig.h
|
||||||
|
|
||||||
x86\iflag.c: $(INSDEP)
|
x86\iflag.c: $(INSDEP)
|
||||||
@ -245,7 +245,7 @@ x86\regs.h: x86\regs.dat x86\regs.pl
|
|||||||
# reasonable, but doesn't update the time stamp if the files aren't
|
# reasonable, but doesn't update the time stamp if the files aren't
|
||||||
# changed, to avoid rebuilding everything every time. Track the actual
|
# changed, to avoid rebuilding everything every time. Track the actual
|
||||||
# dependency by the empty file asm\warnings.time.
|
# dependency by the empty file asm\warnings.time.
|
||||||
WARNFILES = asm\warnings.c include\warnings.h doc\warnings.src
|
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
|
||||||
|
|
||||||
warnings:
|
warnings:
|
||||||
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
|
||||||
@ -255,11 +255,11 @@ asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c)
|
|||||||
: > asm\warnings.time
|
: > asm\warnings.time
|
||||||
$(MAKE) $(WARNFILES:=.time)
|
$(MAKE) $(WARNFILES:=.time)
|
||||||
|
|
||||||
asm\warnings.c.time: asm\warnings.pl asm\warnings.time
|
asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
|
||||||
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir)
|
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h $(srcdir)
|
||||||
: > asm\warnings.c.time
|
: > asm\warnings_c.h.time
|
||||||
|
|
||||||
asm\warnings.c: asm\warnings.c.time
|
asm\warnings_c.h: asm\warnings_c.h.time
|
||||||
@: Side effect
|
@: Side effect
|
||||||
|
|
||||||
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||||
|
1
asm/warnings.c
Normal file
1
asm/warnings.c
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "warnings_c.h"
|
@ -20,7 +20,7 @@ INSTALL = @INSTALL@
|
|||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
|
||||||
PERL = perl -I$(srcdir)
|
PERL = perl -I$(top_srcdir)/perllib -I$(srcdir)
|
||||||
|
|
||||||
PDFOPT = @PDFOPT@
|
PDFOPT = @PDFOPT@
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user