<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 5:25 PM, Jonathan Gray <span dir="ltr"><<a href="mailto:jsg@jsg.id.au" target="_blank">jsg@jsg.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, May 02, 2016 at 11:44:35AM -0700, Jason Ekstrand wrote:<br>
> On Mon, May 2, 2016 at 2:27 AM, Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>> wrote:<br>
><br>
> > On Mon, May 02, 2016 at 02:23:46AM -0700, Jason Ekstrand wrote:<br>
> > > On May 1, 2016 11:24 PM, "Jonathan Gray" <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>> wrote:<br>
> > > ><br>
> > > > % pattern rules are a GNU extension. Convert the use of one to a<br>
> > > > suffix rule to allow this to build on OpenBSD.<br>
> > > ><br>
> > > > Signed-off-by: Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>><br>
> > > > ---<br>
> > > > src/intel/genxml/Makefile.am | 4 +++-<br>
> > > > 1 file changed, 3 insertions(+), 1 deletion(-)<br>
> > > ><br>
> > > > diff --git a/src/intel/genxml/Makefile.am<br>
> > b/src/intel/genxml/Makefile.am<br>
> > > > index f493d48..ea68fb9 100644<br>
> > > > --- a/src/intel/genxml/Makefile.am<br>
> > > > +++ b/src/intel/genxml/Makefile.am<br>
> > > > @@ -28,7 +28,9 @@ BUILT_SOURCES =<br>
> > > \<br>
> > > ><br>
> > > > PYTHON3_GEN = $(AM_V_GEN)$(PYTHON3) $(PYTHON_FLAGS)<br>
> > > ><br>
> > > > -%_pack.h : %.xml gen_pack_header.py<br>
> > > > +SUFFIXES = _pack.h .xml<br>
> > > > +<br>
> > > > +.xml_pack.h : gen_pack_header.py<br>
> > > > $(PYTHON3_GEN) $(srcdir)/gen_pack_header.py $< > $@<br>
> > ><br>
> > > We'd better also fix up all the places we include these files. :-)<br>
> ><br>
> > The generated filenames don't change, there is no need to:<br>
> ><br>
><br>
> I just read up on Suffix rules (didn't even know they existed). I think<br>
> what you're doing there *mostly* works. The problem is that, according to<br>
> the GNU make docs (<br>
> <a href="https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html</a>),<br>
> suffix rules aren't allowed to have any additional prerequisites declared.<br>
> If they do, they get treated as normal non-suffix rules. How do we do this<br>
> as a suffix rule *and* have it depend on both genN.xml and<br>
> gen_pack_header.py?<br>
> --jason<br>
<br>
</div></div>The docs on OpenBSD suggest adding another target rule for this case<br>
which seems to work as intended here.<br>
<br>
see "INFERENCE RULES" in<br>
<a href="http://man.openbsd.org/OpenBSD-current/man1/make.1" rel="noreferrer" target="_blank">http://man.openbsd.org/OpenBSD-current/man1/make.1</a><br>
<br>
commit 715e29f2a1db62f69a92e742cd33fc75889367ff<br>
Author: Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>><br>
Date: Mon May 2 16:14:56 2016 +1000<br>
<br>
genxml: avoid using a GNU make pattern rule<br>
<span class=""><br>
% pattern rules are a GNU extension. Convert the use of one to a<br>
</span> inference rule to allow this to build on OpenBSD.<br>
<br>
v2: inference rules can't have additional prerequisites<br>
so add a target rule to still depend on gen_pack_header.py<br>
<br>
Signed-off-by: Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>><br></blockquote><div><br></div><div>Sorry it's taken so long but I just applied this, verified that it still works with GNU make, added my R-B and pushed it to master. Thanks!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/src/intel/genxml/Makefile.am b/src/intel/genxml/Makefile.am<br>
index f493d48..0b5b3a6 100644<br>
--- a/src/intel/genxml/Makefile.am<br>
+++ b/src/intel/genxml/Makefile.am<br>
@@ -28,7 +28,11 @@ BUILT_SOURCES = \<br>
<span class=""><br>
PYTHON3_GEN = $(AM_V_GEN)$(PYTHON3) $(PYTHON_FLAGS)<br>
<br>
-%_pack.h : %.xml gen_pack_header.py<br>
+SUFFIXES = _pack.h .xml<br>
+<br>
</span>+$(BUILT_SOURCES): gen_pack_header.py<br>
+<br>
+.xml_pack.h:<br>
<div class="HOEnZb"><div class="h5"> $(PYTHON3_GEN) $(srcdir)/gen_pack_header.py $< > $@<br>
<br>
CLEANFILES = $(BUILT_SOURCES)<br>
</div></div></blockquote></div><br></div></div>