[Mesa-dev] [PATCH] genxml: avoid using a GNU make pattern rule
Jason Ekstrand
jason at jlekstrand.net
Mon May 2 18:44:35 UTC 2016
On Mon, May 2, 2016 at 2:27 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> On Mon, May 02, 2016 at 02:23:46AM -0700, Jason Ekstrand wrote:
> > On May 1, 2016 11:24 PM, "Jonathan Gray" <jsg at jsg.id.au> wrote:
> > >
> > > % pattern rules are a GNU extension. Convert the use of one to a
> > > suffix rule to allow this to build on OpenBSD.
> > >
> > > Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> > > ---
> > > src/intel/genxml/Makefile.am | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/intel/genxml/Makefile.am
> b/src/intel/genxml/Makefile.am
> > > index f493d48..ea68fb9 100644
> > > --- a/src/intel/genxml/Makefile.am
> > > +++ b/src/intel/genxml/Makefile.am
> > > @@ -28,7 +28,9 @@ BUILT_SOURCES =
> > \
> > >
> > > PYTHON3_GEN = $(AM_V_GEN)$(PYTHON3) $(PYTHON_FLAGS)
> > >
> > > -%_pack.h : %.xml gen_pack_header.py
> > > +SUFFIXES = _pack.h .xml
> > > +
> > > +.xml_pack.h : gen_pack_header.py
> > > $(PYTHON3_GEN) $(srcdir)/gen_pack_header.py $< > $@
> >
> > We'd better also fix up all the places we include these files. :-)
>
> The generated filenames don't change, there is no need to:
>
I just read up on Suffix rules (didn't even know they existed). I think
what you're doing there *mostly* works. The problem is that, according to
the GNU make docs (
https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html),
suffix rules aren't allowed to have any additional prerequisites declared.
If they do, they get treated as normal non-suffix rules. How do we do this
as a suffix rule *and* have it depend on both genN.xml and
gen_pack_header.py?
--jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160502/37996a1f/attachment.html>
More information about the mesa-dev
mailing list