Jerome Gaillard | cf713d4 | 2019-10-23 11:43:26 +0100 | [diff] [blame^] | 1 | # Fonts for layoutlib |
| 2 | |
| 3 | FONT_TEMP := $(call intermediates-dir-for,PACKAGING,fonts,HOST,COMMON) |
| 4 | |
| 5 | # The font configuration files - system_fonts.xml, fallback_fonts.xml etc. |
| 6 | font_config := $(sort $(wildcard frameworks/base/data/fonts/*.xml)) |
| 7 | font_config := $(addprefix $(FONT_TEMP)/, $(notdir $(font_config))) |
| 8 | |
| 9 | $(font_config): $(FONT_TEMP)/%.xml: \ |
| 10 | frameworks/base/data/fonts/%.xml |
| 11 | $(hide) mkdir -p $(dir $@) |
| 12 | $(hide) cp -vf $< $@ |
| 13 | |
| 14 | # List of fonts on the device that we want to ship. This is all .ttf, .ttc and .otf fonts. |
| 15 | fonts_device := $(filter $(TARGET_OUT)/fonts/%.ttf $(TARGET_OUT)/fonts/%.ttc $(TARGET_OUT)/fonts/%.otf, $(INTERNAL_SYSTEMIMAGE_FILES)) |
| 16 | fonts_device := $(addprefix $(FONT_TEMP)/, $(notdir $(fonts_device))) |
| 17 | |
| 18 | # TODO: If the font file is a symlink, reuse the font renamed from the symlink |
| 19 | # target. |
| 20 | $(fonts_device): $(FONT_TEMP)/%: $(TARGET_OUT)/fonts/% |
| 21 | $(hide) mkdir -p $(dir $@) |
| 22 | $(hide) cp -vf $< $@ |
| 23 | |
| 24 | # List of all dependencies - all fonts and configuration files. |
| 25 | FONT_FILES := $(fonts_device) $(font_config) |
| 26 | |
| 27 | .PHONY: layoutlib layoutlib-tests |
| 28 | layoutlib layoutlib-tests: $(FONT_FILES) |
| 29 | |
| 30 | $(call dist-for-goals, layoutlib, $(foreach m,$(FONT_FILES), $(m):layoutlib_native/fonts/$(notdir $(m)))) |
| 31 | |
| 32 | FONT_TEMP := |
| 33 | font_config := |
| 34 | fonts_device := |
| 35 | FONT_FILES := |