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