[Mesa-dev] [PATCH 5/8] make: Factor out source lists from drivers/dri/common into Makefile.sources

Chad Versace chad at chad-versace.us
Sun Aug 28 08:42:24 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/26/2011 10:56 PM, Chia-I Wu wrote:
> On Sat, Aug 27, 2011 at 9:53 AM, Chad Versace <chad at chad-versace.us> wrote:
>> In order that the autoconf and Android build can share the same source
>> lists, move the lists from
>>  src/mesa/drivers/dri/Makefile.defines
>> into
>>  src/mesa/drivers/dri/common/Makefile.sources
>>
>> I would like for Android to just reuse Makefile.defines, but the file is
>> unsuitable for Android.
>>
>> Signed-off: Chad Versace <chad at chad-versace.us>
>> ---
>>  src/mesa/drivers/dri/Makefile.defines        |   23 ++++++++++-------------
>>  src/mesa/drivers/dri/common/Makefile.sources |   18 ++++++++++++++++++
>>  2 files changed, 28 insertions(+), 13 deletions(-)
>>  create mode 100644 src/mesa/drivers/dri/common/Makefile.sources
>>
>> diff --git a/src/mesa/drivers/dri/Makefile.defines b/src/mesa/drivers/dri/Makefile.defines
>> index 90ae551..536bcc6 100644
>> --- a/src/mesa/drivers/dri/Makefile.defines
>> +++ b/src/mesa/drivers/dri/Makefile.defines
>> @@ -1,14 +1,16 @@
>>  # -*-makefile-*-
>>
>> +# MESA_TOP is relative the driver's directory.
>> +MESA_TOP := ../../../../..
>> +
>> +# Import mesa_dri_common_*
>> +include $(MESA_TOP)/src/mesa/drivers/dri/common/Makefile.sources
>> +
>>  COMMON_GALLIUM_SOURCES = \
>> -        ../common/utils.c \
>> -        ../common/vblank.c \
>> -        ../common/dri_util.c \
>> -        ../common/xmlconfig.c
>> +       $(addprefix ../common/, $(mesa_dri_common_gallium_SOURCES))
>>
>> -COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
>> -        ../common/texmem.c \
>> -        ../common/drirenderbuffer.c
>> +COMMON_SOURCES = \
>> +       $(addprefix ../common/, $(mesa_dri_common_SOURCES))
>>
>>  INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
>>
>> @@ -20,13 +22,8 @@ OBJECTS = $(C_SOURCES:.c=.o) \
>>  ### Include directories
>>  SHARED_INCLUDES = \
>>        -I. \
>> -       -I$(TOP)/src/mesa/drivers/dri/common \
>>        -Iserver \
>> -       -I$(TOP)/include \
>> -       -I$(TOP)/src/mapi \
>> -       -I$(TOP)/src/mesa \
>> -       -I$(TOP)/src/egl/main \
>> -       -I$(TOP)/src/egl/drivers/dri \
>> +       $(addprefix -I, $(mesa_dri_common_INCLUDES)) \
>>        $(LIBDRM_CFLAGS)
>>
>>  INCLUDES += $(API_DEFINES)
>> diff --git a/src/mesa/drivers/dri/common/Makefile.sources b/src/mesa/drivers/dri/common/Makefile.sources
>> new file mode 100644
>> index 0000000..bdb6518
>> --- /dev/null
>> +++ b/src/mesa/drivers/dri/common/Makefile.sources
>> @@ -0,0 +1,18 @@
>> +mesa_dri_common_gallium_SOURCES := \
>> +       utils.c \
>> +       vblank.c \
>> +       dri_util.c \
>> +       xmlconfig.c
>> +
>> +mesa_dri_common_SOURCES := \
>> +       $(mesa_dri_common_gallium_SOURCES) \
>> +        texmem.c \
>> +        drirenderbuffer.c
>> +
>> +mesa_dri_common_INCLUDES := \
>> +       $(MESA_TOP)/include \
>> +       $(MESA_TOP)/src/egl/drivers/dri \
>> +       $(MESA_TOP)/src/egl/main \
>> +       $(MESA_TOP)/src/mapi \
>> +       $(MESA_TOP)/src/mesa \
>> +       $(MESA_TOP)/src/mesa/drivers/dri/common \

> Not a strong opinion here, but is it possible to make Makefile.sources
> self-contained?  That is, no dependency on MESA_TOP.

Sure, we can do that, as long as we maintain the convention that x_INCLUDES in Makefile.sources
is always relative to MESA_TOP. Then each user of Makefile.sources will need to prefix
x_INCLUDES accordingly.

I'm posting a v2 of this series which will have the change.

- -- 
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOWmHgAAoJEAIvNt057x8ikjIP/AmGzsDjTNcjf/hYHa1+RB5s
w9gQPNsm4DGHRJoqvO33sx7UA74pqWRj8PUQCjyq9hHjzNVlV1zTxvIzfJA7pKYk
fhibj3n9cItS2z4yeySt8CWLiRpkdXRWWy/kF1ivv+YL1+b+NxW/4IFNNBtyyfls
HSXv3JMPJk3T09uWvuygDoPaIY+VsMbg1fmfoutEDesSGdDZjqu0ihSfHqYGCK15
kw2d088/5YLAJo4IvSznYebrC7+i/kL8qLohCT7rNCzAji6LuH90zihELFFuf/yz
J8YvtK4NTD6iRgo70GJuYs/LCrZeEpSu/DuBqqKWQNjEyaGrRSuYw5enCAXRBgxz
dWFZhSoy5sMoIEtWQXiMmZdHbZ3aqy/kfYIWUQWECG2wTpBtZWP9sG/8arHR+j7v
i+ui4mDlx7CAguTZCGCgl/4KMOiPXrQl+xnowB+JYV2sdOkwCr1t7bhQ8GpP+q4a
oLy6iRWJkqpTjAqb3kAW1O0mUYy3G+oRH3VqdWQe23FZBKVCd02GpLkPSGfe4Kv8
cWJlFfthWAbdpAO4JjH4bMI4Ld8xxopdksTRagCFzdkMyRKWMfaZentlaSIHu68B
oGPPIMrK8THmWtSRfD6rz59m9TwCv7xmTgrr4gdQ0e0o58UwUufNqrH4ipYmWdFB
Y4XkP27hiJWft8QWwP0j
=i8oO
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list