Move definition of dist-for-goals before call.

New changes to Soong allow for dist-for-goals to be directly invoked
through the Soong-side of the build system.

This presents a problem, as the dist-for-goals propagation for Soong
lands in make_vars-$(target).mk, which is called before dist-for-goals
is defined.

We move the dist-for-goals definition (through moving where distdir.mk
is included) to be before any possible use of the call to
dist-for-goals.

Test: m checkbuild
Change-Id: Icef27a4d2239948b07354c87b58c9985a66a53bd
diff --git a/core/config.mk b/core/config.mk
index d120d61..e887d93 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -22,6 +22,13 @@
 
 include $(BUILD_SYSTEM_COMMON)/core.mk
 
+# -----------------------------------------------------------------
+# Rules and functions to help copy important files to DIST_DIR
+# when requested. This must be included once only, and must be included before
+# soong_config (as soong_config calls make_vars-$(TARGET).mk, and soong may
+# propagate calls to dist-for-goals there).
+include $(BUILD_SYSTEM)/distdir.mk
+
 # Mark variables that should be coming as environment variables from soong_ui
 # as readonly
 .KATI_READONLY := OUT_DIR TMPDIR BUILD_DATETIME_FILE