blob: bef48c0d109f5dea9f28a25193751ad339942617 [file] [log] [blame]
Jason Sams5e172b02009-07-23 16:10:46 -07001
Jason Samsc7f6ce42009-06-10 16:09:05 -07002LOCAL_PATH:=$(call my-dir)
Jason Sams326e0dd2009-05-22 14:03:28 -07003
Stephen Hinesebee9482012-05-09 11:53:24 -07004rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable
Stephen Hinesebee9482012-05-09 11:53:24 -07005ifeq ($(TARGET_BUILD_PDK), true)
6 rs_base_CFLAGS += -D__RS_PDK__
7endif
8
Stephen Hines91dfcdb2012-09-07 18:23:35 -07009ifneq ($(OVERRIDE_RS_DRIVER),)
10 rs_base_CFLAGS += -DOVERRIDE_RS_DRIVER=$(OVERRIDE_RS_DRIVER)
11endif
12
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080013include $(CLEAR_VARS)
Stephen Hinesf0984242012-05-11 17:41:36 -070014LOCAL_CLANG := true
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080015LOCAL_MODULE := libRSDriver
16
17LOCAL_SRC_FILES:= \
18 driver/rsdAllocation.cpp \
19 driver/rsdBcc.cpp \
20 driver/rsdCore.cpp \
21 driver/rsdFrameBuffer.cpp \
22 driver/rsdFrameBufferObj.cpp \
23 driver/rsdGL.cpp \
24 driver/rsdMesh.cpp \
25 driver/rsdMeshObj.cpp \
26 driver/rsdPath.cpp \
27 driver/rsdProgram.cpp \
28 driver/rsdProgramRaster.cpp \
29 driver/rsdProgramStore.cpp \
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080030 driver/rsdRuntimeStubs.cpp \
31 driver/rsdSampler.cpp \
Jason Samsdbe66d62012-09-17 13:54:41 -070032 driver/rsdScriptGroup.cpp \
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080033 driver/rsdShader.cpp \
34 driver/rsdShaderCache.cpp \
Jason Sams6d958bc2012-09-04 15:14:05 -070035 driver/rsdVertexArray.cpp
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080036
Jason Samse1e08b42012-09-04 16:49:19 -070037
Jason Sams709a0972012-11-15 18:18:04 -080038LOCAL_SHARED_LIBRARIES += libRS libRSCpuRef
Ying Wangb2411812013-04-09 21:56:34 -070039LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2
Stephen Hines985573c2013-02-27 23:23:19 -080040LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM libui libgui libsync
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080041
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080042LOCAL_C_INCLUDES += frameworks/compile/libbcc/include
43
Stephen Hinesebee9482012-05-09 11:53:24 -070044LOCAL_CFLAGS += $(rs_base_CFLAGS)
Alex Sakhartchouk5e3c9682012-03-09 15:04:23 -080045
46LOCAL_LDLIBS := -lpthread -ldl
47LOCAL_MODULE_TAGS := optional
48
Stephen Hines414a4612012-09-05 18:05:08 -070049include $(BUILD_SHARED_LIBRARY)
Jason Samsc7f6ce42009-06-10 16:09:05 -070050
51# Build rsg-generator ====================
52include $(CLEAR_VARS)
Jason Sams326e0dd2009-05-22 14:03:28 -070053
54LOCAL_MODULE := rsg-generator
55
56# These symbols are normally defined by BUILD_XXX, but we need to define them
57# here so that local-intermediates-dir works.
58
59LOCAL_IS_HOST_MODULE := true
60LOCAL_MODULE_CLASS := EXECUTABLES
Jason Samsc7f6ce42009-06-10 16:09:05 -070061intermediates := $(local-intermediates-dir)
Jason Sams326e0dd2009-05-22 14:03:28 -070062
Jason Sams326e0dd2009-05-22 14:03:28 -070063LOCAL_SRC_FILES:= \
Joe Onorato84614dd2009-08-10 15:01:51 -070064 spec.l \
Jason Sams326e0dd2009-05-22 14:03:28 -070065 rsg_generator.c
Jason Samsc7f6ce42009-06-10 16:09:05 -070066
Jason Sams326e0dd2009-05-22 14:03:28 -070067include $(BUILD_HOST_EXECUTABLE)
68
Jason Samsc7f6ce42009-06-10 16:09:05 -070069# TODO: This should go into build/core/config.mk
Jason Sams326e0dd2009-05-22 14:03:28 -070070RSG_GENERATOR:=$(LOCAL_BUILT_MODULE)
71
Jason Sams326e0dd2009-05-22 14:03:28 -070072include $(CLEAR_VARS)
Stephen Hinesf0984242012-05-11 17:41:36 -070073LOCAL_CLANG := true
Jason Sams326e0dd2009-05-22 14:03:28 -070074LOCAL_MODULE := libRS
75
76LOCAL_MODULE_CLASS := SHARED_LIBRARIES
77intermediates:= $(local-intermediates-dir)
78
Jason Sams326e0dd2009-05-22 14:03:28 -070079# Generate custom headers
80
81GEN := $(addprefix $(intermediates)/, \
82 rsgApiStructs.h \
83 rsgApiFuncDecl.h \
84 )
85
Jason Sams81e48fa2009-06-10 18:35:42 -070086$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
Tim Murray2487bb72013-03-18 16:41:32 -070087$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@
88$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec
Jason Sams326e0dd2009-05-22 14:03:28 -070089$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
90 $(transform-generated-source)
Jack Palevicha5e094b2009-05-26 17:23:34 -070091
Jason Samsc7f6ce42009-06-10 16:09:05 -070092# used in jni/Android.mk
93rs_generated_source += $(GEN)
Jason Sams326e0dd2009-05-22 14:03:28 -070094LOCAL_GENERATED_SOURCES += $(GEN)
95
96# Generate custom source files
97
98GEN := $(addprefix $(intermediates)/, \
99 rsgApi.cpp \
100 rsgApiReplay.cpp \
101 )
Jack Palevicha5e094b2009-05-26 17:23:34 -0700102
Jason Sams81e48fa2009-06-10 18:35:42 -0700103$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
Tim Murray2487bb72013-03-18 16:41:32 -0700104$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@
105$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec
Jason Sams326e0dd2009-05-22 14:03:28 -0700106$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
107 $(transform-generated-source)
Jack Palevicha5e094b2009-05-26 17:23:34 -0700108
Jason Samsc7f6ce42009-06-10 16:09:05 -0700109# used in jni/Android.mk
110rs_generated_source += $(GEN)
Jason Sams81e48fa2009-06-10 18:35:42 -0700111
Jason Sams326e0dd2009-05-22 14:03:28 -0700112LOCAL_GENERATED_SOURCES += $(GEN)
113
114LOCAL_SRC_FILES:= \
115 rsAdapter.cpp \
116 rsAllocation.cpp \
Jason Samsc1ed5892010-03-10 17:30:41 -0800117 rsAnimation.cpp \
Jason Samsd01d9702009-12-23 14:35:29 -0800118 rsComponent.cpp \
Jason Sams326e0dd2009-05-22 14:03:28 -0700119 rsContext.cpp \
120 rsDevice.cpp \
121 rsElement.cpp \
Alex Sakhartchouk7d9c5ff2011-04-01 14:19:01 -0700122 rsFBOCache.cpp \
Jason Sams20087472011-05-06 14:14:30 -0700123 rsFifoSocket.cpp \
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700124 rsFileA3D.cpp \
125 rsFont.cpp \
Jason Sams326e0dd2009-05-22 14:03:28 -0700126 rsObjectBase.cpp \
Jason Sams87fe59a2011-04-20 15:09:01 -0700127 rsMatrix2x2.cpp \
128 rsMatrix3x3.cpp \
129 rsMatrix4x4.cpp \
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700130 rsMesh.cpp \
131 rsMutex.cpp \
Jason Sams9e0afb52011-10-31 13:23:43 -0700132 rsPath.cpp \
Jason Sams326e0dd2009-05-22 14:03:28 -0700133 rsProgram.cpp \
134 rsProgramFragment.cpp \
Jason Samsccc010b2010-05-13 18:30:11 -0700135 rsProgramStore.cpp \
Jason Sams5fd09d82009-09-23 13:57:02 -0700136 rsProgramRaster.cpp \
Jason Sams326e0dd2009-05-22 14:03:28 -0700137 rsProgramVertex.cpp \
138 rsSampler.cpp \
139 rsScript.cpp \
140 rsScriptC.cpp \
Jason Samse45ac6e2009-07-20 14:31:06 -0700141 rsScriptC_Lib.cpp \
Jason Samsaeb094b2010-05-18 13:35:45 -0700142 rsScriptC_LibGL.cpp \
Jason Samsdbe66d62012-09-17 13:54:41 -0700143 rsScriptGroup.cpp \
Jason Sams8eaba4f2012-08-14 14:38:05 -0700144 rsScriptIntrinsic.cpp \
Jason Sams12b14ae2010-03-18 11:39:44 -0700145 rsSignal.cpp \
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700146 rsStream.cpp \
Jason Sams326e0dd2009-05-22 14:03:28 -0700147 rsThreadIO.cpp \
Jason Samsa662edd2012-04-02 15:00:10 -0700148 rsType.cpp
Jason Samsc460e552009-11-25 13:22:07 -0800149
Ying Wangb2411812013-04-09 21:56:34 -0700150LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 libbcc
Stephen Hines985573c2013-02-27 23:23:19 -0800151LOCAL_SHARED_LIBRARIES += libui libbcinfo libLLVM libgui libsync libdl
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700152
Stephen Hines414a4612012-09-05 18:05:08 -0700153LOCAL_STATIC_LIBRARIES := libft2
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700154
Alex Sakhartchouk5bab6bf2012-04-10 10:38:39 -0700155LOCAL_C_INCLUDES += external/freetype/include
Shih-wei Liao2b2e6212011-01-14 06:21:28 -0800156LOCAL_C_INCLUDES += frameworks/compile/libbcc/include
Alex Sakhartchoukd3e0ad42010-06-24 17:15:34 -0700157
Stephen Hinesebee9482012-05-09 11:53:24 -0700158LOCAL_CFLAGS += $(rs_base_CFLAGS)
Stephen Hines6a121812011-03-01 17:34:59 -0800159
Jason Sams326e0dd2009-05-22 14:03:28 -0700160LOCAL_LDLIBS := -lpthread -ldl
Jason Samsc7f6ce42009-06-10 16:09:05 -0700161LOCAL_MODULE_TAGS := optional
Jason Sams326e0dd2009-05-22 14:03:28 -0700162
163include $(BUILD_SHARED_LIBRARY)
164
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800165# Now build a host version for serialization
166include $(CLEAR_VARS)
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700167LOCAL_MODULE:= libRS
168LOCAL_MODULE_TAGS := optional
169
170intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,HOST,)
171
172# Generate custom headers
173
174GEN := $(addprefix $(intermediates)/, \
175 rsgApiStructs.h \
176 rsgApiFuncDecl.h \
177 )
178
179$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
Tim Murray2487bb72013-03-18 16:41:32 -0700180$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@
181$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700182$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
183 $(transform-generated-source)
184
185LOCAL_GENERATED_SOURCES += $(GEN)
186
187# Generate custom source files
188
189GEN := $(addprefix $(intermediates)/, \
190 rsgApi.cpp \
191 rsgApiReplay.cpp \
192 )
193
194$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
Tim Murray2487bb72013-03-18 16:41:32 -0700195$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@
196$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700197$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
198 $(transform-generated-source)
199
200LOCAL_GENERATED_SOURCES += $(GEN)
201
Stephen Hinesebee9482012-05-09 11:53:24 -0700202LOCAL_CFLAGS += $(rs_base_CFLAGS)
Alex Sakhartchouk77d9f4b2011-01-31 14:53:24 -0800203LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE
Alex Sakhartchouk5bab6bf2012-04-10 10:38:39 -0700204LOCAL_CFLAGS += -fPIC
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800205
206LOCAL_SRC_FILES:= \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700207 rsAdapter.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800208 rsAllocation.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700209 rsAnimation.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800210 rsComponent.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700211 rsContext.cpp \
212 rsDevice.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800213 rsElement.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700214 rsFBOCache.cpp \
215 rsFifoSocket.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800216 rsFileA3D.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700217 rsFont.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800218 rsObjectBase.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700219 rsMatrix2x2.cpp \
220 rsMatrix3x3.cpp \
221 rsMatrix4x4.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800222 rsMesh.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700223 rsMutex.cpp \
Jason Sams9e0afb52011-10-31 13:23:43 -0700224 rsPath.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700225 rsProgram.cpp \
226 rsProgramFragment.cpp \
227 rsProgramStore.cpp \
228 rsProgramRaster.cpp \
229 rsProgramVertex.cpp \
230 rsSampler.cpp \
231 rsScript.cpp \
232 rsScriptC.cpp \
233 rsScriptC_Lib.cpp \
234 rsScriptC_LibGL.cpp \
Jason Samsdbe66d62012-09-17 13:54:41 -0700235 rsScriptGroup.cpp \
Jason Sams8eaba4f2012-08-14 14:38:05 -0700236 rsScriptIntrinsic.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700237 rsSignal.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800238 rsStream.cpp \
Alex Sakhartchoukb81a0eb2011-06-03 10:18:01 -0700239 rsThreadIO.cpp \
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800240 rsType.cpp
241
Ying Wangb2411812013-04-09 21:56:34 -0700242LOCAL_STATIC_LIBRARIES := libcutils libutils liblog
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800243
244LOCAL_LDLIBS := -lpthread
Alex Sakhartchouk099d7d32011-01-28 09:31:47 -0800245
246include $(BUILD_HOST_STATIC_LIBRARY)
Jason Sams709a0972012-11-15 18:18:04 -0800247
Stephen Hinesb53c8a52013-04-05 22:17:36 -0700248
249LLVM_ROOT_PATH := external/llvm
250
251#=============================================================================
252# android librsloader for libbcc (Device)
253#-----------------------------------------------------------------------------
254
255rsloader_SRC_FILES := \
256 driver/linkloader/android/librsloader.cpp \
257 driver/linkloader/lib/ELFHeader.cpp \
258 driver/linkloader/lib/ELFSymbol.cpp \
259 driver/linkloader/lib/ELFSectionHeader.cpp \
260 driver/linkloader/lib/ELFTypes.cpp \
261 driver/linkloader/lib/GOT.cpp \
262 driver/linkloader/lib/MemChunk.cpp \
263 driver/linkloader/lib/StubLayout.cpp \
264 driver/linkloader/utils/helper.cpp \
265 driver/linkloader/utils/raw_ostream.cpp \
266 driver/linkloader/utils/rsl_assert.cpp
267
268include $(CLEAR_VARS)
269
270LOCAL_MODULE := librsloader
271
272LOCAL_MODULE_TAGS := optional
273
274LOCAL_SRC_FILES := $(rsloader_SRC_FILES)
275
276LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
277
278LOCAL_CFLAGS += $(rs_base_CFLAGS)
279
280LOCAL_C_INCLUDES := \
281 $(LOCAL_PATH)/driver/linkloader \
282 $(LOCAL_PATH)/driver/linkloader/include \
283 $(LOCAL_C_INCLUDES)
284
285include $(LLVM_ROOT_PATH)/llvm-device-build.mk
286include $(BUILD_STATIC_LIBRARY)
287
288
289#=============================================================================
290# android librsloader for libbcc (Host)
291#-----------------------------------------------------------------------------
292
293include $(CLEAR_VARS)
294
295LOCAL_MODULE := librsloader
296
297LOCAL_MODULE_TAGS := optional
298
299LOCAL_SRC_FILES := $(rsloader_SRC_FILES)
300
301LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
302
303LOCAL_CFLAGS += $(rs_base_CFLAGS)
304LOCAL_CFLAGS += -D__HOST__
305
306LOCAL_C_INCLUDES := \
307 $(LOCAL_PATH)/driver/linkloader \
308 $(LOCAL_PATH)/driver/linkloader/include \
309 $(LOCAL_C_INCLUDES)
310
311include $(LLVM_ROOT_PATH)/llvm-host-build.mk
312include $(BUILD_HOST_STATIC_LIBRARY)
313
Stephen Hinesf12f8ed2013-05-23 13:40:57 -0700314include $(call all-makefiles-under,$(LOCAL_PATH))