• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1SOONG := $(SOONG_OUT_DIR)/soong
2SOONG_BOOTSTRAP := $(SOONG_OUT_DIR)/.soong.bootstrap
3SOONG_BUILD_NINJA := $(SOONG_OUT_DIR)/build.ninja
4SOONG_IN_MAKE := $(SOONG_OUT_DIR)/.soong.in_make
5SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT).mk
6SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.variables
7SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT).mk
8
9BINDER32BIT :=
10ifneq ($(TARGET_USES_64_BIT_BINDER),true)
11ifneq ($(TARGET_IS_64_BIT),true)
12BINDER32BIT := true
13endif
14endif
15
16include $(BUILD_SYSTEM)/dex_preopt_config.mk
17
18ifeq ($(WRITE_SOONG_VARIABLES),true)
19
20# Create soong.variables with copies of makefile settings.  Runs every build,
21# but only updates soong.variables if it changes
22$(shell mkdir -p $(dir $(SOONG_VARIABLES)))
23$(call json_start)
24
25$(call add_json_str,  Make_suffix, -$(TARGET_PRODUCT))
26
27$(call add_json_str,  BuildId,                           $(BUILD_ID))
28$(call add_json_str,  BuildNumberFromFile,               $$$(BUILD_NUMBER_FROM_FILE))
29
30$(call add_json_str,  Platform_version_name,             $(PLATFORM_VERSION))
31$(call add_json_val,  Platform_sdk_version,              $(PLATFORM_SDK_VERSION))
32$(call add_json_str,  Platform_sdk_codename,             $(PLATFORM_VERSION_CODENAME))
33$(call add_json_bool, Platform_sdk_final,                $(filter REL,$(PLATFORM_VERSION_CODENAME)))
34$(call add_json_csv,  Platform_version_active_codenames, $(PLATFORM_VERSION_ALL_CODENAMES))
35$(call add_json_csv,  Platform_version_future_codenames, $(PLATFORM_VERSION_FUTURE_CODENAMES))
36$(call add_json_str,  Platform_security_patch,           $(PLATFORM_SECURITY_PATCH))
37$(call add_json_str,  Platform_preview_sdk_version,      $(PLATFORM_PREVIEW_SDK_VERSION))
38$(call add_json_str,  Platform_base_os,                  $(PLATFORM_BASE_OS))
39
40$(call add_json_str,  Platform_min_supported_target_sdk_version, $(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION))
41
42$(call add_json_bool, Allow_missing_dependencies,        $(ALLOW_MISSING_DEPENDENCIES))
43$(call add_json_bool, Unbundled_build,                   $(TARGET_BUILD_APPS))
44$(call add_json_bool, Unbundled_build_sdks_from_source,  $(UNBUNDLED_BUILD_SDKS_FROM_SOURCE))
45$(call add_json_bool, Pdk,                               $(filter true,$(TARGET_BUILD_PDK)))
46
47$(call add_json_bool, Debuggable,                        $(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
48$(call add_json_bool, Eng,                               $(filter eng,$(TARGET_BUILD_VARIANT)))
49
50$(call add_json_str,  DeviceName,                        $(TARGET_DEVICE))
51$(call add_json_str,  DeviceArch,                        $(TARGET_ARCH))
52$(call add_json_str,  DeviceArchVariant,                 $(TARGET_ARCH_VARIANT))
53$(call add_json_str,  DeviceCpuVariant,                  $(TARGET_CPU_VARIANT))
54$(call add_json_list, DeviceAbi,                         $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2))
55
56$(call add_json_str,  DeviceSecondaryArch,               $(TARGET_2ND_ARCH))
57$(call add_json_str,  DeviceSecondaryArchVariant,        $(TARGET_2ND_ARCH_VARIANT))
58$(call add_json_str,  DeviceSecondaryCpuVariant,         $(TARGET_2ND_CPU_VARIANT))
59$(call add_json_list, DeviceSecondaryAbi,                $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2))
60
61$(call add_json_str,  HostArch,                          $(HOST_ARCH))
62$(call add_json_str,  HostSecondaryArch,                 $(HOST_2ND_ARCH))
63$(call add_json_bool, HostStaticBinaries,                $(BUILD_HOST_static))
64
65$(call add_json_str,  CrossHost,                         $(HOST_CROSS_OS))
66$(call add_json_str,  CrossHostArch,                     $(HOST_CROSS_ARCH))
67$(call add_json_str,  CrossHostSecondaryArch,            $(HOST_CROSS_2ND_ARCH))
68
69$(call add_json_list, DeviceResourceOverlays,            $(DEVICE_PACKAGE_OVERLAYS))
70$(call add_json_list, ProductResourceOverlays,           $(PRODUCT_PACKAGE_OVERLAYS))
71$(call add_json_list, EnforceRROTargets,                 $(PRODUCT_ENFORCE_RRO_TARGETS))
72$(call add_json_list, EnforceRROExcludedOverlays,        $(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
73
74$(call add_json_str,  AAPTCharacteristics,               $(TARGET_AAPT_CHARACTERISTICS))
75$(call add_json_list, AAPTConfig,                        $(PRODUCT_AAPT_CONFIG))
76$(call add_json_str,  AAPTPreferredConfig,               $(PRODUCT_AAPT_PREF_CONFIG))
77$(call add_json_list, AAPTPrebuiltDPI,                   $(PRODUCT_AAPT_PREBUILT_DPI))
78
79$(call add_json_str,  DefaultAppCertificate,             $(PRODUCT_DEFAULT_DEV_CERTIFICATE))
80
81$(call add_json_str,  AppsDefaultVersionName,            $(APPS_DEFAULT_VERSION_NAME))
82
83$(call add_json_list, SanitizeHost,                      $(SANITIZE_HOST))
84$(call add_json_list, SanitizeDevice,                    $(SANITIZE_TARGET))
85$(call add_json_list, SanitizeDeviceDiag,                $(SANITIZE_TARGET_DIAG))
86$(call add_json_list, SanitizeDeviceArch,                $(SANITIZE_TARGET_ARCH))
87
88$(call add_json_bool, Safestack,                         $(filter true,$(USE_SAFESTACK)))
89$(call add_json_bool, EnableCFI,                         $(call invert_bool,$(filter false,$(ENABLE_CFI))))
90$(call add_json_list, CFIExcludePaths,                   $(CFI_EXCLUDE_PATHS) $(PRODUCT_CFI_EXCLUDE_PATHS))
91$(call add_json_list, CFIIncludePaths,                   $(CFI_INCLUDE_PATHS) $(PRODUCT_CFI_INCLUDE_PATHS))
92$(call add_json_bool, EnableXOM,                         $(call invert_bool,$(filter false,$(ENABLE_XOM))))
93$(call add_json_list, XOMExcludePaths,                   $(XOM_EXCLUDE_PATHS) $(PRODUCT_XOM_EXCLUDE_PATHS))
94$(call add_json_list, IntegerOverflowExcludePaths,       $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))
95
96$(call add_json_bool, DisableScudo,                      $(filter true,$(PRODUCT_DISABLE_SCUDO)))
97
98$(call add_json_bool, ClangTidy,                         $(filter 1 true,$(WITH_TIDY)))
99$(call add_json_str,  TidyChecks,                        $(WITH_TIDY_CHECKS))
100
101$(call add_json_bool, NativeCoverage,                    $(filter true,$(NATIVE_COVERAGE)))
102$(call add_json_list, CoveragePaths,                     $(COVERAGE_PATHS))
103$(call add_json_list, CoverageExcludePaths,              $(COVERAGE_EXCLUDE_PATHS))
104
105$(call add_json_bool, ArtUseReadBarrier,                 $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
106$(call add_json_bool, Binder32bit,                       $(BINDER32BIT))
107$(call add_json_str,  BtConfigIncludeDir,                $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
108$(call add_json_list, DeviceKernelHeaders,               $(TARGET_PROJECT_SYSTEM_INCLUDES))
109$(call add_json_bool, DevicePrefer32BitApps,             $(filter true,$(TARGET_PREFER_32_BIT_APPS)))
110$(call add_json_bool, DevicePrefer32BitExecutables,      $(filter true,$(TARGET_PREFER_32_BIT_EXECUTABLES)))
111$(call add_json_str,  DeviceVndkVersion,                 $(BOARD_VNDK_VERSION))
112$(call add_json_str,  Platform_vndk_version,             $(PLATFORM_VNDK_VERSION))
113$(call add_json_list, ExtraVndkVersions,                 $(PRODUCT_EXTRA_VNDK_VERSIONS))
114$(call add_json_list, DeviceSystemSdkVersions,           $(BOARD_SYSTEMSDK_VERSIONS))
115$(call add_json_list, Platform_systemsdk_versions,       $(PLATFORM_SYSTEMSDK_VERSIONS))
116$(call add_json_bool, Malloc_not_svelte,                 $(call invert_bool,$(filter true,$(MALLOC_SVELTE))))
117$(call add_json_str,  Override_rs_driver,                $(OVERRIDE_RS_DRIVER))
118
119$(call add_json_bool, UncompressPrivAppDex,              $(call invert_bool,$(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS))))
120$(call add_json_list, ModulesLoadedByPrivilegedModules,  $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
121
122$(call add_json_list, BootJars,                          $(PRODUCT_BOOT_JARS))
123
124$(call add_json_bool, VndkUseCoreVariant,                $(TARGET_VNDK_USE_CORE_VARIANT))
125
126$(call add_json_bool, Product_is_iot,                    $(filter true,$(PRODUCT_IOT)))
127
128$(call add_json_bool, Treble_linker_namespaces,          $(filter true,$(PRODUCT_TREBLE_LINKER_NAMESPACES)))
129$(call add_json_bool, Enforce_vintf_manifest,            $(filter true,$(PRODUCT_ENFORCE_VINTF_MANIFEST)))
130
131$(call add_json_bool, Check_elf_files,                   $(filter true,$(PRODUCT_CHECK_ELF_FILES)))
132
133$(call add_json_bool, Uml,                               $(filter true,$(TARGET_USER_MODE_LINUX)))
134$(call add_json_bool, Use_lmkd_stats_log,                $(filter true,$(TARGET_LMKD_STATS_LOG)))
135$(call add_json_str,  VendorPath,                        $(TARGET_COPY_OUT_VENDOR))
136$(call add_json_str,  OdmPath,                           $(TARGET_COPY_OUT_ODM))
137$(call add_json_str,  ProductPath,                       $(TARGET_COPY_OUT_PRODUCT))
138$(call add_json_str,  ProductServicesPath,               $(TARGET_COPY_OUT_PRODUCT_SERVICES))
139$(call add_json_bool, MinimizeJavaDebugInfo,             $(filter true,$(PRODUCT_MINIMIZE_JAVA_DEBUG_INFO)))
140
141$(call add_json_bool, UseGoma,                           $(filter-out false,$(USE_GOMA)))
142$(call add_json_bool, Arc,                               $(filter true,$(TARGET_ARC)))
143
144$(call add_json_list, NamespacesToExport,                $(PRODUCT_SOONG_NAMESPACES))
145
146$(call add_json_list, PgoAdditionalProfileDirs,          $(PGO_ADDITIONAL_PROFILE_DIRS))
147
148$(call add_json_list, BoardVendorSepolicyDirs,           $(BOARD_SEPOLICY_DIRS))
149$(call add_json_list, BoardOdmSepolicyDirs,              $(BOARD_ODM_SEPOLICY_DIRS))
150$(call add_json_list, BoardPlatPublicSepolicyDirs,       $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
151$(call add_json_list, BoardPlatPrivateSepolicyDirs,      $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
152
153$(call add_json_bool, FlattenApex,                       $(filter true,$(TARGET_FLATTEN_APEX)))
154
155$(call add_json_str,  DexpreoptGlobalConfig,             $(DEX_PREOPT_CONFIG))
156
157$(call add_json_list, ManifestPackageNameOverrides,      $(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES))
158$(call add_json_list, PackageNameOverrides,              $(PRODUCT_PACKAGE_NAME_OVERRIDES))
159$(call add_json_list, CertificateOverrides,              $(PRODUCT_CERTIFICATE_OVERRIDES))
160
161$(call add_json_bool, EnforceSystemCertificate,          $(ENFORCE_SYSTEM_CERTIFICATE))
162$(call add_json_list, EnforceSystemCertificateWhitelist, $(ENFORCE_SYSTEM_CERTIFICATE_WHITELIST))
163
164$(call add_json_list, ProductHiddenAPIStubs,             $(PRODUCT_HIDDENAPI_STUBS))
165$(call add_json_list, ProductHiddenAPIStubsSystem,       $(PRODUCT_HIDDENAPI_STUBS_SYSTEM))
166$(call add_json_list, ProductHiddenAPIStubsTest,         $(PRODUCT_HIDDENAPI_STUBS_TEST))
167
168$(call add_json_list, TargetFSConfigGen,                 $(TARGET_FS_CONFIG_GEN))
169
170$(call add_json_map, VendorVars)
171$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
172  $(call add_json_map, $(namespace))\
173  $(foreach key,$(SOONG_CONFIG_$(namespace)),\
174    $(call add_json_str,$(key),$(SOONG_CONFIG_$(namespace)_$(key))))\
175  $(call end_json_map))
176$(call end_json_map)
177
178$(call json_end)
179
180$(file >$(SOONG_VARIABLES).tmp,$(json_contents))
181
182$(shell if ! cmp -s $(SOONG_VARIABLES).tmp $(SOONG_VARIABLES); then \
183	  mv $(SOONG_VARIABLES).tmp $(SOONG_VARIABLES); \
184	else \
185	  rm $(SOONG_VARIABLES).tmp; \
186	fi)
187
188endif # CONFIGURE_SOONG
189