aboutsummaryrefslogtreecommitdiffstats
blob: 26b61c1ec8ebf5bee5cc9d8b8a82aec3582adc3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 }))