1 2 LOCAL_PATH:=frameworks/rs 3 rs_base_CFLAGS := -Werror -Wall -Wextra \ 4 -Wno-unused-parameter \ 5 -Wno-unused-variable \ 6 -Wno-overloaded-virtual -DRS_COMPATIBILITY_LIB \ 7 -std=c++11 8 9 ifeq ($(ARCH_ARM_HAVE_NEON),true) 10 rs_base_CFLAGS += -DARCH_ARM_HAVE_NEON 11 endif 12 13 ifeq ($(TARGET_BUILD_PDK), true) 14 rs_base_CFLAGS += -D__RS_PDK__ 15 endif 16 17 # Build rsg-generator ==================== 18 include $(CLEAR_VARS) 19 20 LOCAL_MODULE := rsg-generator_support 21 22 # These symbols are normally defined by BUILD_XXX, but we need to define them 23 # here so that local-intermediates-dir works. 24 25 LOCAL_MODULE_CLASS := EXECUTABLES 26 intermediates := $(local-intermediates-dir) 27 28 LOCAL_SRC_FILES:= \ 29 spec.l \ 30 rsg_generator.c 31 32 LOCAL_CXX_STL := none 33 LOCAL_SANITIZE := never 34 35 include $(BUILD_HOST_EXECUTABLE) 36 37 # TODO: This should go into build/core/config.mk 38 RSG_GENERATOR_SUPPORT:=$(LOCAL_BUILT_MODULE) 39 40 include $(CLEAR_VARS) 41 LOCAL_MODULE := libRSSupport 42 LOCAL_SDK_VERSION := 9 43 44 45 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 46 generated_sources_dir := $(call local-generated-sources-dir) 47 48 # Generate custom headers 49 50 GEN := $(addprefix $(generated_sources_dir)/, \ 51 rsgApiStructs.h \ 52 rsgApiFuncDecl.h \ 53 ) 54 55 $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 56 $(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rs_compat.spec | $(RSG_GENERATOR_SUPPORT) $< $@ 57 $(GEN) : $(RSG_GENERATOR_SUPPORT) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rs_compat.spec 58 $(GEN): $(generated_sources_dir)/%.h : $(LOCAL_PATH)/%.h.rsg 59 $(transform-generated-source) 60 61 # used in jni/Android.mk 62 rs_generated_source += $(GEN) 63 LOCAL_GENERATED_SOURCES += $(GEN) 64 65 # Generate custom source files 66 67 GEN := $(addprefix $(generated_sources_dir)/, \ 68 rsgApi.cpp \ 69 rsgApiReplay.cpp \ 70 ) 71 72 $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) 73 $(GEN) : PRIVATE_CUSTOM_TOOL = cat $(PRIVATE_PATH)/rs.spec $(PRIVATE_PATH)/rs_compat.spec | $(RSG_GENERATOR_SUPPORT) $< $@ 74 $(GEN) : $(RSG_GENERATOR_SUPPORT) $(LOCAL_PATH)/rs.spec $(LOCAL_PATH)/rs_compat.spec 75 $(GEN): $(generated_sources_dir)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg 76 $(transform-generated-source) 77 78 # used in jni/Android.mk 79 rs_generated_source += $(GEN) 80 81 LOCAL_GENERATED_SOURCES += $(GEN) 82 83 LOCAL_SRC_FILES:= \ 84 rsAllocation.cpp \ 85 rsApiAllocation.cpp \ 86 rsApiContext.cpp \ 87 rsApiDevice.cpp \ 88 rsApiElement.cpp \ 89 rsApiType.cpp \ 90 rsClosure.cpp \ 91 rsComponent.cpp \ 92 rsContext.cpp \ 93 rsCppUtils.cpp \ 94 rsDevice.cpp \ 95 rsDriverLoader.cpp \ 96 rsElement.cpp \ 97 rsFifoSocket.cpp \ 98 rsObjectBase.cpp \ 99 rsMatrix2x2.cpp \ 100 rsMatrix3x3.cpp \ 101 rsMatrix4x4.cpp \ 102 rsMutex.cpp \ 103 rsSampler.cpp \ 104 rsScript.cpp \ 105 rsScriptC.cpp \ 106 rsScriptC_Lib.cpp \ 107 rsScriptGroup.cpp \ 108 rsScriptGroup2.cpp \ 109 rsScriptIntrinsic.cpp \ 110 rsSignal.cpp \ 111 rsStream.cpp \ 112 rsThreadIO.cpp \ 113 rsType.cpp \ 114 driver/rsdAllocation.cpp \ 115 driver/rsdBcc.cpp \ 116 driver/rsdCore.cpp \ 117 driver/rsdElement.cpp \ 118 driver/rsdRuntimeStubs.cpp \ 119 driver/rsdSampler.cpp \ 120 driver/rsdScriptGroup.cpp \ 121 driver/rsdType.cpp \ 122 cpu_ref/rsCpuCore.cpp \ 123 cpu_ref/rsCpuExecutable.cpp \ 124 cpu_ref/rsCpuScript.cpp \ 125 cpu_ref/rsCpuRuntimeMath.cpp \ 126 cpu_ref/rsCpuScriptGroup.cpp \ 127 cpu_ref/rsCpuScriptGroup2.cpp \ 128 cpu_ref/rsCpuIntrinsic.cpp \ 129 cpu_ref/rsCpuIntrinsic3DLUT.cpp \ 130 cpu_ref/rsCpuIntrinsicBlend.cpp \ 131 cpu_ref/rsCpuIntrinsicBlur.cpp \ 132 cpu_ref/rsCpuIntrinsicBLAS.cpp \ 133 cpu_ref/rsCpuIntrinsicColorMatrix.cpp \ 134 cpu_ref/rsCpuIntrinsicConvolve3x3.cpp \ 135 cpu_ref/rsCpuIntrinsicConvolve5x5.cpp \ 136 cpu_ref/rsCpuIntrinsicHistogram.cpp \ 137 cpu_ref/rsCpuIntrinsicLUT.cpp \ 138 cpu_ref/rsCpuIntrinsicResize.cpp \ 139 cpu_ref/rsCpuIntrinsicYuvToRGB.cpp 140 141 ifeq ($(ARCH_ARM_HAVE_ARMV7A),true) 142 LOCAL_CFLAGS_arm := -DARCH_ARM_HAVE_VFP -DARCH_ARM_USE_INTRINSICS 143 LOCAL_ASFLAGS_arm := -mfpu=neon 144 LOCAL_SRC_FILES_arm := \ 145 cpu_ref/rsCpuIntrinsics_neon_3DLUT.S \ 146 cpu_ref/rsCpuIntrinsics_neon_Blend.S \ 147 cpu_ref/rsCpuIntrinsics_neon_Blur.S \ 148 cpu_ref/rsCpuIntrinsics_neon_ColorMatrix.S \ 149 cpu_ref/rsCpuIntrinsics_neon_Convolve.S \ 150 cpu_ref/rsCpuIntrinsics_neon_Resize.S \ 151 cpu_ref/rsCpuIntrinsics_neon_YuvToRGB.S 152 endif 153 154 LOCAL_CFLAGS_arm64 += \ 155 -DARCH_ARM_USE_INTRINSICS \ 156 -DARCH_ARM64_USE_INTRINSICS \ 157 -DARCH_ARM64_HAVE_NEON 158 LOCAL_SRC_FILES_arm64 += \ 159 cpu_ref/rsCpuIntrinsics_advsimd_3DLUT.S \ 160 cpu_ref/rsCpuIntrinsics_advsimd_Blend.S \ 161 cpu_ref/rsCpuIntrinsics_advsimd_Blur.S \ 162 cpu_ref/rsCpuIntrinsics_advsimd_ColorMatrix.S \ 163 cpu_ref/rsCpuIntrinsics_advsimd_Convolve.S \ 164 cpu_ref/rsCpuIntrinsics_advsimd_Resize.S \ 165 cpu_ref/rsCpuIntrinsics_advsimd_YuvToRGB.S 166 167 LOCAL_CFLAGS_x86 += -DARCH_X86_HAVE_SSSE3 168 LOCAL_SRC_FILES_x86 += cpu_ref/rsCpuIntrinsics_x86.cpp 169 LOCAL_CFLAGS_x86_64 += -DARCH_X86_HAVE_SSSE3 170 LOCAL_SRC_FILES_x86_64 += cpu_ref/rsCpuIntrinsics_x86.cpp 171 172 LOCAL_REQUIRED_MODULES := libblasV8 173 LOCAL_STATIC_LIBRARIES := libbnnmlowpV8 174 LOCAL_LDFLAGS += -llog -ldl -Wl,--exclude-libs,libc++_static.a 175 LOCAL_NDK_STL_VARIANT := c++_static 176 177 LOCAL_C_INCLUDES += external/cblas/include 178 LOCAL_C_INCLUDES += external/gemmlowp/eight_bit_int_gemm 179 180 LOCAL_CFLAGS += $(rs_base_CFLAGS) -DGEMMLOWP_USE_STLPORT 181 182 LOCAL_MODULE:= libRSSupport 183 184 # TODO: why isn't this picked up from the host GLOBAL_CFLAGS? 185 LOCAL_CFLAGS += -D__STDC_FORMAT_MACROS 186 187 include $(BUILD_SHARED_LIBRARY) 188