blob: f3e9b661a931821dbc455a73f31a83c0cfa30c9b [file] [log] [blame]
Rashed Abdel-Tawabdfc3d182019-09-06 10:44:50 -07001PATH_OVERRIDE_SOONG := $(shell echo $(TOOLS_PATH_OVERRIDE) | sed -e 's|$$|$$$$|g')
2
Rashed Abdel-Tawab9fa7e802018-09-18 21:53:24 -07003# Add variables that we wish to make available to soong here.
4EXPORT_TO_SOONG := \
5 KERNEL_ARCH \
Rashed Abdel-Tawabba5ea352019-09-07 17:01:13 -07006 KERNEL_BUILD_OUT_PREFIX \
Rashed Abdel-Tawab9fa7e802018-09-18 21:53:24 -07007 KERNEL_CROSS_COMPILE \
Rashed Abdel-Tawabfb35b9d2019-09-05 21:21:13 -07008 KERNEL_MAKE_CMD \
Rashed Abdel-Tawab9fa7e802018-09-18 21:53:24 -07009 KERNEL_MAKE_FLAGS \
Rashed Abdel-Tawabdfc3d182019-09-06 10:44:50 -070010 PATH_OVERRIDE_SOONG \
Rashed Abdel-Tawab9fa7e802018-09-18 21:53:24 -070011 TARGET_KERNEL_CONFIG \
12 TARGET_KERNEL_SOURCE
13
14# Setup SOONG_CONFIG_* vars to export the vars listed above.
15# Documentation here:
16# https://github.com/LineageOS/android_build_soong/commit/8328367c44085b948c003116c0ed74a047237a69
17
18SOONG_CONFIG_NAMESPACES += lineageVarsPlugin
19
20SOONG_CONFIG_lineageVarsPlugin :=
21
22define addVar
23 SOONG_CONFIG_lineageVarsPlugin += $(1)
24 SOONG_CONFIG_lineageVarsPlugin_$(1) := $$(subst ",\",$$($1))
25endef
26
27$(foreach v,$(EXPORT_TO_SOONG),$(eval $(call addVar,$(v))))