Remove import_includes/export_includes

Now that ONE_SHOT_MAKEFILE no longer exists, we don't have to rely on
the filesystem to store this informtion.

This removes ~16.7k files from our build graph
(aosp-master/aosp_arm64-eng), though only about 600 of them were being
used in a normal build.

Test: treehugger
Change-Id: I3ac12f5ea7f11d25064109a0599bc5be1976fba5
diff --git a/core/main.mk b/core/main.mk
index 9f4b86c..a240b35 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -973,6 +973,27 @@
 endif
 
 # -------------------------------------------------------------------
+# Handle exported/imported includes
+
+# Recursively calculate flags
+$(foreach export,$(EXPORTS_LIST), \
+  $(eval EXPORTS.$$(export) = $$(EXPORTS.$(export).FLAGS) \
+    $(foreach dep,$(EXPORTS.$(export).REEXPORT),$$(EXPORTS.$(dep)))))
+
+# Recursively calculate dependencies
+$(foreach export,$(EXPORTS_LIST), \
+  $(eval EXPORT_DEPS.$$(export) = $$(EXPORTS.$(export).DEPS) \
+    $(foreach dep,$(EXPORTS.$(export).REEXPORT),$$(EXPORT_DEPS.$(dep)))))
+
+# Converts the recursive variables to simple variables so that we don't have to
+# evaluate them for every .o rule
+$(foreach export,$(EXPORTS_LIST),$(eval EXPORTS.$$(export) := $$(strip $$(EXPORTS.$$(export)))))
+$(foreach export,$(EXPORTS_LIST),$(eval EXPORT_DEPS.$$(export) := $$(sort $$(EXPORT_DEPS.$$(export)))))
+
+# Add dependencies
+$(foreach export,$(EXPORTS_LIST),$(eval $(call add-dependency,$$(EXPORTS.$$(export).USERS),$$(EXPORT_DEPS.$$(export)))))
+
+# -------------------------------------------------------------------
 # Figure out our module sets.
 #
 # Of the modules defined by the component makefiles,