blob: e9b2ac7a93f641b5bc46f1d30b68d42031b9f120 [file] [log] [blame]
Joe Onorato48bd6f52016-04-06 14:48:30 -07001# Print a list of the modules that could be built
2
3MODULE_INFO_JSON := $(PRODUCT_OUT)/module-info.json
4
5$(MODULE_INFO_JSON):
6 @echo Generating $@
7 $(hide) echo -ne '{\n ' > $@
8 $(hide) echo -ne $(foreach m, $(sort $(ALL_MODULES)), \
9 ' "$(m)": {' \
10 '"class": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASS)),"$(w)", )], ' \
11 '"path": [$(foreach w,$(sort $(ALL_MODULES.$(m).PATH)),"$(w)", )], ' \
12 '"tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TAGS)),"$(w)", )], ' \
13 '"installed": [$(foreach w,$(sort $(ALL_MODULES.$(m).INSTALLED)),"$(w)", )], ' \
14 '},\n' \
15 ) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@
16 $(hide) echo '}' >> $@
17
18
19# If ONE_SHOT_MAKEFILE is set, our view of the world is smaller, so don't
20# rewrite the file in that came.
21ifndef ONE_SHOT_MAKEFILE
22files: $(MODULE_INFO_JSON)
23endif
24