summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Android.mk104
-rw-r--r--src/egl/Android.mk109
-rw-r--r--src/gallium/Android.mk3
-rw-r--r--src/gallium/auxiliary/Android.mk217
-rw-r--r--src/gallium/drivers/Android.mk1
-rw-r--r--src/gallium/drivers/i915/Android.mk48
-rw-r--r--src/gallium/drivers/softpipe/Android.mk52
-rw-r--r--src/gallium/drivers/svga/Android.mk73
-rw-r--r--src/gallium/state_trackers/Android.mk38
-rw-r--r--src/gallium/targets/Android.mk111
-rw-r--r--src/gallium/winsys/Android.mk1
-rw-r--r--src/gallium/winsys/i915/Android.mk33
-rw-r--r--src/gallium/winsys/svga/Android.mk39
-rw-r--r--src/gallium/winsys/sw/Android.mk19
-rw-r--r--src/glsl/Android.mk100
-rw-r--r--src/gralloc/Android.mk56
-rw-r--r--src/mapi/Android.mk23
-rw-r--r--src/mesa/Android.mk55
-rw-r--r--src/mesa/drivers/Android.mk258
19 files changed, 1340 insertions, 0 deletions
diff --git a/src/Android.mk b/src/Android.mk
new file mode 100644
index 0000000000..7c306dd953
--- /dev/null
+++ b/src/Android.mk
@@ -0,0 +1,104 @@
+# Either one of, or both of, MESA_BUILD_CLASSIC and MESA_BUILD_GALLIUM must be
+# set. When MESA_BUILD_GALLIUM is not set, EGL consists of
+#
+# libmesa_classic_egl
+# libmesa_egl
+#
+# and the rules for it can be found in egl/drivers/android/Android.mk.
+#
+# When MESA_BUILD_GALLIUM is set, EGL consists of
+#
+# libmesa_st_egl
+# libmesa_egl
+# libmesa_st_mesa
+# libmesa_pipe_<DRIVER>
+# libmesa_winsys_<DRIVER>
+# libmesa_gallium
+# <plus libmesa_classic_egl if MESA_BUILD_CLASSIC is also set>
+#
+# and the rules for it can be found in gallium/targets/Android.mk
+#
+# When MESA_BUILD_CLASSIC is set, DRI drivers are created. A DRI driver
+# consists of
+#
+# libmesa_classic_mesa
+# libmesa_glsl
+# <driver-specific objects>
+#
+# and the rules for it can be found in mesa/drivers/Android.mk.
+#
+# As for gralloc, the goal is to provide a single module that is able to
+# detect and support the hardware. This is not the case yet though.
+
+LOCAL_PATH := $(call my-dir)
+
+# DRI drivers
+MESA_BUILD_CLASSIC := false
+MESA_BUILD_I915C := false
+MESA_BUILD_I965C := false
+
+# Gallium drivers
+MESA_BUILD_GALLIUM := false
+MESA_BUILD_I915G := false
+MESA_BUILD_SWRAST := false
+
+# gralloc modules
+MESA_BUILD_INTEL := false
+MESA_BUILD_VMWGFX := false
+
+MESA_DO_BUILD := false
+
+ifeq ($(strip $(BOARD_USES_I915C)),true)
+MESA_BUILD_CLASSIC := true
+MESA_BUILD_I915C := true
+# gralloc
+MESA_BUILD_INTEL := true
+
+MESA_DO_BUILD := true
+endif
+
+ifeq ($(strip $(BOARD_USES_I915G)),true)
+MESA_BUILD_GALLIUM := true
+MESA_BUILD_I915G := true
+# gralloc
+MESA_BUILD_INTEL := true
+
+MESA_DO_BUILD := true
+endif
+
+ifeq ($(strip $(BOARD_USES_I965C)),true)
+MESA_BUILD_CLASSIC := true
+MESA_BUILD_I965C := true
+# gralloc
+MESA_BUILD_INTEL := true
+
+MESA_DO_BUILD := true
+endif
+
+ifeq ($(strip $(BOARD_USES_VMWGFX)),true)
+MESA_BUILD_GALLIUM := true
+MESA_BUILD_SWRAST := true
+# gralloc
+MESA_BUILD_VMWGFX := true
+
+MESA_DO_BUILD := true
+endif
+
+ifeq ($(strip $(MESA_DO_BUILD)),true)
+
+# build the real modules
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+symlink := $(TARGET_OUT_SHARED_LIBRARIES)/hw/gralloc.$(TARGET_PRODUCT)$(TARGET_SHLIB_SUFFIX)
+symlink_to := gralloc.mesa$(TARGET_SHLIB_SUFFIX)
+$(symlink): PRIVATE_TO := $(symlink_to)
+$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/hw/$(symlink_to)
+ @echo "Symlink: $@ -> $(PRIVATE_TO)"
+ @mkdir -p $(dir $@)
+ @rm -rf $@
+ $(hide) ln -sf $(PRIVATE_TO) $@
+ALL_PREBUILT += $(symlink)
+
+endif # MESA_DO_BUILD
diff --git a/src/egl/Android.mk b/src/egl/Android.mk
new file mode 100644
index 0000000000..143531ad6a
--- /dev/null
+++ b/src/egl/Android.mk
@@ -0,0 +1,109 @@
+# Android.mk for EGL
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# from main/Makefile
+SOURCES = \
+ eglapi.c \
+ eglarray.c \
+ eglconfig.c \
+ eglcontext.c \
+ eglcurrent.c \
+ egldisplay.c \
+ egldriver.c \
+ eglfallbacks.c \
+ eglglobals.c \
+ eglimage.c \
+ egllog.c \
+ eglmisc.c \
+ eglmode.c \
+ eglscreen.c \
+ eglstring.c \
+ eglsurface.c \
+ eglsync.c
+
+LOCAL_SRC_FILES := \
+ $(addprefix main/, $(SOURCES))
+
+LOCAL_CFLAGS := \
+ -DPTHREADS \
+ -D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_ANDROID \
+ -D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
+ -D_EGL_OS_UNIX=1 \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_ANDROID
+endif
+ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
+LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GALLIUM
+endif
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include
+
+LOCAL_MODULE := libmesa_egl
+
+include $(BUILD_STATIC_LIBRARY)
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ drivers/android/egl_android.c \
+ drivers/android/droid.c \
+ drivers/android/droid_core.c \
+ drivers/android/droid_image.c
+
+LOCAL_CFLAGS := \
+ -D_EGL_MAIN=_eglBuiltInDriverANDROID \
+ -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" \
+ -DPTHREADS \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/mapi \
+ external/mesa/src/egl/main \
+ external/mesa/src/gralloc \
+ external/drm \
+ external/drm/include/drm \
+ external/mesa/src/mesa/drivers
+
+LOCAL_MODULE := libmesa_classic_egl
+
+include $(BUILD_STATIC_LIBRARY)
+
+# build libGLES if gallium is not enabled
+ifneq ($(strip $(MESA_BUILD_GALLIUM)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES :=
+LOCAL_CFLAGS :=
+LOCAL_C_INCLUDES :=
+
+LOCAL_STATIC_LIBRARIES :=
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libmesa_classic_egl \
+ libmesa_egl
+
+LOCAL_SHARED_LIBRARIES := \
+ libglapi \
+ libdrm \
+ libdl \
+ libhardware \
+ liblog \
+ libcutils
+
+LOCAL_MODULE := libGLES_mesa
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
+
+include $(BUILD_SHARED_LIBRARY)
+endif # MESA_BUILD_GALLIUM
+
+endif # MESA_BUILD_CLASSIC
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
new file mode 100644
index 0000000000..32f8a7af3b
--- /dev/null
+++ b/src/gallium/Android.mk
@@ -0,0 +1,3 @@
+ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
+include $(call all-subdir-makefiles)
+endif
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
new file mode 100644
index 0000000000..f5513794ee
--- /dev/null
+++ b/src/gallium/auxiliary/Android.mk
@@ -0,0 +1,217 @@
+LOCAL_PATH := $(call my-dir)
+
+# from Makefile
+C_SOURCES = \
+ cso_cache/cso_cache.c \
+ cso_cache/cso_context.c \
+ cso_cache/cso_hash.c \
+ draw/draw_context.c \
+ draw/draw_fs.c \
+ draw/draw_gs.c \
+ draw/draw_pipe.c \
+ draw/draw_pipe_aaline.c \
+ draw/draw_pipe_aapoint.c \
+ draw/draw_pipe_clip.c \
+ draw/draw_pipe_cull.c \
+ draw/draw_pipe_flatshade.c \
+ draw/draw_pipe_offset.c \
+ draw/draw_pipe_pstipple.c \
+ draw/draw_pipe_stipple.c \
+ draw/draw_pipe_twoside.c \
+ draw/draw_pipe_unfilled.c \
+ draw/draw_pipe_util.c \
+ draw/draw_pipe_validate.c \
+ draw/draw_pipe_vbuf.c \
+ draw/draw_pipe_wide_line.c \
+ draw/draw_pipe_wide_point.c \
+ draw/draw_pt.c \
+ draw/draw_pt_emit.c \
+ draw/draw_pt_fetch.c \
+ draw/draw_pt_fetch_emit.c \
+ draw/draw_pt_fetch_shade_emit.c \
+ draw/draw_pt_fetch_shade_pipeline.c \
+ draw/draw_pt_post_vs.c \
+ draw/draw_pt_so_emit.c \
+ draw/draw_pt_util.c \
+ draw/draw_pt_vsplit.c \
+ draw/draw_vertex.c \
+ draw/draw_vs.c \
+ draw/draw_vs_aos.c \
+ draw/draw_vs_aos_io.c \
+ draw/draw_vs_aos_machine.c \
+ draw/draw_vs_exec.c \
+ draw/draw_vs_ppc.c \
+ draw/draw_vs_sse.c \
+ draw/draw_vs_varient.c \
+ indices/u_indices_gen.c \
+ indices/u_unfilled_gen.c \
+ os/os_misc.c \
+ os/os_stream.c \
+ os/os_stream_log.c \
+ os/os_stream_null.c \
+ os/os_stream_stdc.c \
+ os/os_stream_str.c \
+ os/os_time.c \
+ pipebuffer/pb_buffer_fenced.c \
+ pipebuffer/pb_buffer_malloc.c \
+ pipebuffer/pb_bufmgr_alt.c \
+ pipebuffer/pb_bufmgr_cache.c \
+ pipebuffer/pb_bufmgr_debug.c \
+ pipebuffer/pb_bufmgr_mm.c \
+ pipebuffer/pb_bufmgr_ondemand.c \
+ pipebuffer/pb_bufmgr_pool.c \
+ pipebuffer/pb_bufmgr_slab.c \
+ pipebuffer/pb_validate.c \
+ rbug/rbug_connection.c \
+ rbug/rbug_context.c \
+ rbug/rbug_core.c \
+ rbug/rbug_demarshal.c \
+ rbug/rbug_texture.c \
+ rbug/rbug_shader.c \
+ rtasm/rtasm_cpu.c \
+ rtasm/rtasm_execmem.c \
+ rtasm/rtasm_ppc.c \
+ rtasm/rtasm_ppc_spe.c \
+ rtasm/rtasm_x86sse.c \
+ tgsi/tgsi_build.c \
+ tgsi/tgsi_dump.c \
+ tgsi/tgsi_exec.c \
+ tgsi/tgsi_info.c \
+ tgsi/tgsi_iterate.c \
+ tgsi/tgsi_parse.c \
+ tgsi/tgsi_ppc.c \
+ tgsi/tgsi_sanity.c \
+ tgsi/tgsi_scan.c \
+ tgsi/tgsi_sse2.c \
+ tgsi/tgsi_text.c \
+ tgsi/tgsi_transform.c \
+ tgsi/tgsi_ureg.c \
+ tgsi/tgsi_util.c \
+ translate/translate.c \
+ translate/translate_cache.c \
+ translate/translate_generic.c \
+ translate/translate_sse.c \
+ util/u_debug.c \
+ util/u_debug_describe.c \
+ util/u_debug_refcnt.c \
+ util/u_debug_stack.c \
+ util/u_debug_symbol.c \
+ util/u_dump_defines.c \
+ util/u_dump_state.c \
+ util/u_bitmask.c \
+ util/u_blit.c \
+ util/u_blitter.c \
+ util/u_cache.c \
+ util/u_caps.c \
+ util/u_cpu_detect.c \
+ util/u_dl.c \
+ util/u_draw_quad.c \
+ util/u_format.c \
+ util/u_format_other.c \
+ util/u_format_latc.c \
+ util/u_format_s3tc.c \
+ util/u_format_rgtc.c \
+ util/u_format_srgb.c \
+ util/u_format_table.c \
+ util/u_format_tests.c \
+ util/u_format_yuv.c \
+ util/u_format_zs.c \
+ util/u_framebuffer.c \
+ util/u_gen_mipmap.c \
+ util/u_half.c \
+ util/u_handle_table.c \
+ util/u_hash.c \
+ util/u_hash_table.c \
+ util/u_index_modify.c \
+ util/u_keymap.c \
+ util/u_linear.c \
+ util/u_linkage.c \
+ util/u_network.c \
+ util/u_math.c \
+ util/u_mm.c \
+ util/u_pstipple.c \
+ util/u_rect.c \
+ util/u_ringbuffer.c \
+ util/u_sampler.c \
+ util/u_simple_shaders.c \
+ util/u_slab.c \
+ util/u_snprintf.c \
+ util/u_staging.c \
+ util/u_surface.c \
+ util/u_surfaces.c \
+ util/u_texture.c \
+ util/u_tile.c \
+ util/u_transfer.c \
+ util/u_resource.c \
+ util/u_upload_mgr.c \
+ util/u_vbuf_mgr.c
+
+GENERATED_SOURCES = \
+ indices/u_indices_gen.c \
+ indices/u_unfilled_gen.c \
+ util/u_format_srgb.c \
+ util/u_format_table.c \
+ util/u_half.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(filter-out $(GENERATED_SOURCES), $(C_SOURCES))
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers \
+ external/mesa/src/gallium/auxiliary/util
+
+LOCAL_MODULE := libmesa_gallium
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+intermediates := $(call local-intermediates-dir)
+
+GEN_SCRIPT := $(LOCAL_PATH)/indices/u_indices_gen.py
+GEN := $(intermediates)/indices/u_indices_gen.c
+$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
+$(GEN): $(GEN_SCRIPT)
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+GEN_SCRIPT := $(LOCAL_PATH)/indices/u_unfilled_gen.py
+GEN := $(intermediates)/indices/u_unfilled_gen.c
+$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
+$(GEN): $(GEN_SCRIPT)
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_srgb.py
+GEN := $(intermediates)/util/u_format_srgb.c
+$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
+$(GEN): $(GEN_SCRIPT)
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_table.py
+GEN := $(intermediates)/util/u_format_table.c
+$(GEN): PRIVATE_CUSTOM_TOOL := python $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv > $(GEN)
+$(GEN): $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+GEN_SCRIPT := $(LOCAL_PATH)/util/u_half.py
+GEN := $(intermediates)/util/u_half.c
+$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
+$(GEN): $(GEN_SCRIPT)
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/drivers/Android.mk b/src/gallium/drivers/Android.mk
new file mode 100644
index 0000000000..5053e7d643
--- /dev/null
+++ b/src/gallium/drivers/Android.mk
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff --git a/src/gallium/drivers/i915/Android.mk b/src/gallium/drivers/i915/Android.mk
new file mode 100644
index 0000000000..f2c1e5b5f8
--- /dev/null
+++ b/src/gallium/drivers/i915/Android.mk
@@ -0,0 +1,48 @@
+ifeq ($(strip $(MESA_BUILD_I915G)),true)
+
+LOCAL_PATH := $(call my-dir)
+
+# from Makefile
+C_SOURCES = \
+ i915_blit.c \
+ i915_clear.c \
+ i915_flush.c \
+ i915_context.c \
+ i915_debug.c \
+ i915_debug_fp.c \
+ i915_state.c \
+ i915_state_immediate.c \
+ i915_state_dynamic.c \
+ i915_state_derived.c \
+ i915_state_emit.c \
+ i915_state_fpc.c \
+ i915_state_sampler.c \
+ i915_state_static.c \
+ i915_screen.c \
+ i915_prim_emit.c \
+ i915_prim_vbuf.c \
+ i915_resource.c \
+ i915_resource_texture.c \
+ i915_resource_buffer.c \
+ i915_fpc_emit.c \
+ i915_fpc_translate.c \
+ i915_surface.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_pipe_i915
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_BUILD_I915G
diff --git a/src/gallium/drivers/softpipe/Android.mk b/src/gallium/drivers/softpipe/Android.mk
new file mode 100644
index 0000000000..d8a00f4492
--- /dev/null
+++ b/src/gallium/drivers/softpipe/Android.mk
@@ -0,0 +1,52 @@
+LOCAL_PATH := $(call my-dir)
+
+# from Makefile
+C_SOURCES = \
+ sp_fs_exec.c \
+ sp_fs_sse.c \
+ sp_clear.c \
+ sp_fence.c \
+ sp_flush.c \
+ sp_query.c \
+ sp_context.c \
+ sp_draw_arrays.c \
+ sp_prim_vbuf.c \
+ sp_quad_pipe.c \
+ sp_quad_stipple.c \
+ sp_quad_depth_test.c \
+ sp_quad_fs.c \
+ sp_quad_blend.c \
+ sp_screen.c \
+ sp_setup.c \
+ sp_state_blend.c \
+ sp_state_clip.c \
+ sp_state_derived.c \
+ sp_state_sampler.c \
+ sp_state_shader.c \
+ sp_state_so.c \
+ sp_state_rasterizer.c \
+ sp_state_surface.c \
+ sp_state_vertex.c \
+ sp_texture.c \
+ sp_tex_sample.c \
+ sp_tex_tile_cache.c \
+ sp_tile_cache.c \
+ sp_surface.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_pipe_softpipe
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/drivers/svga/Android.mk b/src/gallium/drivers/svga/Android.mk
new file mode 100644
index 0000000000..c39ee19086
--- /dev/null
+++ b/src/gallium/drivers/svga/Android.mk
@@ -0,0 +1,73 @@
+ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
+
+LOCAL_PATH := $(call my-dir)
+
+# from Makefile
+C_SOURCES = \
+ svgadump/svga_shader_dump.c \
+ svgadump/svga_shader_op.c \
+ svgadump/svga_dump.c \
+ svga_cmd.c \
+ svga_context.c \
+ svga_draw.c \
+ svga_draw_arrays.c \
+ svga_draw_elements.c \
+ svga_pipe_blend.c \
+ svga_pipe_blit.c \
+ svga_pipe_clear.c \
+ svga_pipe_constants.c \
+ svga_pipe_depthstencil.c \
+ svga_pipe_draw.c \
+ svga_pipe_flush.c \
+ svga_pipe_fs.c \
+ svga_pipe_misc.c \
+ svga_pipe_query.c \
+ svga_pipe_rasterizer.c \
+ svga_pipe_sampler.c \
+ svga_pipe_vertex.c \
+ svga_pipe_vs.c \
+ svga_screen.c \
+ svga_screen_cache.c \
+ svga_state.c \
+ svga_state_need_swtnl.c \
+ svga_state_constants.c \
+ svga_state_framebuffer.c \
+ svga_state_rss.c \
+ svga_state_tss.c \
+ svga_state_vdecl.c \
+ svga_state_fs.c \
+ svga_state_vs.c \
+ svga_swtnl_backend.c \
+ svga_swtnl_draw.c \
+ svga_swtnl_state.c \
+ svga_tgsi.c \
+ svga_tgsi_decl_sm20.c \
+ svga_tgsi_decl_sm30.c \
+ svga_tgsi_insn.c \
+ svga_sampler_view.c \
+ svga_surface.c \
+ svga_resource.c \
+ svga_resource_texture.c \
+ svga_resource_buffer.c \
+ svga_resource_buffer_upload.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers/svga/include
+
+LOCAL_MODULE := libmesa_pipe_svga
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_BUILD_VMWGFX
diff --git a/src/gallium/state_trackers/Android.mk b/src/gallium/state_trackers/Android.mk
new file mode 100644
index 0000000000..e0ae537505
--- /dev/null
+++ b/src/gallium/state_trackers/Android.mk
@@ -0,0 +1,38 @@
+LOCAL_PATH := $(call my-dir)
+
+common_SOURCES := \
+ egl/common/egl_g3d.c \
+ egl/common/egl_g3d_api.c \
+ egl/common/egl_g3d_image.c \
+ egl/common/egl_g3d_st.c \
+ egl/common/egl_g3d_sync.c \
+ egl/common/native_helper.c
+
+android_SOURCES := \
+ egl/android/native_android.cpp
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(common_SOURCES) \
+ $(android_SOURCES)
+
+LOCAL_CFLAGS := \
+ -DHAVE_ANDROID_BACKEND \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/egl/main \
+ external/mesa/src/gallium/state_trackers/egl \
+ external/mesa/src/gallium/winsys/sw \
+ external/mesa/src/gralloc \
+ external/drm \
+ external/drm/include/drm
+
+LOCAL_MODULE := libmesa_st_egl
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/targets/Android.mk b/src/gallium/targets/Android.mk
new file mode 100644
index 0000000000..f37ed1e6a2
--- /dev/null
+++ b/src/gallium/targets/Android.mk
@@ -0,0 +1,111 @@
+# Android.mk for Gallium EGL and gralloc
+
+LOCAL_PATH := $(call my-dir)
+
+# EGL
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ egl-static/egl.c \
+ egl-static/egl_pipe.c \
+ egl-static/egl_st.c
+
+LOCAL_CFLAGS := \
+ -DFEATURE_ES1=1 \
+ -DFEATURE_ES2=1 \
+ -DGALLIUM_SOFTPIPE \
+ -D_EGL_MAIN=_eglBuiltInDriverGALLIUM \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers \
+ external/mesa/src/gallium/winsys \
+ external/mesa/src/gallium/state_trackers/vega \
+ external/mesa/src/gallium/state_trackers/egl \
+ external/mesa/src/egl/main \
+ external/mesa/src/mesa
+
+LOCAL_STATIC_LIBRARIES := \
+ libmesa_st_egl \
+ libmesa_winsys_sw \
+ libmesa_pipe_softpipe \
+ libmesa_st_mesa \
+ libmesa_glsl \
+ libmesa_st_mesa \
+ libmesa_talloc \
+ libmesa_gallium
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libmesa_egl
+
+LOCAL_SHARED_LIBRARIES := \
+ libglapi \
+ libdl \
+ libhardware \
+ liblog \
+ libcutils
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+LOCAL_STATIC_LIBRARIES := \
+ libmesa_classic_egl \
+ $(LOCAL_STATIC_LIBRARIES)
+LOCAL_SHARED_LIBRARIES += libdrm
+endif # MESA_BUILD_CLASSIC
+
+ifeq ($(strip $(MESA_BUILD_I915G)),true)
+LOCAL_CFLAGS += -D_EGL_PIPE_I915
+LOCAL_STATIC_LIBRARIES := \
+ libmesa_winsys_i915 \
+ libmesa_pipe_i915 \
+ $(LOCAL_STATIC_LIBRARIES)
+LOCAL_SHARED_LIBRARIES += \
+ libdrm \
+ libdrm_intel
+endif # MESA_BUILD_I915G
+
+LOCAL_MODULE := libGLES_mesa
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
+
+include $(BUILD_SHARED_LIBRARY)
+
+# gralloc (broken!)
+ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := egl/egl_pipe.c
+
+LOCAL_CFLAGS := \
+ -D_EGL_PIPE_VMWGFX=1 \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers \
+ external/mesa/src/gallium/winsys
+
+LOCAL_STATIC_LIBRARIES := \
+ libmesa_pipe_svga \
+ libmesa_winsys_svga \
+ libmesa_gallium
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libmesa_st_gralloc
+
+LOCAL_SHARED_LIBRARIES := \
+ libdl \
+ liblog \
+ libcutils \
+ libdrm \
+ libEGL
+
+LOCAL_MODULE := gralloc.mesa
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+
+include $(BUILD_SHARED_LIBRARY)
+endif # MESA_BUILD_VMWGFX
diff --git a/src/gallium/winsys/Android.mk b/src/gallium/winsys/Android.mk
new file mode 100644
index 0000000000..5053e7d643
--- /dev/null
+++ b/src/gallium/winsys/Android.mk
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff --git a/src/gallium/winsys/i915/Android.mk b/src/gallium/winsys/i915/Android.mk
new file mode 100644
index 0000000000..1810b76e54
--- /dev/null
+++ b/src/gallium/winsys/i915/Android.mk
@@ -0,0 +1,33 @@
+ifeq ($(strip $(MESA_BUILD_I915G)),true)
+
+LOCAL_PATH := $(call my-dir)
+
+# from drm/Makefile
+C_SOURCES = \
+ i915_drm_batchbuffer.c \
+ i915_drm_buffer.c \
+ i915_drm_fence.c \
+ i915_drm_winsys.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(addprefix drm/, $(C_SOURCES))
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers \
+ external/drm \
+ external/drm/include/drm \
+ external/drm/intel
+
+LOCAL_MODULE := libmesa_winsys_i915
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_BUILD_I915G
diff --git a/src/gallium/winsys/svga/Android.mk b/src/gallium/winsys/svga/Android.mk
new file mode 100644
index 0000000000..61c99fb524
--- /dev/null
+++ b/src/gallium/winsys/svga/Android.mk
@@ -0,0 +1,39 @@
+ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
+
+LOCAL_PATH := $(call my-dir)
+
+# from drm/Makefile
+C_SOURCES = \
+ vmw_buffer.c \
+ vmw_context.c \
+ vmw_fence.c \
+ vmw_screen.c \
+ vmw_screen_dri.c \
+ vmw_screen_ioctl.c \
+ vmw_screen_pools.c \
+ vmw_screen_svga.c \
+ vmw_surface.c
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(addprefix drm/, $(C_SOURCES))
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary \
+ external/mesa/src/gallium/drivers/svga \
+ external/mesa/src/gallium/drivers/svga/include \
+ external/drm \
+ external/drm/include/drm
+
+LOCAL_MODULE := libmesa_winsys_svga
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_BUILD_VMWGFX
diff --git a/src/gallium/winsys/sw/Android.mk b/src/gallium/winsys/sw/Android.mk
new file mode 100644
index 0000000000..368d9ee975
--- /dev/null
+++ b/src/gallium/winsys/sw/Android.mk
@@ -0,0 +1,19 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ android/android_sw_winsys.cpp
+
+LOCAL_CFLAGS := \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_winsys_sw
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk
new file mode 100644
index 0000000000..f7f733b0b6
--- /dev/null
+++ b/src/glsl/Android.mk
@@ -0,0 +1,100 @@
+# Android.mk for glsl
+
+LOCAL_PATH := $(call my-dir)
+
+# from Makefile
+LIBGLCPP_SOURCES = \
+ glcpp/glcpp-lex.c \
+ glcpp/glcpp-parse.c \
+ glcpp/pp.c
+
+C_SOURCES = \
+ strtod.c \
+ ralloc.c \
+ $(LIBGLCPP_SOURCES)
+
+CXX_SOURCES = \
+ ast_expr.cpp \
+ ast_function.cpp \
+ ast_to_hir.cpp \
+ ast_type.cpp \
+ glsl_lexer.cpp \
+ glsl_parser.cpp \
+ glsl_parser_extras.cpp \
+ glsl_types.cpp \
+ glsl_symbol_table.cpp \
+ hir_field_selection.cpp \
+ ir_basic_block.cpp \
+ ir_clone.cpp \
+ ir_constant_expression.cpp \
+ ir.cpp \
+ ir_expression_flattening.cpp \
+ ir_function_can_inline.cpp \
+ ir_function.cpp \
+ ir_hierarchical_visitor.cpp \
+ ir_hv_accept.cpp \
+ ir_import_prototypes.cpp \
+ ir_print_visitor.cpp \
+ ir_reader.cpp \
+ ir_rvalue_visitor.cpp \
+ ir_set_program_inouts.cpp \
+ ir_validate.cpp \
+ ir_variable.cpp \
+ ir_variable_refcount.cpp \
+ linker.cpp \
+ link_functions.cpp \
+ loop_analysis.cpp \
+ loop_controls.cpp \
+ loop_unroll.cpp \
+ lower_discard.cpp \
+ lower_if_to_cond_assign.cpp \
+ lower_instructions.cpp \
+ lower_jumps.cpp \
+ lower_mat_op_to_vec.cpp \
+ lower_noise.cpp \
+ lower_texture_projection.cpp \
+ lower_variable_index_to_cond_assign.cpp \
+ lower_vec_index_to_cond_assign.cpp \
+ lower_vec_index_to_swizzle.cpp \
+ lower_vector.cpp \
+ opt_algebraic.cpp \
+ opt_constant_folding.cpp \
+ opt_constant_propagation.cpp \
+ opt_constant_variable.cpp \
+ opt_copy_propagation.cpp \
+ opt_copy_propagation_elements.cpp \
+ opt_dead_code.cpp \
+ opt_dead_code_local.cpp \
+ opt_dead_functions.cpp \
+ opt_discard_simplification.cpp \
+ opt_function_inlining.cpp \
+ opt_if_simplification.cpp \
+ opt_noop_swizzle.cpp \
+ opt_redundant_jumps.cpp \
+ opt_structure_splitting.cpp \
+ opt_swizzle_swizzle.cpp \
+ opt_tree_grafting.cpp \
+ s_expression.cpp
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES) \
+ $(CXX_SOURCES) \
+ builtin_function.cpp
+
+LOCAL_CFLAGS := \
+ -DPTHREADS \
+ -fvisibility=hidden \
+ -Wno-sign-compare \
+ -Wno-error=non-virtual-dtor \
+ -Wno-non-virtual-dtor
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/mapi \
+ external/mesa/src/mesa
+
+LOCAL_MODULE := libmesa_glsl
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gralloc/Android.mk b/src/gralloc/Android.mk
new file mode 100644
index 0000000000..cf85517d6d
--- /dev/null
+++ b/src/gralloc/Android.mk
@@ -0,0 +1,56 @@
+# Android.mk for gralloc
+
+LOCAL_PATH := $(call my-dir)
+
+common_SRC_FILES := \
+ gralloc_gem.c \
+ gralloc_kms.c \
+ gralloc_mod.c
+
+common_C_INCLUDES := \
+ external/drm \
+ external/drm/include/drm
+
+common_SHARED_LIBRARIES := \
+ libdrm \
+ liblog \
+ libcutils
+
+ifeq ($(strip $(MESA_BUILD_INTEL)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(common_SRC_FILES) \
+ gralloc_gem_i915.c
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ external/drm/intel
+
+LOCAL_SHARED_LIBRARIES := \
+ $(common_SHARED_LIBRARIES) \
+ libdrm_intel \
+ libEGL
+
+LOCAL_MODULE := gralloc.mesa
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+
+include $(BUILD_SHARED_LIBRARY)
+endif # MESA_BUILD_INTEL
+
+ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(common_SRC_FILES) \
+ gralloc_gem_pipe.c
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_st_gralloc
+
+include $(BUILD_STATIC_LIBRARY)
+endif # MESA_BUILD_GALLIUM
diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk
new file mode 100644
index 0000000000..5af2988e80
--- /dev/null
+++ b/src/mapi/Android.mk
@@ -0,0 +1,23 @@
+# Android.mk for glapi
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+include $(LOCAL_PATH)/mapi/sources.mak
+LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
+
+LOCAL_CFLAGS := \
+ -DPTHREADS \
+ -DMAPI_MODE_GLAPI \
+ -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\" \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+LOCAL_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/mapi
+
+LOCAL_MODULE := libglapi
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
new file mode 100644
index 0000000000..f361aca3e4
--- /dev/null
+++ b/src/mesa/Android.mk
@@ -0,0 +1,55 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/sources.mak
+
+common_CFLAGS := \
+ -DPTHREADS \
+ -DFEATURE_ES1=1 \
+ -DFEATURE_ES2=1 \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+common_CFLAGS += -DFEATURE_GL=1
+endif
+
+common_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/mapi \
+ external/mesa/src/glsl
+
+ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(MESA_GALLIUM_SOURCES) \
+ $(MESA_GALLIUM_CXX_SOURCES)
+
+LOCAL_CFLAGS := $(common_CFLAGS)
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ external/mesa/src/gallium/include \
+ external/mesa/src/gallium/auxiliary
+
+LOCAL_MODULE := libmesa_st_mesa
+
+include $(BUILD_STATIC_LIBRARY)
+endif # MESA_BUILD_GALLIUM
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(MESA_SOURCES) \
+ $(MESA_CXX_SOURCES)
+
+LOCAL_CFLAGS := $(common_CFLAGS)
+LOCAL_C_INCLUDES := $(common_C_INCLUDES)
+
+LOCAL_MODULE := libmesa_classic_mesa
+
+include $(BUILD_STATIC_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
+endif # MESA_BUILD_CLASSIC
diff --git a/src/mesa/drivers/Android.mk b/src/mesa/drivers/Android.mk
new file mode 100644
index 0000000000..7fb540af11
--- /dev/null
+++ b/src/mesa/drivers/Android.mk
@@ -0,0 +1,258 @@
+# Android.mk for DRI drivers
+
+LOCAL_PATH := $(call my-dir)
+
+# from dri/i915/Makefile
+i915_DRIVER_SOURCES = \
+ i830_context.c \
+ i830_state.c \
+ i830_texblend.c \
+ i830_texstate.c \
+ i830_vtbl.c \
+ intel_render.c \
+ intel_regions.c \
+ intel_buffer_objects.c \
+ intel_batchbuffer.c \
+ intel_clear.c \
+ intel_extensions.c \
+ intel_extensions_es2.c \
+ intel_mipmap_tree.c \
+ intel_tex_layout.c \
+ intel_tex_image.c \
+ intel_tex_subimage.c \
+ intel_tex_copy.c \
+ intel_tex_validate.c \
+ intel_tex_format.c \
+ intel_tex.c \
+ intel_pixel.c \
+ intel_pixel_bitmap.c \
+ intel_pixel_copy.c \
+ intel_pixel_draw.c \
+ intel_pixel_read.c \
+ intel_buffers.c \
+ intel_blit.c \
+ i915_tex_layout.c \
+ i915_texstate.c \
+ i915_context.c \
+ i915_debug.c \
+ i915_debug_fp.c \
+ i915_fragprog.c \
+ i915_program.c \
+ i915_state.c \
+ i915_vtbl.c \
+ intel_context.c \
+ intel_decode.c \
+ intel_screen.c \
+ intel_span.c \
+ intel_state.c \
+ intel_syncobj.c \
+ intel_tris.c \
+ intel_fbo.c
+i915_DRIVER_SOURCES := $(addprefix dri/i915/, $(i915_DRIVER_SOURCES))
+
+# from dri/i965/Makefile
+i965_DRIVER_SOURCES = \
+ intel_batchbuffer.c \
+ intel_blit.c \
+ intel_buffer_objects.c \
+ intel_buffers.c \
+ intel_clear.c \
+ intel_context.c \
+ intel_decode.c \
+ intel_extensions.c \
+ intel_extensions_es2.c \
+ intel_fbo.c \
+ intel_mipmap_tree.c \
+ intel_regions.c \
+ intel_screen.c \
+ intel_span.c \
+ intel_pixel.c \
+ intel_pixel_bitmap.c \
+ intel_pixel_copy.c \
+ intel_pixel_draw.c \
+ intel_pixel_read.c \
+ intel_state.c \
+ intel_syncobj.c \
+ intel_tex.c \
+ intel_tex_copy.c \
+ intel_tex_format.c \
+ intel_tex_image.c \
+ intel_tex_layout.c \
+ intel_tex_subimage.c \
+ intel_tex_validate.c \
+ brw_cc.c \
+ brw_clip.c \
+ brw_clip_line.c \
+ brw_clip_point.c \
+ brw_clip_state.c \
+ brw_clip_tri.c \
+ brw_clip_unfilled.c \
+ brw_clip_util.c \
+ brw_context.c \
+ brw_curbe.c \
+ brw_disasm.c \
+ brw_draw.c \
+ brw_draw_upload.c \
+ brw_eu.c \
+ brw_eu_debug.c \
+ brw_eu_emit.c \
+ brw_eu_util.c \
+ brw_fallback.c \
+ brw_gs.c \
+ brw_gs_emit.c \
+ brw_gs_state.c \
+ brw_misc_state.c \
+ brw_optimize.c \
+ brw_program.c \
+ brw_queryobj.c \
+ brw_sf.c \
+ brw_sf_emit.c \
+ brw_sf_state.c \
+ brw_state.c \
+ brw_state_batch.c \
+ brw_state_cache.c \
+ brw_state_dump.c \
+ brw_state_upload.c \
+ brw_tex.c \
+ brw_tex_layout.c \
+ brw_urb.c \
+ brw_util.c \
+ brw_vs.c \
+ brw_vs_constval.c \
+ brw_vs_emit.c \
+ brw_vs_state.c \
+ brw_vs_surface_state.c \
+ brw_vtbl.c \
+ brw_wm.c \
+ brw_wm_debug.c \
+ brw_wm_emit.c \
+ brw_wm_fp.c \
+ brw_wm_iz.c \
+ brw_wm_pass0.c \
+ brw_wm_pass1.c \
+ brw_wm_pass2.c \
+ brw_wm_sampler_state.c \
+ brw_wm_state.c \
+ brw_wm_surface_state.c \
+ gen6_cc.c \
+ gen6_clip_state.c \
+ gen6_depthstencil.c \
+ gen6_gs_state.c \
+ gen6_sampler_state.c \
+ gen6_scissor_state.c \
+ gen6_sf_state.c \
+ gen6_urb.c \
+ gen6_viewport_state.c \
+ gen6_vs_state.c \
+ gen6_wm_state.c
+i965_CXX_SOURCES = \
+ brw_cubemap_normalize.cpp \
+ brw_fs.cpp \
+ brw_fs_channel_expressions.cpp \
+ brw_fs_reg_allocate.cpp \
+ brw_fs_schedule_instructions.cpp \
+ brw_fs_vector_splitting.cpp
+i965_DRIVER_SOURCES := \
+ $(addprefix dri/i965/, $(i965_DRIVER_SOURCES)) \
+ $(addprefix dri/i965/, $(i965_CXX_SOURCES))
+
+# from dri/Makefile.template
+common_SOURCES = \
+ dri/common/utils.c \
+ dri/common/vblank.c \
+ dri/common/dri_util.c \
+ dri/common/xmlconfig.c \
+ dri/common/texmem.c \
+ dri/common/drirenderbuffer.c \
+ common/driverfuncs.c
+
+common_CFLAGS := \
+ -DPTHREADS \
+ -DFEATURE_GL=1 \
+ -DFEATURE_ES1=1 \
+ -DFEATURE_ES2=1 \
+ -fvisibility=hidden \
+ -Wno-sign-compare
+
+common_C_INCLUDES := \
+ external/mesa/include \
+ external/mesa/src/mapi \
+ external/mesa/src/glsl \
+ external/mesa/src/mesa \
+ external/mesa/src/mesa/drivers/dri/common \
+ external/drm/ \
+ external/drm/include/drm \
+ external/expat/lib
+
+common_STATIC_LIBRARIES := \
+ libmesa_classic_mesa \
+ libmesa_glsl \
+ libmesa_classic_mesa
+
+common_SHARED_LIBRARIES := \
+ libglapi \
+ libdl \
+ libdrm \
+ libexpat \
+ liblog \
+ libcutils
+
+common_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/dri
+
+ifeq ($(strip $(MESA_BUILD_I915C)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(common_SOURCES) \
+ $(i915_DRIVER_SOURCES)
+
+LOCAL_CFLAGS := \
+ $(common_CFLAGS) \
+ -DI915
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ external/mesa/src/mesa/drivers/dri/intel \
+ external/drm/intel
+
+LOCAL_STATIC_LIBRARIES := \
+ $(common_STATIC_LIBRARIES)
+
+LOCAL_SHARED_LIBRARIES := \
+ $(common_SHARED_LIBRARIES) \
+ libdrm_intel
+
+LOCAL_MODULE := i915_dri
+LOCAL_MODULE_PATH := $(common_MODULE_PATH)
+
+include $(BUILD_SHARED_LIBRARY)
+endif # MESA_BUILD_I915C
+
+ifeq ($(strip $(MESA_BUILD_I965C)),true)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(common_SOURCES) \
+ $(i965_DRIVER_SOURCES)
+
+LOCAL_CFLAGS := \
+ $(common_CFLAGS) \
+ -DI965
+
+LOCAL_C_INCLUDES := \
+ $(common_C_INCLUDES) \
+ external/mesa/src/mesa/drivers/dri/intel \
+ external/drm/intel
+
+LOCAL_STATIC_LIBRARIES := \
+ $(common_STATIC_LIBRARIES)
+
+LOCAL_SHARED_LIBRARIES := \
+ $(common_SHARED_LIBRARIES) \
+ libdrm_intel
+
+LOCAL_MODULE := i965_dri
+LOCAL_MODULE_PATH := $(common_MODULE_PATH)
+
+include $(BUILD_SHARED_LIBRARY)
+endif # MESA_BUILD_I965C