1
0

Android.sources.bp.mk 712 B

12345678910111213141516171819202122232425
  1. # 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. .PHONY: all
  6. all:
  7. @# Do nothing
  8. include Makefile.sources
  9. empty :=
  10. indent := $(empty) $(empty)
  11. $(info // Autogenerated with Android.sources.bp.mk)
  12. $(foreach NAME,$(NAMES), \
  13. $(eval lower_name := $(shell echo $(PREFIX)$(NAME) | tr 'A-Z' 'a-z')) \
  14. $(info ) \
  15. $(info cc_defaults {) \
  16. $(info $(indent)name: "$(lower_name)_sources",) \
  17. $(info $(indent)srcs: [) \
  18. $(foreach f,$(filter %.c,$($(NAME)_FILES)), \
  19. $(info $(indent)$(indent)"$(f)",)) \
  20. $(info $(indent)],) \
  21. $(info }))