1 2LOCAL_PATH:=$(call my-dir) 3 4rs_base_CFLAGS := -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -fno-exceptions -std=c++11 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) 22LOCAL_CLANG := true 23LOCAL_MODULE := libRSDriver 24LOCAL_MODULE_TARGET_ARCH_WARN := arm mips mips64 x86 x86_64 arm64 25 26LOCAL_SRC_FILES:= \ 27 driver/rsdAllocation.cpp \ 28 driver/rsdBcc.cpp \ 29 driver/rsdCore.cpp \ 30 driver/rsdElement.cpp \ 31 driver/rsdFrameBuffer.cpp \ 32 driver/rsdFrameBufferObj.cpp \ 33 driver/rsdGL.cpp \ 34 driver/rsdMesh.cpp \ 35 driver/rsdMeshObj.cpp \ 36 driver/rsdProgram.cpp \ 37 driver/rsdProgramRaster.cpp \ 38 driver/rsdProgramStore.cpp \ 39 driver/rsdRuntimeStubs.cpp \ 40 driver/rsdSampler.cpp \ 41 driver/rsdScriptGroup.cpp \ 42 driver/rsdShader.cpp \ 43 driver/rsdShaderCache.cpp \ 44 driver/rsdType.cpp \ 45 driver/rsdVertexArray.cpp 46 47 48LOCAL_SHARED_LIBRARIES += libRS_internal libRSCpuRef 49LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 50LOCAL_SHARED_LIBRARIES += libui libgui libsync 51 52LOCAL_SHARED_LIBRARIES += libbcinfo libLLVM 53 54LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 55 56LOCAL_CXX_STL := libc++ 57 58LOCAL_CFLAGS += $(rs_base_CFLAGS) 59LOCAL_CPPFLAGS += -fno-exceptions 60 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 81LOCAL_CXX_STL := none 82LOCAL_SANITIZE := never 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) 90LOCAL_CLANG := true 91LOCAL_MODULE := libRS_internal 92LOCAL_MODULE_TARGET_ARCH_WARN := arm mips mips64 x86 x86_64 arm64 93 94LOCAL_MODULE_CLASS := SHARED_LIBRARIES 95generated_sources:= $(local-generated-sources-dir) 96 97# Generate custom headers 98 99GEN := $(addprefix $(generated_sources)/, \ 100 rsgApiStructs.h \ 101 rsgApiFuncDecl.h \ 102 ) 103 104$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 105$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 106$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 107$(GEN): $(generated_sources)/%.h : $(LOCAL_PATH)/%.h.rsg 108 $(transform-generated-source) 109 110# used in jni/Android.mk 111rs_generated_source += $(GEN) 112LOCAL_GENERATED_SOURCES += $(GEN) 113 114# Generate custom source files 115 116GEN := $(addprefix $(generated_sources)/, \ 117 rsgApiReplay.cpp \ 118 ) 119 120$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 121$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 122$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 123$(GEN): $(generated_sources)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 124 $(transform-generated-source) 125 126# used in jni/Android.mk 127rs_generated_source += $(GEN) 128 129LOCAL_GENERATED_SOURCES += $(GEN) 130 131LOCAL_SRC_FILES:= \ 132 rsAllocation.cpp \ 133 rsAnimation.cpp \ 134 rsComponent.cpp \ 135 rsContext.cpp \ 136 rsClosure.cpp \ 137 rsCppUtils.cpp \ 138 rsDevice.cpp \ 139 rsDriverLoader.cpp \ 140 rsElement.cpp \ 141 rsFBOCache.cpp \ 142 rsFifoSocket.cpp \ 143 rsFileA3D.cpp \ 144 rsFont.cpp \ 145 rsGrallocConsumer.cpp \ 146 rsObjectBase.cpp \ 147 rsMatrix2x2.cpp \ 148 rsMatrix3x3.cpp \ 149 rsMatrix4x4.cpp \ 150 rsMesh.cpp \ 151 rsMutex.cpp \ 152 rsProgram.cpp \ 153 rsProgramFragment.cpp \ 154 rsProgramStore.cpp \ 155 rsProgramRaster.cpp \ 156 rsProgramVertex.cpp \ 157 rsSampler.cpp \ 158 rsScript.cpp \ 159 rsScriptC.cpp \ 160 rsScriptC_Lib.cpp \ 161 rsScriptC_LibGL.cpp \ 162 rsScriptGroup.cpp \ 163 rsScriptGroup2.cpp \ 164 rsScriptIntrinsic.cpp \ 165 rsSignal.cpp \ 166 rsStream.cpp \ 167 rsThreadIO.cpp \ 168 rsType.cpp 169 170LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2 171LOCAL_SHARED_LIBRARIES += libgui libsync libdl libui 172LOCAL_SHARED_LIBRARIES += libft2 libpng libz 173 174LOCAL_SHARED_LIBRARIES += libbcinfo libLLVM 175 176LOCAL_C_INCLUDES += external/freetype/include 177LOCAL_C_INCLUDES += frameworks/compile/libbcc/include 178 179LOCAL_CXX_STL := libc++ 180 181LOCAL_CFLAGS += $(rs_base_CFLAGS) 182# TODO: external/freetype still uses the register keyword 183# Bug: 17163086 184LOCAL_CFLAGS += -Wno-deprecated-register 185 186LOCAL_CPPFLAGS += -fno-exceptions 187 188LOCAL_MODULE_TAGS := optional 189 190include $(BUILD_SHARED_LIBRARY) 191 192include $(CLEAR_VARS) 193LOCAL_CLANG := true 194LOCAL_MODULE := libRS 195LOCAL_MODULE_TARGET_ARCH_WARN := arm mips mips64 x86 x86_64 arm64 196 197LOCAL_MODULE_CLASS := SHARED_LIBRARIES 198generated_sources:= $(local-generated-sources-dir) 199 200# Generate custom headers 201 202GEN := $(addprefix $(generated_sources)/, \ 203 rsgApiStructs.h \ 204 rsgApiFuncDecl.h \ 205 ) 206 207$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 208$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 209$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 210$(GEN): $(generated_sources)/%.h : $(LOCAL_PATH)/%.h.rsg 211 $(transform-generated-source) 212 213# used in jni/Android.mk 214rs_generated_source += $(GEN) 215LOCAL_GENERATED_SOURCES += $(GEN) 216 217# Generate custom source files 218 219GEN := $(addprefix $(generated_sources)/, \ 220 rsgApi.cpp \ 221 ) 222 223$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 224$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 225$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 226$(GEN): $(generated_sources)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 227 $(transform-generated-source) 228 229# used in jni/Android.mk 230rs_generated_source += $(GEN) 231 232LOCAL_GENERATED_SOURCES += $(GEN) 233 234LOCAL_SRC_FILES:= \ 235 rsApiAllocation.cpp \ 236 rsApiContext.cpp \ 237 rsApiDevice.cpp \ 238 rsApiElement.cpp \ 239 rsApiFileA3D.cpp \ 240 rsApiMesh.cpp \ 241 rsApiType.cpp \ 242 243LOCAL_SHARED_LIBRARIES += libRS_internal 244LOCAL_SHARED_LIBRARIES += liblog 245 246LOCAL_CFLAGS += $(rs_base_CFLAGS) 247# TODO: external/freetype still uses the register keyword 248# Bug: 17163086 249LOCAL_CFLAGS += -Wno-deprecated-register 250 251LOCAL_CPPFLAGS += -fno-exceptions 252 253LOCAL_LDFLAGS += -Wl,--version-script,${LOCAL_PATH}/libRS.map 254 255LOCAL_MODULE_TAGS := optional 256 257include $(BUILD_SHARED_LIBRARY) 258 259# Now build a host version for serialization 260include $(CLEAR_VARS) 261LOCAL_MODULE:= libRS 262LOCAL_MODULE_TAGS := optional 263LOCAL_MODULE_CLASS := STATIC_LIBRARIES 264LOCAL_IS_HOST_MODULE := true 265 266intermediates := $(call local-generated-sources-dir) 267 268# Generate custom headers 269 270GEN := $(addprefix $(intermediates)/, \ 271 rsgApiStructs.h \ 272 rsgApiFuncDecl.h \ 273 ) 274 275$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 276$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 277$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 278$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg 279 $(transform-generated-source) 280 281LOCAL_GENERATED_SOURCES += $(GEN) 282 283# Generate custom source files 284 285GEN := $(addprefix $(intermediates)/, \ 286 rsgApi.cpp \ 287 rsgApiReplay.cpp \ 288 ) 289 290$(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 291$(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rsg.spec | $(RSG_GENERATOR) $< $@ 292$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rsg.spec 293$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 294 $(transform-generated-source) 295 296LOCAL_GENERATED_SOURCES += $(GEN) 297 298LOCAL_CFLAGS += $(rs_base_CFLAGS) 299LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE 300LOCAL_CFLAGS += -fPIC 301LOCAL_CPPFLAGS += -fno-exceptions 302 303LOCAL_SRC_FILES:= \ 304 rsAllocation.cpp \ 305 rsAnimation.cpp \ 306 rsComponent.cpp \ 307 rsContext.cpp \ 308 rsClosure.cpp \ 309 rsDevice.cpp \ 310 rsDriverLoader.cpp \ 311 rsElement.cpp \ 312 rsFBOCache.cpp \ 313 rsFifoSocket.cpp \ 314 rsFileA3D.cpp \ 315 rsFont.cpp \ 316 rsObjectBase.cpp \ 317 rsMatrix2x2.cpp \ 318 rsMatrix3x3.cpp \ 319 rsMatrix4x4.cpp \ 320 rsMesh.cpp \ 321 rsMutex.cpp \ 322 rsProgram.cpp \ 323 rsProgramFragment.cpp \ 324 rsProgramStore.cpp \ 325 rsProgramRaster.cpp \ 326 rsProgramVertex.cpp \ 327 rsSampler.cpp \ 328 rsScript.cpp \ 329 rsScriptC.cpp \ 330 rsScriptC_Lib.cpp \ 331 rsScriptC_LibGL.cpp \ 332 rsScriptGroup.cpp \ 333 rsScriptGroup2.cpp \ 334 rsScriptIntrinsic.cpp \ 335 rsSignal.cpp \ 336 rsStream.cpp \ 337 rsThreadIO.cpp \ 338 rsType.cpp 339 340LOCAL_STATIC_LIBRARIES := libcutils libutils liblog 341 342LOCAL_CLANG := true 343 344include $(BUILD_HOST_STATIC_LIBRARY) 345 346include $(call all-makefiles-under,$(LOCAL_PATH)) 347