Convert all variables in Makefile.defines to be of the simply-expanded
flavor.

As a side-effect, OBJECTS must be moved from Makefile.defines to
Makefile.targets.

This commit is a cleanup for Android.

Rationale
---------
>From the GNU Make manual, Section 6.2 The Two Flavors of Variables:
    There are two ways that a variable in GNU make can have a value; we
    call them the two flavors of variables. The two flavors are
    distinguished in how they are defined and in what they do when
    expanded. [...] The first flavor of variable is a recursively expanded
    variable. [...] To avoid all the problems and inconveniences of
    recursively expanded variables, there is another flavor: simply
    expanded variables.

There are two prominent properties of the Android build system that render
the "problems and inconveniences of recursively expanded variables"
fatally poisonous.
    1. All components of the Android platform reside in a single source
       tree.
    2. Android is built with a single, non-recursive invocation of `make`.

Note: This is in preparation for porting i965 to Android.
CC: Chia-I Wu <o...@lunarg.com>,
CC: Chih-Wei Huang <cwhu...@android-x86.org>
Signed-off-by: Chad Versace <c...@chad-versace.us>
---
 src/mesa/drivers/dri/Makefile.defines |   15 +++++----------
 src/mesa/drivers/dri/Makefile.targets |    5 +++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/Makefile.defines 
b/src/mesa/drivers/dri/Makefile.defines
index 47a3c1b..1ee6ce2 100644
--- a/src/mesa/drivers/dri/Makefile.defines
+++ b/src/mesa/drivers/dri/Makefile.defines
@@ -1,25 +1,18 @@
 # -*-makefile-*-
 
-COMMON_GALLIUM_SOURCES = \
+COMMON_GALLIUM_SOURCES := \
         ../common/utils.c \
         ../common/vblank.c \
         ../common/dri_util.c \
         ../common/xmlconfig.c
 
-COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
+COMMON_SOURCES := $(COMMON_GALLIUM_SOURCES) \
         ../../common/driverfuncs.c \
         ../common/texmem.c \
         ../common/drirenderbuffer.c
 
-INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
-
-OBJECTS = $(C_SOURCES:.c=.o) \
-         $(CXX_SOURCES:.cpp=.o) \
-         $(ASM_SOURCES:.S=.o) 
-
-
 ### Include directories
-SHARED_INCLUDES = \
+SHARED_INCLUDES := \
        -I. \
        -I$(TOP)/src/mesa/drivers/dri/common \
        -Iserver \
@@ -29,5 +22,7 @@ SHARED_INCLUDES = \
        -I$(TOP)/src/egl/main \
        $(LIBDRM_CFLAGS)
 
+INCLUDES := $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
 INCLUDES += $(API_DEFINES)
+
 CXXFLAGS += $(API_DEFINES)
diff --git a/src/mesa/drivers/dri/Makefile.targets 
b/src/mesa/drivers/dri/Makefile.targets
index 436b2a3..c269bfc 100644
--- a/src/mesa/drivers/dri/Makefile.targets
+++ b/src/mesa/drivers/dri/Makefile.targets
@@ -1,5 +1,10 @@
 # -*-makefile-*-
 
+OBJECTS := $(C_SOURCES:.c=.o) \
+         $(CXX_SOURCES:.cpp=.o) \
+         $(ASM_SOURCES:.S=.o)
+
+
 ##### RULES #####
 
 .c.o:
-- 
1.7.6

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to