1 2LOCAL_PATH:=$(call my-dir) 3 4.PHONY: rs-prebuilts-full 5rs-prebuilts-full: \ 6 bcc_compat \ 7 llvm-rs-cc \ 8 libRSSupport \ 9 libRSSupportIO \ 10 libRScpp_static \ 11 libblasV8 \ 12 libcompiler_rt \ 13 librsrt_arm.bc \ 14 librsrt_arm64.bc \ 15 librsrt_mips.bc \ 16 librsrt_x86.bc \ 17 librsrt_x86_64.bc 18 19ifneq ($(HOST_OS),darwin) 20rs-prebuilts-full: \ 21 host_cross_llvm-rs-cc \ 22 host_cross_bcc_compat 23endif 24 25# Not building RenderScript modules in PDK builds, as libmediandk 26# is not available in PDK. 27ifneq ($(TARGET_BUILD_PDK), true) 28 29rs_base_CFLAGS := -Werror -Wall -Wextra \ 30 -Wno-unused-parameter -Wno-unused-variable 31 32ifneq ($(OVERRIDE_RS_DRIVER),) 33 rs_base_CFLAGS += -DOVERRIDE_RS_DRIVER=$(OVERRIDE_RS_DRIVER) 34endif 35 36ifneq ($(DISABLE_RS_64_BIT_DRIVER),) 37 rs_base_CFLAGS += -DDISABLE_RS_64_BIT_DRIVER 38endif 39 40ifeq ($(RS_FIND_OFFSETS), true) 41 rs_base_CFLAGS += -DRS_FIND_OFFSETS 42endif 43 44include $(CLEAR_VARS) 45LOCAL_MODULE := libRSDriver 46 47LOCAL_SRC_FILES:= \ 48 driver/rsdAllocation.cpp \ 49 driver/rsdBcc.cpp \ 50 driver/rsdCore.cpp \ 51 driver/rsdElement.cpp \ 52 driver/rsdFrameBuffer.cpp \ 53 driver/rsdFrameBufferObj.cpp \ 54 driver/rsdGL.cpp \ 55 driver/rsdMesh.cpp \ 56 driver/rsdMeshObj.cpp \ 57 driver/rsdProgram.cpp \ 58 driver/rsdProgramRaster.cpp \ 59 driver/rsdProgramStore.cpp \ 60 driver/rsdRuntimeStubs.cpp \ 61 driver/rsdSampler.cpp \ 62 driver/rsdScriptGroup.cpp \ 63 driver/rsdShader.cpp \ 64 driver/rsdShaderCache.cpp \ 65 driver/rsdType.cpp \ 66 driver/rsdVertexArray.cpp 67 68 69LOCAL_SHARED_LIBRARIES += libRS_internal libRSCpuRef 70LOCAL_SHARED_LIBRARIES += liblog libEGL libGLESv1_CM libGLESv2 71LOCAL_SHARED_LIBRARIES += libnativewindow 72 73LOCAL_SHARED_LIBRARIES += libbcinfo 74 75LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 76 77LOCAL_CFLAGS += $(rs_base_CFLAGS) 78 79include $(BUILD_SHARED_LIBRARY) 80 81# Build rsg-generator ==================== 82include $(CLEAR_VARS) 83 84LOCAL_MODULE := rsg-generator 85 86# These symbols are normally defined by BUILD_XXX, but we need to define them 87# here so that local-intermediates-dir works. 88 89LOCAL_IS_HOST_MODULE := true 90LOCAL_MODULE_CLASS := EXECUTABLES 91intermediates := $(local-intermediates-dir) 92 93LOCAL_SRC_FILES:= \ 94 spec.l \ 95 rsg_generator.c 96 97LOCAL_CXX_STL := none 98LOCAL_SANITIZE := never 99 100include $(BUILD_HOST_EXECUTABLE) 101 102RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) 103 104include $(CLEAR_VARS) 105LOCAL_MODULE := libRS_internal 106 107LOCAL_MODULE_CLASS := SHARED_LIBRARIES 108generated_sources:= $(local-generated-sources-dir) 109 110# Generate custom headers 111 112GEN := $(addprefix $(generated_sources)/, \ 113 rsgApiStructs.h \ 114 rsgApiFuncDecl.h \ 115 ) 116 117$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 118$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 119$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 120$(GEN): $(generated_sources)/%.h : $(LOCAL_PATH)/%.h.rsg 121 $(transform-generated-source) 122 123# used in jni/Android.mk 124rs_generated_source += $(GEN) 125LOCAL_GENERATED_SOURCES += $(GEN) 126 127# Generate custom source files 128 129GEN := $(addprefix $(generated_sources)/, \ 130 rsgApi.cpp \ 131 rsgApiReplay.cpp \ 132 ) 133 134$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 135$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 136$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 137$(GEN): $(generated_sources)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 138 $(transform-generated-source) 139 140# used in jni/Android.mk 141rs_generated_source += $(GEN) 142 143LOCAL_GENERATED_SOURCES += $(GEN) 144 145LOCAL_SRC_FILES:= \ 146 rsApiAllocation.cpp \ 147 rsApiContext.cpp \ 148 rsApiDevice.cpp \ 149 rsApiElement.cpp \ 150 rsApiFileA3D.cpp \ 151 rsApiMesh.cpp \ 152 rsApiType.cpp \ 153 rsAllocation.cpp \ 154 rsAnimation.cpp \ 155 rsComponent.cpp \ 156 rsContext.cpp \ 157 rsClosure.cpp \ 158 rsCppUtils.cpp \ 159 rsDevice.cpp \ 160 rsDriverLoader.cpp \ 161 rsElement.cpp \ 162 rsFBOCache.cpp \ 163 rsFifoSocket.cpp \ 164 rsFileA3D.cpp \ 165 rsFont.cpp \ 166 rsGrallocConsumer.cpp \ 167 rsObjectBase.cpp \ 168 rsMatrix2x2.cpp \ 169 rsMatrix3x3.cpp \ 170 rsMatrix4x4.cpp \ 171 rsMesh.cpp \ 172 rsMutex.cpp \ 173 rsProgram.cpp \ 174 rsProgramFragment.cpp \ 175 rsProgramStore.cpp \ 176 rsProgramRaster.cpp \ 177 rsProgramVertex.cpp \ 178 rsSampler.cpp \ 179 rsScript.cpp \ 180 rsScriptC.cpp \ 181 rsScriptC_Lib.cpp \ 182 rsScriptC_LibGL.cpp \ 183 rsScriptGroup.cpp \ 184 rsScriptGroup2.cpp \ 185 rsScriptIntrinsic.cpp \ 186 rsSignal.cpp \ 187 rsStream.cpp \ 188 rsThreadIO.cpp \ 189 rsType.cpp 190 191LOCAL_SHARED_LIBRARIES += liblog libutils libEGL libGLESv1_CM libGLESv2 192LOCAL_SHARED_LIBRARIES += libdl libnativewindow 193LOCAL_SHARED_LIBRARIES += libft2 194 195LOCAL_SHARED_LIBRARIES += libbcinfo libmediandk 196 197LOCAL_C_INCLUDES += frameworks/av/include/ndk 198 199LOCAL_CFLAGS += $(rs_base_CFLAGS) 200 201# These runtime modules, including libcompiler_rt.so, are required for 202# RenderScript. 203LOCAL_REQUIRED_MODULES := \ 204 libclcore.bc \ 205 libclcore_debug.bc \ 206 libclcore_g.bc \ 207 libcompiler_rt 208 209LOCAL_REQUIRED_MODULES_x86 += libclcore_x86.bc 210LOCAL_REQUIRED_MODULES_x86_64 += libclcore_x86.bc 211 212ifeq ($(ARCH_ARM_HAVE_NEON),true) 213 LOCAL_REQUIRED_MODULES_arm += libclcore_neon.bc 214endif 215 216LOCAL_MODULE_TAGS := optional 217 218include $(BUILD_SHARED_LIBRARY) 219 220include $(CLEAR_VARS) 221LOCAL_MODULE := libRS 222 223LOCAL_MODULE_CLASS := SHARED_LIBRARIES 224 225LOCAL_SRC_FILES:= \ 226 rsApiStubs.cpp \ 227 rsHidlAdaptation.cpp \ 228 rsFallbackAdaptation.cpp 229 230# Default CPU fallback 231LOCAL_REQUIRED_MODULES := libRS_internal libRSDriver 232 233# Treble configuration 234LOCAL_SHARED_LIBRARIES += libhidlbase libhidltransport libhwbinder libutils android.hardware.renderscript@1.0 235 236LOCAL_SHARED_LIBRARIES += liblog libcutils libandroid_runtime 237 238LOCAL_STATIC_LIBRARIES := \ 239 libRSDispatch 240 241LOCAL_CFLAGS += $(rs_base_CFLAGS) 242 243LOCAL_LDFLAGS += -Wl,--version-script,${LOCAL_PATH}/libRS.map 244 245include $(BUILD_SHARED_LIBRARY) 246 247endif # TARGET_BUILD_PDK 248 249include $(call all-makefiles-under,$(LOCAL_PATH)) 250 251