[Mesa-dev] [PATCH 12/12] auxiliary: fix the generated sources rules

Emil Velikov emil.l.velikov at gmail.com
Tue Sep 1 15:31:59 PDT 2015


Hi Ian,

On 1 September 2015 at 19:30, Ian Romanick <idr at freedesktop.org> wrote:
> On 07/17/2015 10:29 AM, Emil Velikov wrote:
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>  src/gallium/auxiliary/Makefile.am | 29 +++++++++++++++++------------
>>  1 file changed, 17 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
>> index 04f77d0..a728162 100644
>> --- a/src/gallium/auxiliary/Makefile.am
>> +++ b/src/gallium/auxiliary/Makefile.am
>> @@ -38,18 +38,23 @@ libgallium_la_SOURCES += \
>>
>>  endif
>>
>> -indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py
>> -     $(AM_V_at)$(MKDIR_P) indices
>> -     $(AM_V_GEN) $(PYTHON2) $< > $@
>> -
>> -indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
>> -     $(AM_V_at)$(MKDIR_P) indices
>> -     $(AM_V_GEN) $(PYTHON2) $< > $@
>> -
>> -util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
>> -     $(AM_V_at)$(MKDIR_P) util
>> -     $(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@
>> -
>> +MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
>> +PYTHON_GEN =  $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
>
> So, this changes the dependencies (see below), and adds $(@D) to mkdir
> and $(PYTHON_FLAGS) to python... maybe a brief sentence in the commit
> message explaining why.
>
I felt that repeating the description might be an overkill considering
most of this series does is almost identical.

How about the following (also mentioned in the cover letter)

"auxiliary: rework the python generated sources rules

There are a few grains this commit aims to resolve:

One can generalise the mkdir rule to a simple MKDIR_P $(@D) which will
expand appropriately for even if we change the subdir name, and/or add
new rules. We can also drop the explicit $(srcdir) prefix for the
dependency rules, they they are not strictly required, nor used
elsewhere in mesa.

Finally replace $< with explicit filename to be consistent through the
file, and honour PYTHON_FLAGS.
"

>> +
>> +indices/u_indices_gen.c: indices/u_indices_gen.py
>
> Shouldn't all of these still depend on $(srcdir)/... ?
>
As mentioned above - I'm 98% sure that it's optional, plus other
places in mesa do not seem to use it. If you insist I can add it back.

Thanks
Emil


More information about the mesa-dev mailing list