-$(BUILD_DIRS): build-dir
-
-build-dir:
- @-$(RMV) $@
- echo timestamp > $@.tmp
- @list='$(BUILD_DIRS)'; \
- for dir in $$list; do \
- if ! test -d $$dir; then \
- echo $(MKINSTALLDIRS) $(BUILD_DIRS); \
- $(MKINSTALLDIRS) $(BUILD_DIRS); \
- fi; \
- done
- mv $@.tmp $@
-
-# The | is an order-only prerequisite. This helps when the -j option is used,
-# and we don't want the files to be built before the directories are built.
-ifneq ($(filter order-only,$(.FEATURES)),)
-$(ALL_FILES) $(ALL_INDEX_SRC_FILES): | build-dir
-endif
-
-# Now, sections for building each kind of data.
-
-#################################################### DAT
-# DAT FILES
-
-# cnvalias.icu
-$(BUILDDIR)/cnvalias.icu: $(UCMSRCDIR)/convrtrs.txt $(TOOLBINDIR)/gencnval$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/gencnval -d $(BUILDDIR) $(UCMSRCDIR)/convrtrs.txt
-
-# Targets for prebuilt Unicode data
-$(BUILDDIR)/%.icu: $(SRCDATADIR)/in/%.icu
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
-
-$(BUILDDIR)/%.nrm: $(SRCDATADIR)/in/%.nrm
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
-
-$(BUILDDIR)/coll/ucadata.icu: $(SRCDATADIR)/in/coll/ucadata-unihan.icu
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
-
-#################################################### SPP
-# SPP FILES
-
-$(BUILDDIR)/%.spp: $(SPREPSRCDIR)/%.txt $(TOOLBINDIR)/gensprep$(TOOLEXEEXT) $(BUILDDIR)/unames.icu
- $(INVOKE) $(TOOLBINDIR)/gensprep -d $(BUILDDIR) -i $(BUILDDIR) -s $(SPREPSRCDIR) -b $(@F:%.spp=%) -m $(UNICODEDATADIR) -u 3.2.0 $(<F)
-
-#################################################### BRK
-# BRK FILES
-
-$(BRKBLDDIR)/%.brk: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genbrk$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genbrk -c -i $(BUILDDIR) -r $< -o $@
-
-#################################################### DICT
-# DICT FILES
-
-# .dict file generated regardless of whether dictionary file exists
-
-$(BRKBLDDIR)/%.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --uchars -c -i $(BUILDDIR) $(BRKSRCDIR)/$(*F).txt $@
-
-$(BRKBLDDIR)/thaidict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x0e00 -c -i $(BUILDDIR) $(BRKSRCDIR)/thaidict.txt $(BRKBLDDIR)/thaidict.dict
-
-$(BRKBLDDIR)/laodict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x0e80 -c -i $(BUILDDIR) $(BRKSRCDIR)/laodict.txt $(BRKBLDDIR)/laodict.dict
-
-$(BRKBLDDIR)/burmesedict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1000 -c -i $(BUILDDIR) $(BRKSRCDIR)/burmesedict.txt $(BRKBLDDIR)/burmesedict.dict
-
-# TODO: figure out why combining characters are here?
-$(BRKBLDDIR)/khmerdict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(BRKSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
-
-#################################################### CFU
-# CFU FILES
-# Note: gencfu requires two input files to produce a single output file.
-# There will be exactly one target file and two source files.
-# The $(word n, ...) selects the nth word from the following stuff.
-# There must be a nicer way to do this.
-
-$(CFU_FILES): $(ALL_CFU_SOURCE) $(TOOLBINDIR)/gencfu$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) echo ALL_CFU_SOURCE: $(ALL_CFU_SOURCE)
- $(INVOKE) echo CFU_FILES: $(CFU_FILES)
- $(INVOKE) echo CFU_FILES_SHORT: $(CFU_FILES_SHORT)
- $(INVOKE) $(TOOLBINDIR)/gencfu -c -i $(BUILDDIR) -r $(word 1,$(ALL_CFU_SOURCE)) -w $(word 2,$(ALL_CFU_SOURCE)) -o $@
-
-
-#################################################### CNV
-# CNV FILES
-$(CNV_FILES_SPECIAL) : $(UCM_FILES_SPECIAL) $(TOOLBINDIR)/makeconv$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/makeconv --ignore-siso-check -c -d $(BUILDDIR) $(UCMSRCDIR)/$(@F:%.cnv=%.ucm)
-$(BUILDDIR)/%.cnv: $(UCMSRCDIR)/%.ucm $(TOOLBINDIR)/makeconv$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/makeconv -c -d $(BUILDDIR) $(UCMSRCDIR)/$(<F)
-
-#################################################### RES
-# RES FILES
-
-### curr res
-$(CURRBLDDIR)/%.res: $(CURRSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(CURRSRCDIR) -d $(CURRBLDDIR) $(<F)
-
-# copy the curr/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(CURRBLDDIR)/pool.res: $(CURRSRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(CURRSRCDIR)/pool.res $(CURRBLDDIR)/pool.res
-
-$(CURRBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(CURR_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(CURR_TREE) -d $(CURRBLDDIR) $(INDEX_NAME).txt
-
-$(CURR_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed currency name locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_CURR_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### lang res
-$(LANGBLDDIR)/%.res: $(LANGSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(LANGSRCDIR) -d $(LANGBLDDIR) $(<F)
-
-# copy the lang/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(LANGBLDDIR)/pool.res: $(LANGSRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(LANGSRCDIR)/pool.res $(LANGBLDDIR)/pool.res
-
-$(LANGBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(LANG_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(LANG_TREE) -d $(LANGBLDDIR) $(INDEX_NAME).txt
-
-$(LANG_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed language name locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_LANG_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### region res
-$(REGIONBLDDIR)/%.res: $(REGIONSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(REGIONSRCDIR) -d $(REGIONBLDDIR) $(<F)
-
-# copy the region/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(REGIONBLDDIR)/pool.res: $(REGIONSRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(REGIONSRCDIR)/pool.res $(REGIONBLDDIR)/pool.res
-
-$(REGIONBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(REGION_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(REGION_TREE) -d $(REGIONBLDDIR) $(INDEX_NAME).txt
-
-$(REGION_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed region name locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_REGION_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### zone res
-$(ZONEBLDDIR)/%.res: $(ZONESRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(ZONESRCDIR) -d $(ZONEBLDDIR) $(<F)
-
-# copy the zone/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(ZONEBLDDIR)/pool.res: $(ZONESRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ZONESRCDIR)/pool.res $(ZONEBLDDIR)/pool.res
-
-$(ZONEBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(ZONE_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(ZONE_TREE) -d $(ZONEBLDDIR) $(INDEX_NAME).txt
-
-$(ZONE_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed time zone name locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_ZONE_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### unit res
-$(UNITBLDDIR)/%.res: $(UNITSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(UNITSRCDIR) -d $(UNITBLDDIR) $(<F)
-
-# copy the unit/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(UNITBLDDIR)/pool.res: $(UNITSRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(UNITSRCDIR)/pool.res $(UNITBLDDIR)/pool.res
-
-$(UNITBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(UNIT_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(UNIT_TREE) -d $(UNITBLDDIR) $(INDEX_NAME).txt
-
-$(UNIT_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed time zone name locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_UNIT_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### collation res
-$(COLBLDDIR)/%.res: $(COLSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(COLSRCDIR) -d $(COLBLDDIR) $(<F)
-
-$(COLBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(COLLATION_TREE) -d $(COLBLDDIR) $(INDEX_NAME).txt
-
-$(COLLATION_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed collation locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_COL_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### brk res
-$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(BRK_FILES) $(DICT_FILES) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(BRKSRCDIR) -d $(BRKBLDDIR) $(<F)
-
-$(BRKBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(BREAK_TREE) -d $(BRKBLDDIR) $(INDEX_NAME).txt
-
-$(BRK_RES_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed break locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_BRS_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### RBNF res
-$(RBNFBLDDIR)/%.res: $(RBNFSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(RBNFSRCDIR) -d $(RBNFBLDDIR) $(<F)
-
-$(RBNFBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(RBNF_TREE) -d $(RBNFBLDDIR) $(INDEX_NAME).txt
-
-$(RBNF_INDEX_FILE): $(SRCLISTDEPS)
- @echo "generating $@ (list of installed RBNF locales)"; \
- $(RMV) $@; \
- echo "// Warning this file is automatically generated" > $@; \
- echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
- echo " InstalledLocales {" >> $@; \
- for file in $(INSTALLED_RBNF_FILES); do \
- echo " $$file {\"\"}" >> $@; \
- done; \
- echo " }" >> $@; \
- echo "}" >> $@;
-
-### TRANSLIT res
-$(TRANSLITBLDDIR)/%.res: $(TRANSLITSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(TRANSLITSRCDIR) -d $(TRANSLITBLDDIR) $(<F)
-
-### normal (locale) res
-all-RES: $(RES_FILES)
-
-$(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F)
-
-# copy the locales/pool.res file from the source folder to the build output folder
-# and swap it to native endianness
-$(BUILDDIR)/pool.res: $(LOCSRCDIR)/pool.res
- $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(LOCSRCDIR)/pool.res $(BUILDDIR)/pool.res
-