1 2LOCAL_PATH:=$(call my-dir) 3 4rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable 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 13include $(CLEAR_VARS) 14LOCAL_CLANG := true 15LOCAL_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/rsdIntrinsics.cpp \ 25 driver/rsdIntrinsicBlend.cpp \ 26 driver/rsdIntrinsicBlur.cpp \ 27 driver/rsdIntrinsicConvolve3x3.cpp \ 28 driver/rsdIntrinsicConvolve5x5.cpp \ 29 driver/rsdIntrinsicLUT.cpp \ 30 driver/rsdIntrinsicColorMatrix.cpp \ 31 driver/rsdIntrinsicYuvToRGB.cpp \ 32 driver/rsdMesh.cpp \ 33 driver/rsdMeshObj.cpp \ 34 driver/rsdPath.cpp \ 35 driver/rsdProgram.cpp \ 36 driver/rsdProgramRaster.cpp \ 37 driver/rsdProgramStore.cpp \ 38 driver/rsdRuntimeMath.cpp \ 39 driver/rsdRuntimeStubs.cpp \ 40 driver/rsdSampler.cpp \ 41 driver/rsdScriptGroup.cpp \ 42 driver/rsdShader.cpp \ 43 driver/rsdShaderCache.cpp \ 44 driver/rsdVertexArray.cpp 45 46ifeq ($(ARCH_ARM_HAVE_NEON),true) 47 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON 48 LOCAL_SRC_FILES+= \ 49 driver/rsdIntrinsics_Convolve.S 50endif 51 52LOCAL_SHARED_LIBRARIES += libRS 53LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 54LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libui libgui libsync 55 56LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 57 58LOCAL_CFLAGS += $(rs_base_CFLAGS) 59 60LOCAL_LDLIBS := -lpthread -ldl 61LOCAL_MODULE_TAGS := optional 62 63include $(BUILD_SHARED_LIBRARY) 64 65# Build rsg-generator ==================== 66include $(CLEAR_VARS) 67 68LOCAL_MODULE := rsg-generator 69 70# These symbols are normally defined by BUILD_XXX, but we need to define them 71# here so that local-intermediates-dir works. 72 73LOCAL_IS_HOST_MODULE := true 74LOCAL_MODULE_CLASS := EXECUTABLES 75intermediates := $(local-intermediates-dir) 76 77LOCAL_SRC_FILES:= \ 78 spec.l \ 79 rsg_generator.c 80 81include $(BUILD_HOST_EXECUTABLE) 82 83# TODO: This should go into build/core/config.mk 84RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) 85 86include $(CLEAR_VARS) 87LOCAL_CLANG := true 88LOCAL_MODULE := libRS 89 90LOCAL_MODULE_CLASS := SHARED_LIBRARIES 91intermediates:= $(local-intermediates-dir) 92 93# Generate custom headers 94 95GEN := $(addprefix $(intermediates)/, \ 96 rsgApiStructs.h \ 97 rsgApiFuncDecl.h \ 98 ) 99 100$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 101$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec 102$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec 103$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg 104 $(transform-generated-source) 105 106# used in jni/Android.mk 107rs_generated_source += $(GEN) 108LOCAL_GENERATED_SOURCES += $(GEN) 109 110# Generate custom source files 111 112GEN := $(addprefix $(intermediates)/, \ 113 rsgApi.cpp \ 114 rsgApiReplay.cpp \ 115 ) 116 117$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 118$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec 119$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec 120$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 121 $(transform-generated-source) 122 123# used in jni/Android.mk 124rs_generated_source += $(GEN) 125 126LOCAL_GENERATED_SOURCES += $(GEN) 127 128LOCAL_SRC_FILES:= \ 129 rsAdapter.cpp \ 130 rsAllocation.cpp \ 131 rsAnimation.cpp \ 132 rsComponent.cpp \ 133 rsContext.cpp \ 134 rsDevice.cpp \ 135 rsElement.cpp \ 136 rsFBOCache.cpp \ 137 rsFifoSocket.cpp \ 138 rsFileA3D.cpp \ 139 rsFont.cpp \ 140 rsObjectBase.cpp \ 141 rsMatrix2x2.cpp \ 142 rsMatrix3x3.cpp \ 143 rsMatrix4x4.cpp \ 144 rsMesh.cpp \ 145 rsMutex.cpp \ 146 rsPath.cpp \ 147 rsProgram.cpp \ 148 rsProgramFragment.cpp \ 149 rsProgramStore.cpp \ 150 rsProgramRaster.cpp \ 151 rsProgramVertex.cpp \ 152 rsSampler.cpp \ 153 rsScript.cpp \ 154 rsScriptC.cpp \ 155 rsScriptC_Lib.cpp \ 156 rsScriptC_LibGL.cpp \ 157 rsScriptGroup.cpp \ 158 rsScriptIntrinsic.cpp \ 159 rsSignal.cpp \ 160 rsStream.cpp \ 161 rsThreadIO.cpp \ 162 rsType.cpp 163 164LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 libbcc 165LOCAL_SHARED_LIBRARIES += libui libbcinfo libgui libsync libdl 166 167LOCAL_STATIC_LIBRARIES := libft2 168 169LOCAL_C_INCLUDES += external/freetype/include 170LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 171 172LOCAL_CFLAGS += $(rs_base_CFLAGS) 173 174LOCAL_LDLIBS := -lpthread -ldl 175LOCAL_MODULE_TAGS := optional 176 177include $(BUILD_SHARED_LIBRARY) 178 179# Now build a host version for serialization 180include $(CLEAR_VARS) 181LOCAL_MODULE:= libRS 182LOCAL_MODULE_TAGS := optional 183 184intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,HOST,) 185 186# Generate custom headers 187 188GEN := $(addprefix $(intermediates)/, \ 189 rsgApiStructs.h \ 190 rsgApiFuncDecl.h \ 191 ) 192 193$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 194$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec 195$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec 196$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg 197 $(transform-generated-source) 198 199LOCAL_GENERATED_SOURCES += $(GEN) 200 201# Generate custom source files 202 203GEN := $(addprefix $(intermediates)/, \ 204 rsgApi.cpp \ 205 rsgApiReplay.cpp \ 206 ) 207 208$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 209$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec 210$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec 211$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 212 $(transform-generated-source) 213 214LOCAL_GENERATED_SOURCES += $(GEN) 215 216LOCAL_CFLAGS += $(rs_base_CFLAGS) 217LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE 218LOCAL_CFLAGS += -fPIC 219 220LOCAL_SRC_FILES:= \ 221 rsAdapter.cpp \ 222 rsAllocation.cpp \ 223 rsAnimation.cpp \ 224 rsComponent.cpp \ 225 rsContext.cpp \ 226 rsDevice.cpp \ 227 rsElement.cpp \ 228 rsFBOCache.cpp \ 229 rsFifoSocket.cpp \ 230 rsFileA3D.cpp \ 231 rsFont.cpp \ 232 rsObjectBase.cpp \ 233 rsMatrix2x2.cpp \ 234 rsMatrix3x3.cpp \ 235 rsMatrix4x4.cpp \ 236 rsMesh.cpp \ 237 rsMutex.cpp \ 238 rsPath.cpp \ 239 rsProgram.cpp \ 240 rsProgramFragment.cpp \ 241 rsProgramStore.cpp \ 242 rsProgramRaster.cpp \ 243 rsProgramVertex.cpp \ 244 rsSampler.cpp \ 245 rsScript.cpp \ 246 rsScriptC.cpp \ 247 rsScriptC_Lib.cpp \ 248 rsScriptC_LibGL.cpp \ 249 rsScriptGroup.cpp \ 250 rsScriptIntrinsic.cpp \ 251 rsSignal.cpp \ 252 rsStream.cpp \ 253 rsThreadIO.cpp \ 254 rsType.cpp 255 256LOCAL_STATIC_LIBRARIES := libcutils libutils 257 258LOCAL_LDLIBS := -lpthread 259 260include $(BUILD_HOST_STATIC_LIBRARY) 261