[Mesa-dev] [PATCH] i965: avoid using a GNU make pattern rule

Robert Bragg robert at sixbynine.org
Thu Mar 16 23:53:04 UTC 2017


On Thu, Mar 16, 2017 at 1:50 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 16 March 2017 at 02:49, Jonathan Gray <jsg at jsg.id.au> wrote:
>> % pattern rules are a GNU extension.  As there is only one file here
>> avoid patterns and globbing entirely to fix the build on non-GNU make.
>>
>> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
>> ---
>>  src/mesa/drivers/dri/i965/Makefile.am | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/Makefile.am b/src/mesa/drivers/dri/i965/Makefile.am
>> index a83e3a6fa1..fee1ccbbf5 100644
>> --- a/src/mesa/drivers/dri/i965/Makefile.am
>> +++ b/src/mesa/drivers/dri/i965/Makefile.am
>> @@ -92,8 +92,8 @@ EXTRA_DIST = \
>>  # .c and .h files in one go so we don't hit problems with parallel
>>  # make and multiple invocations of the same script trying to write
>>  # to the same files.
>> -brw_oa_%.h: brw_oa_%.xml brw_oa.py Makefile.am
>> -       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --header=$(builddir)/brw_oa_$(*).h --chipset="$(*)" $(srcdir)/brw_oa_$(*).xml
>> -brw_oa_%.c: brw_oa_%.xml brw_oa.py Makefile.am
>> -       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --code=$(builddir)/brw_oa_$(*).c --chipset="$(*)" $(srcdir)/brw_oa_$(*).xml
> <unrelated>
> Hmm that is not even remotely what was reviewed or suggested ... strange.
> </unrelated>

Sorry, I didn't intend to change this under the radar, but I guess the
you didn't see this:
https://lists.freedesktop.org/archives/mesa-dev/2017-March/147200.html

>
>> +brw_oa_hsw.h: $(srcdir)/brw_oa_hsw.xml
>> +       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --header=$(builddir)/brw_oa_hsw.h --chipset=hsw $(srcdir)/brw_oa_hsw.xml
>> +brw_oa_hsw.c: $(srcdir)/brw_oa_hsw.xml
>> +       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --code=$(builddir)/brw_oa_hsw.c --chipset=hsw $(srcdir)/brw_oa_hsw.xml
>>
> Thank you Jonathan.
>
> We might need a generic rule as other generations are covered and/or
> even move the lot to another location.
> All that in due time, for now I'll add the missing brw_oa.py
> dependency and push this.

Just to mention; this change just caught me out when rebasing my gen 8
/ 9 changes and so I'm wondering about the best way to deal with this,
ideally without copying seven times for hsw, bdw, chv, sklgt2, sklgt3,
sklgt4, bxt + more later. For now I'm copy & pasting, and maybe it'll
just be easiest to stick with that.

I wouldn't guess the i915-perf kernel interface has been ported to any
other OS besides Linux, so maybe these can be annexed as Linux
specific somehow to avoid tripping up other OS builds.

It looks like there are a few other files in Mesa that use patterns,
such as ./src/mapi/glapi/gen/Makefile.am - I wonder how come that
hasn't proven to be a problem.

btw the recent change here removed Makefile.am from the list of
dependencies, which I think was reasonable to have originally (and
consistent with what automake normally does for rules it generates).

Regards,
- Robert

>
> Thanks
> Emil
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list