Convert to Android.bp
See build/soong/README.md for more information about Soong.
Removes BOARD_GPU_DRIVERS, which wasn't affecting anything, since none
of the HAVE_* macros are defined. Even if they were, we'd prefer to
compile all of them so that a single library can support multiple
boards.
Test: mmma external/libdrm
Change-Id: Ie01736bce6cf41e3da5040fe5341ade0634b5111
diff --git a/Android.sources.bp.mk b/Android.sources.bp.mk
new file mode 100644
index 0000000..26b61c1
--- /dev/null
+++ b/Android.sources.bp.mk
@@ -0,0 +1,25 @@
+# Usage: make -f path/to/Android.sources.bp.mk NAMES=<> >Android.sources.bp
+#
+# It will read the Makefile.sources in the current directory, and
+# write <NAME>_FILES to stdout as an Android.bp cc_defaults module.
+
+.PHONY: all
+all:
+ @# Do nothing
+
+include Makefile.sources
+
+empty :=
+indent := $(empty) $(empty)
+
+$(info // Autogenerated with Android.sources.bp.mk)
+$(foreach NAME,$(NAMES), \
+ $(eval lower_name := $(shell echo $(PREFIX)$(NAME) | tr 'A-Z' 'a-z')) \
+ $(info ) \
+ $(info cc_defaults {) \
+ $(info $(indent)name: "$(lower_name)_sources",) \
+ $(info $(indent)srcs: [) \
+ $(foreach f,$(filter %.c,$($(NAME)_FILES)), \
+ $(info $(indent)$(indent)"$(f)",)) \
+ $(info $(indent)],) \
+ $(info }))