automake: Merge separated *_CXX_FILES variables to *_FILES in core mesa.
[mesa.git] / src / mesa / Android.mk
1 # Mesa 3-D graphics library
2 #
3 # Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
4 # Copyright (C) 2010-2011 LunarG Inc.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the "Software"),
8 # to deal in the Software without restriction, including without limitation
9 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 # and/or sell copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 # DEALINGS IN THE SOFTWARE.
23
24 # Android.mk for core mesa
25
26 LOCAL_PATH := $(call my-dir)
27
28 # Import the following variables:
29 # MESA_GALLIUM_FILES
30 # MESA_FILES
31 # X86_FILES
32 include $(LOCAL_PATH)/sources.mak
33
34 MESA_ENABLED_APIS := ES1 ES2
35
36 common_C_INCLUDES := \
37 $(MESA_TOP)/src/mapi \
38 $(MESA_TOP)/src/glsl
39
40 common_ASM :=
41
42 # ---------------------------------------
43 # Build mesa_gen_matypes for host
44 # ---------------------------------------
45
46 ifeq ($(strip $(MESA_ENABLE_ASM)),true)
47 ifeq ($(TARGET_ARCH),x86)
48 common_ASM += $(X86_FILES)
49
50 include $(CLEAR_VARS)
51 LOCAL_SRC_FILES := x86/gen_matypes.c
52 LOCAL_CFLAGS := $(common_CFLAGS)
53 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
54 LOCAL_MODULE := mesa_gen_matypes
55 LOCAL_IS_HOST_MODULE := true
56 include $(MESA_COMMON_MK)
57 include $(BUILD_HOST_EXECUTABLE)
58
59 endif # x86
60 endif # MESA_ENABLE_ASM
61
62 # ---------------------------------------
63 # Build libmesa_st_mesa
64 # ---------------------------------------
65
66 ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
67 include $(CLEAR_VARS)
68
69 LOCAL_SRC_FILES := \
70 $(MESA_GALLIUM_FILES) \
71 $(common_ASM)
72
73 LOCAL_CFLAGS := $(common_CFLAGS)
74
75 LOCAL_C_INCLUDES := \
76 $(common_C_INCLUDES) \
77 $(MESA_TOP)/src/gallium/include \
78 $(MESA_TOP)/src/gallium/auxiliary
79
80 LOCAL_MODULE := libmesa_st_mesa
81
82 include $(LOCAL_PATH)/Android.gen.mk
83 include $(MESA_COMMON_MK)
84 include $(BUILD_STATIC_LIBRARY)
85 endif # MESA_BUILD_GALLIUM
86
87 # ---------------------------------------
88 # Build libmesa_dricore for DRI modules
89 # ---------------------------------------
90
91 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
92
93 include $(CLEAR_VARS)
94
95 LOCAL_MODULE := libmesa_dricore
96 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
97
98 MESA_ENABLED_APIS += GL
99 LOCAL_CFLAGS := \
100 $(common_CFLAGS) \
101 $(patsubst %,-DFEATURE_%=1,$(MESA_ENABLED_APIS))
102
103 LOCAL_C_INCLUDES := \
104 $(common_C_INCLUDES)
105
106 LOCAL_SRC_FILES := \
107 $(MESA_FILES) \
108 $(common_ASM)
109
110 include $(LOCAL_PATH)/Android.gen.mk
111 include $(MESA_COMMON_MK)
112 include $(BUILD_STATIC_LIBRARY)
113
114 endif # MESA_BUILD_CLASSIC
115
116 # ---------------------------------------
117 # Build libmesa_glsl_utils
118 #
119 # It is used to avoid circular dependency between core mesa and glsl.
120 # ---------------------------------------
121
122 include $(CLEAR_VARS)
123
124 LOCAL_SRC_FILES := \
125 program/hash_table.c \
126 program/symbol_table.c
127
128 LOCAL_MODULE := libmesa_glsl_utils
129
130 include $(MESA_COMMON_MK)
131 include $(BUILD_STATIC_LIBRARY)
132
133 # ---------------------------------------
134 # Build libmesa_glsl_utils for host
135 # ---------------------------------------
136
137 include $(CLEAR_VARS)
138
139 LOCAL_SRC_FILES := \
140 program/hash_table.c \
141 program/symbol_table.c
142
143 LOCAL_MODULE := libmesa_glsl_utils
144 LOCAL_IS_HOST_MODULE := true
145
146 include $(MESA_COMMON_MK)
147 include $(BUILD_HOST_STATIC_LIBRARY)