1 2 LOCAL_PATH:=$(call my-dir) 3 4 rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable 5 ifeq ($(TARGET_BUILD_PDK), true) 6 rs_base_CFLAGS += -D__RS_PDK__ 7 endif 8 9 ifneq ($(OVERRIDE_RS_DRIVER),) 10 rs_base_CFLAGS += -DOVERRIDE_RS_DRIVER=$(OVERRIDE_RS_DRIVER) 11 endif 12 13 include $(CLEAR_VARS) 14 LOCAL_CLANG := true 15 LOCAL_MODULE := libRSDriver 16 17 LOCAL_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 38 LOCAL_SHARED_LIBRARIES += libRS libRSCpuRef 39 LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 40 LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM libui libgui libsync 41 42 LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 43 LOCAL_C_INCLUDES += frameworks/rs/cpu_ref/linkloader/include 44 45 LOCAL_CFLAGS += $(rs_base_CFLAGS) 46 47 LOCAL_LDLIBS := -lpthread -ldl 48 LOCAL_MODULE_TAGS := optional 49 50 include $(BUILD_SHARED_LIBRARY) 51 52 # Build rsg-generator ==================== 53 include $(CLEAR_VARS) 54 55 LOCAL_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 60 LOCAL_IS_HOST_MODULE := true 61 LOCAL_MODULE_CLASS := EXECUTABLES 62 intermediates := $(local-intermediates-dir) 63 64 LOCAL_SRC_FILES:= \ 65 spec.l \ 66 rsg_generator.c 67 68 include $(BUILD_HOST_EXECUTABLE) 69 70 # TODO: This should go into build/core/config.mk 71 RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) 72 73 include $(CLEAR_VARS) 74 LOCAL_CLANG := true 75 LOCAL_MODULE := libRS 76 77 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 78 intermediates:= $(local-intermediates-dir) 79 80 # Generate custom headers 81 82 GEN := $(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 94 rs_generated_source += $(GEN) 95 LOCAL_GENERATED_SOURCES += $(GEN) 96 97 # Generate custom source files 98 99 GEN := $(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 111 rs_generated_source += $(GEN) 112 113 LOCAL_GENERATED_SOURCES += $(GEN) 114 115 LOCAL_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 153 LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 libbcc 154 LOCAL_SHARED_LIBRARIES += libui libbcinfo libLLVM libgui libsync libdl 155 LOCAL_SHARED_LIBRARIES += libft2 libpng libz 156 157 LOCAL_C_INCLUDES += external/freetype/include 158 LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 159 160 LOCAL_CFLAGS += $(rs_base_CFLAGS) 161 162 LOCAL_LDLIBS := -lpthread -ldl 163 LOCAL_MODULE_TAGS := optional 164 165 include $(BUILD_SHARED_LIBRARY) 166 167 # Now build a host version for serialization 168 include $(CLEAR_VARS) 169 LOCAL_MODULE:= libRS 170 LOCAL_MODULE_TAGS := optional 171 172 intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,HOST,) 173 174 # Generate custom headers 175 176 GEN := $(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 187 LOCAL_GENERATED_SOURCES += $(GEN) 188 189 # Generate custom source files 190 191 GEN := $(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 202 LOCAL_GENERATED_SOURCES += $(GEN) 203 204 LOCAL_CFLAGS += $(rs_base_CFLAGS) 205 LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE 206 LOCAL_CFLAGS += -fPIC 207 208 LOCAL_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 244 LOCAL_STATIC_LIBRARIES := libcutils libutils liblog 245 246 LOCAL_LDLIBS := -lpthread 247 248 include $(BUILD_HOST_STATIC_LIBRARY) 249 250 251 LLVM_ROOT_PATH := external/llvm 252 253 #============================================================================= 254 # android librsloader for libbcc (Device) 255 #----------------------------------------------------------------------------- 256 257 rsloader_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 270 include $(CLEAR_VARS) 271 272 LOCAL_MODULE := librsloader 273 274 LOCAL_MODULE_TAGS := optional 275 276 LOCAL_SRC_FILES := $(rsloader_SRC_FILES) 277 278 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 279 280 LOCAL_CFLAGS += $(rs_base_CFLAGS) 281 282 LOCAL_C_INCLUDES := \ 283 $(LOCAL_PATH)/cpu_ref/linkloader \ 284 $(LOCAL_PATH)/cpu_ref/linkloader/include \ 285 $(LOCAL_C_INCLUDES) 286 287 include $(LLVM_ROOT_PATH)/llvm-device-build.mk 288 include $(BUILD_STATIC_LIBRARY) 289 290 291 #============================================================================= 292 # android librsloader for libbcc (Host) 293 #----------------------------------------------------------------------------- 294 295 include $(CLEAR_VARS) 296 297 LOCAL_MODULE := librsloader 298 299 LOCAL_MODULE_TAGS := optional 300 301 LOCAL_SRC_FILES := $(rsloader_SRC_FILES) 302 303 ifdef USE_MINGW 304 LOCAL_SRC_FILES += cpu_ref/linkloader/lib/mmanWindows.cpp 305 endif 306 307 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 308 309 LOCAL_CFLAGS += $(rs_base_CFLAGS) 310 LOCAL_CFLAGS += -D__HOST__ 311 312 LOCAL_C_INCLUDES := \ 313 $(LOCAL_PATH)/cpu_ref/linkloader \ 314 $(LOCAL_PATH)/cpu_ref/linkloader/include \ 315 $(LOCAL_C_INCLUDES) 316 317 include $(LLVM_ROOT_PATH)/llvm-host-build.mk 318 include $(BUILD_HOST_STATIC_LIBRARY) 319 320 include $(call all-makefiles-under,$(LOCAL_PATH)) 321