blob: 26b61c1ec8ebf5bee5cc9d8b8a82aec3582adc3a [file] [log] [blame]
Dan Willemsenfa32e292017-10-19 22:18:23 -07001# Usage: make -f path/to/Android.sources.bp.mk NAMES=<> >Android.sources.bp
2#
3# It will read the Makefile.sources in the current directory, and
4# write <NAME>_FILES to stdout as an Android.bp cc_defaults module.
5
6.PHONY: all
7all:
8 @# Do nothing
9
10include Makefile.sources
11
12empty :=
13indent := $(empty) $(empty)
14
15$(info // Autogenerated with Android.sources.bp.mk)
16$(foreach NAME,$(NAMES), \
17 $(eval lower_name := $(shell echo $(PREFIX)$(NAME) | tr 'A-Z' 'a-z')) \
18 $(info ) \
19 $(info cc_defaults {) \
20 $(info $(indent)name: "$(lower_name)_sources",) \
21 $(info $(indent)srcs: [) \
22 $(foreach f,$(filter %.c,$($(NAME)_FILES)), \
23 $(info $(indent)$(indent)"$(f)",)) \
24 $(info $(indent)],) \
25 $(info }))