From 60294ef8d506a0222ccd914134408d37bb84b43f Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 2 Apr 2019 17:04:18 -0700 Subject: [PATCH] Support host phony modules I'm fixing make to differentiate between host and target, so this will be more useful soon. Test: Android-aosp_arm64.mk is the same before/after Test: adding `host_supported: true` to shell_and_utilities_system produces expected Android-aosp_arm64.mk Change-Id: Idf12703be692100336db6d5c0ec05bb96e5e5c27 --- phony/phony.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phony/phony.go b/phony/phony.go index e8a6550fa..ed6a2fef1 100644 --- a/phony/phony.go +++ b/phony/phony.go @@ -34,7 +34,7 @@ type phony struct { func PhonyFactory() android.Module { module := &phony{} - android.InitAndroidModule(module) + android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon) return module } @@ -51,6 +51,9 @@ func (p *phony) AndroidMk() android.AndroidMkData { fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) fmt.Fprintln(w, "LOCAL_MODULE :=", name) + if p.Host() { + fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true") + } fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(p.requiredModuleNames, " ")) fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)") },