1 2LOCAL_PATH:=$(call my-dir) 3 4rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -fno-exceptions 5ifeq ($(TARGET_BUILD_PDK), true) 6 rs_base_CFLAGS += -D__RS_PDK__ 7endif 8 9ifneq ($(OVERRIDE_RS_DRIVER),) 10 rs_base_CFLAGS += -DOVERRIDE_RS_DRIVER=$(OVERRIDE_RS_DRIVER) 11endif 12 13ifneq ($(DISABLE_RS_64_BIT_DRIVER),) 14 rs_base_CFLAGS += -DDISABLE_RS_64_BIT_DRIVER 15endif 16 17ifeq ($(RS_FIND_OFFSETS), true) 18 rs_base_CFLAGS += -DRS_FIND_OFFSETS 19endif 20 21include $(CLEAR_VARS) 22ifneq ($(HOST_OS),windows) 23LOCAL_CLANG := true 24endif 25LOCAL_MODULE := libRSDriver 26LOCAL_MODULE_TARGET_ARCH_WARN := arm mips mips64 x86 x86_64 arm64 27 28LOCAL_SRC_FILES:= \ 29 driver/rsdAllocation.cpp \ 30 driver/rsdBcc.cpp \ 31 driver/rsdCore.cpp \ 32 driver/rsdElement.cpp \ 33 driver/rsdFrameBuffer.cpp \ 34 driver/rsdFrameBufferObj.cpp \ 35 driver/rsdGL.cpp \ 36 driver/rsdMesh.cpp \ 37 driver/rsdMeshObj.cpp \ 38 driver/rsdPath.cpp \ 39 driver/rsdProgram.cpp \ 40 driver/rsdProgramRaster.cpp \ 41 driver/rsdProgramStore.cpp \ 42 driver/rsdRuntimeStubs.cpp \ 43 driver/rsdSampler.cpp \ 44 driver/rsdScriptGroup.cpp \ 45 driver/rsdShader.cpp \ 46 driver/rsdShaderCache.cpp \ 47 driver/rsdType.cpp \ 48 driver/rsdVertexArray.cpp 49 50 51LOCAL_SHARED_LIBRARIES += libRS libRSCpuRef libc++ 52LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 53LOCAL_SHARED_LIBRARIES += libui libgui libsync 54 55LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM 56 57LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 58LOCAL_C_INCLUDES += frameworks/rs/cpu_ref/linkloader/include 59LOCAL_C_INCLUDES += external/libcxx/include 60 61LOCAL_CFLAGS += $(rs_base_CFLAGS) 62LOCAL_CPPFLAGS += -fno-exceptions 63 64LOCAL_MODULE_TAGS := optional 65 66include $(BUILD_SHARED_LIBRARY) 67 68# Build rsg-generator ==================== 69include $(CLEAR_VARS) 70 71LOCAL_MODULE := rsg-generator 72 73# These symbols are normally defined by BUILD_XXX, but we need to define them 74# here so that local-intermediates-dir works. 75 76LOCAL_IS_HOST_MODULE := true 77LOCAL_MODULE_CLASS := EXECUTABLES 78intermediates := $(local-intermediates-dir) 79 80LOCAL_SRC_FILES:= \ 81 spec.l \ 82 rsg_generator.c 83 84include $(BUILD_HOST_EXECUTABLE) 85 86# TODO: This should go into build/core/config.mk 87RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) 88 89include $(CLEAR_VARS) 90ifneq ($(HOST_OS),windows) 91LOCAL_CLANG := true 92endif 93LOCAL_MODULE := libRS 94LOCAL_MODULE_TARGET_ARCH_WARN := arm mips mips64 x86 x86_64 arm64 95 96LOCAL_MODULE_CLASS := SHARED_LIBRARIES 97generated_sources:= $(local-generated-sources-dir) 98 99# Generate custom headers 100 101GEN := $(addprefix $(generated_sources)/, \ 102 rsgApiStructs.h \ 103 rsgApiFuncDecl.h \ 104 ) 105 106$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 107$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@ 108$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec 109$(GEN): $(generated_sources)/%.h : $(LOCAL_PATH)/%.h.rsg 110 $(transform-generated-source) 111 112# used in jni/Android.mk 113rs_generated_source += $(GEN) 114LOCAL_GENERATED_SOURCES += $(GEN) 115 116# Generate custom source files 117 118GEN := $(addprefix $(generated_sources)/, \ 119 rsgApi.cpp \ 120 rsgApiReplay.cpp \ 121 ) 122 123$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 124$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@ 125$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec 126$(GEN): $(generated_sources)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 127 $(transform-generated-source) 128 129# used in jni/Android.mk 130rs_generated_source += $(GEN) 131 132LOCAL_GENERATED_SOURCES += $(GEN) 133 134LOCAL_SRC_FILES:= \ 135 rsAdapter.cpp \ 136 rsAllocation.cpp \ 137 rsAnimation.cpp \ 138 rsComponent.cpp \ 139 rsContext.cpp \ 140 rsCppUtils.cpp \ 141 rsDevice.cpp \ 142 rsElement.cpp \ 143 rsFBOCache.cpp \ 144 rsFifoSocket.cpp \ 145 rsFileA3D.cpp \ 146 rsFont.cpp \ 147 rsGrallocConsumer.cpp \ 148 rsObjectBase.cpp \ 149 rsMatrix2x2.cpp \ 150 rsMatrix3x3.cpp \ 151 rsMatrix4x4.cpp \ 152 rsMesh.cpp \ 153 rsMutex.cpp \ 154 rsPath.cpp \ 155 rsProgram.cpp \ 156 rsProgramFragment.cpp \ 157 rsProgramStore.cpp \ 158 rsProgramRaster.cpp \ 159 rsProgramVertex.cpp \ 160 rsSampler.cpp \ 161 rsScript.cpp \ 162 rsScriptC.cpp \ 163 rsScriptC_Lib.cpp \ 164 rsScriptC_LibGL.cpp \ 165 rsScriptGroup.cpp \ 166 rsScriptIntrinsic.cpp \ 167 rsSignal.cpp \ 168 rsStream.cpp \ 169 rsThreadIO.cpp \ 170 rsType.cpp 171 172LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 libc++ 173LOCAL_SHARED_LIBRARIES += libgui libsync libdl libui 174LOCAL_SHARED_LIBRARIES += libft2 libpng libz 175 176LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM 177 178LOCAL_C_INCLUDES += external/freetype/include 179LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 180LOCAL_C_INCLUDES += external/libcxx/include 181 182LOCAL_CFLAGS += $(rs_base_CFLAGS) 183 184LOCAL_CPPFLAGS += -fno-exceptions 185 186LOCAL_MODULE_TAGS := optional 187 188include $(BUILD_SHARED_LIBRARY) 189 190# Now build a host version for serialization 191include $(CLEAR_VARS) 192LOCAL_MODULE:= libRS 193LOCAL_MODULE_TAGS := optional 194LOCAL_MODULE_CLASS := STATIC_LIBRARIES 195LOCAL_IS_HOST_MODULE := true 196 197intermediates := $(call local-generated-sources-dir) 198 199# Generate custom headers 200 201GEN := $(addprefix $(intermediates)/, \ 202 rsgApiStructs.h \ 203 rsgApiFuncDecl.h \ 204 ) 205 206$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 207$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@ 208$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec 209$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg 210 $(transform-generated-source) 211 212LOCAL_GENERATED_SOURCES += $(GEN) 213 214# Generate custom source files 215 216GEN := $(addprefix $(intermediates)/, \ 217 rsgApi.cpp \ 218 rsgApiReplay.cpp \ 219 ) 220 221$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 222$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec $(PRIVATE_PATH)/rs_native.spec | $(RSG_GENERATOR) $< $@ 223$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec $(LOCAL_PATH)/rs_native.spec 224$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 225 $(transform-generated-source) 226 227LOCAL_GENERATED_SOURCES += $(GEN) 228 229LOCAL_CFLAGS += $(rs_base_CFLAGS) 230LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE 231LOCAL_CFLAGS += -fPIC 232LOCAL_CPPFLAGS += -fno-exceptions 233 234LOCAL_SRC_FILES:= \ 235 rsAdapter.cpp \ 236 rsAllocation.cpp \ 237 rsAnimation.cpp \ 238 rsComponent.cpp \ 239 rsContext.cpp \ 240 rsDevice.cpp \ 241 rsElement.cpp \ 242 rsFBOCache.cpp \ 243 rsFifoSocket.cpp \ 244 rsFileA3D.cpp \ 245 rsFont.cpp \ 246 rsObjectBase.cpp \ 247 rsMatrix2x2.cpp \ 248 rsMatrix3x3.cpp \ 249 rsMatrix4x4.cpp \ 250 rsMesh.cpp \ 251 rsMutex.cpp \ 252 rsPath.cpp \ 253 rsProgram.cpp \ 254 rsProgramFragment.cpp \ 255 rsProgramStore.cpp \ 256 rsProgramRaster.cpp \ 257 rsProgramVertex.cpp \ 258 rsSampler.cpp \ 259 rsScript.cpp \ 260 rsScriptC.cpp \ 261 rsScriptC_Lib.cpp \ 262 rsScriptC_LibGL.cpp \ 263 rsScriptGroup.cpp \ 264 rsScriptIntrinsic.cpp \ 265 rsSignal.cpp \ 266 rsStream.cpp \ 267 rsThreadIO.cpp \ 268 rsType.cpp 269 270LOCAL_STATIC_LIBRARIES := libcutils libutils liblog 271 272LOCAL_CLANG := true 273 274include $(BUILD_HOST_STATIC_LIBRARY) 275 276LLVM_ROOT_PATH := external/llvm 277 278#============================================================================= 279# android librsloader for libbcc (Device) 280#----------------------------------------------------------------------------- 281 282rsloader_SRC_FILES := \ 283 cpu_ref/linkloader/android/librsloader.cpp \ 284 cpu_ref/linkloader/lib/ELFHeader.cpp \ 285 cpu_ref/linkloader/lib/ELFSymbol.cpp \ 286 cpu_ref/linkloader/lib/ELFSectionHeader.cpp \ 287 cpu_ref/linkloader/lib/ELFTypes.cpp \ 288 cpu_ref/linkloader/lib/GOT.cpp \ 289 cpu_ref/linkloader/lib/MemChunk.cpp \ 290 cpu_ref/linkloader/lib/StubLayout.cpp \ 291 cpu_ref/linkloader/utils/helper.cpp \ 292 cpu_ref/linkloader/utils/raw_ostream.cpp \ 293 cpu_ref/linkloader/utils/rsl_assert.cpp 294 295include $(CLEAR_VARS) 296 297 298LOCAL_MODULE := librsloader 299LOCAL_MODULE_TAGS := optional 300 301LOCAL_SRC_FILES := $(rsloader_SRC_FILES) 302 303LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 304 305LOCAL_CFLAGS += $(rs_base_CFLAGS) 306LOCAL_CPPFLAGS += -fno-exceptions 307 308LOCAL_C_INCLUDES := \ 309 $(LOCAL_PATH)/cpu_ref/linkloader \ 310 $(LOCAL_PATH)/cpu_ref/linkloader/include \ 311 external/libcxx/include \ 312 $(LOCAL_C_INCLUDES) 313 314include $(LLVM_ROOT_PATH)/llvm-device-build.mk 315include $(BUILD_STATIC_LIBRARY) 316 317#============================================================================= 318# android librsloader for libbcc (Host) 319#----------------------------------------------------------------------------- 320 321include $(CLEAR_VARS) 322 323LOCAL_MODULE := librsloader 324ifneq ($(HOST_OS),windows) 325LOCAL_CLANG := true 326endif 327 328LOCAL_MODULE_TAGS := optional 329 330LOCAL_SRC_FILES := $(rsloader_SRC_FILES) 331 332ifdef USE_MINGW 333LOCAL_SRC_FILES += cpu_ref/linkloader/lib/mmanWindows.cpp 334endif 335 336LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 337 338LOCAL_CFLAGS += $(rs_base_CFLAGS) 339LOCAL_CFLAGS += -D__HOST__ 340LOCAL_CPPFLAGS += -fno-exceptions 341 342ifeq ($(HOST_OS),windows) 343LOCAL_C_INCLUDES := \ 344 $(LOCAL_PATH)/cpu_ref/linkloader \ 345 $(LOCAL_PATH)/cpu_ref/linkloader/include \ 346 $(LOCAL_C_INCLUDES) 347else 348LOCAL_C_INCLUDES := \ 349 $(LOCAL_PATH)/cpu_ref/linkloader \ 350 $(LOCAL_PATH)/cpu_ref/linkloader/include \ 351 external/libcxx/include \ 352 $(LOCAL_C_INCLUDES) 353endif 354 355include $(LLVM_ROOT_PATH)/llvm-host-build.mk 356include $(BUILD_HOST_STATIC_LIBRARY) 357 358include $(call all-makefiles-under,$(LOCAL_PATH)) 359