1# Fonts for layoutlib 2 3FONT_TEMP := $(call intermediates-dir-for,PACKAGING,fonts,HOST,COMMON) 4 5# The font configuration files - system_fonts.xml, fallback_fonts.xml etc. 6font_config := $(sort $(wildcard frameworks/base/data/fonts/*.xml)) 7font_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. 15fonts_device := $(filter $(TARGET_OUT)/fonts/%.ttf $(TARGET_OUT)/fonts/%.ttc $(TARGET_OUT)/fonts/%.otf, $(INTERNAL_SYSTEMIMAGE_FILES)) 16fonts_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. 25FONT_FILES := $(fonts_device) $(font_config) 26 27.PHONY: layoutlib layoutlib-tests 28layoutlib layoutlib-tests: $(FONT_FILES) 29 30$(call dist-for-goals, layoutlib, $(foreach m,$(FONT_FILES), $(m):layoutlib_native/fonts/$(notdir $(m)))) 31 32FONT_TEMP := 33font_config := 34fonts_device := 35FONT_FILES := 36