Home | History | Annotate | Download | only in en.us
      1 
      2 LOCAL_PATH:= $(call my-dir)
      3 include $(CLEAR_VARS)
      4 
      5 copy_from :=                     \
      6     baseline11k.par              \
      7     baseline8k.par               \
      8     baseline.par                 \
      9     dictionary/basic.ok          \
     10     dictionary/enroll.ok         \
     11     dictionary/cmu6plus.ok.zip   \
     12     g2p/en-US-ttp.data           \
     13     models/generic.swiarb        \
     14     models/generic11.lda         \
     15     models/generic11_f.swimdl    \
     16     models/generic11_m.swimdl    \
     17     models/generic8.lda          \
     18     models/generic8_f.swimdl     \
     19     models/generic8_m.swimdl     \
     20 
     21 copy_to := $(addprefix $(TARGET_OUT)/usr/srec/config/en.us/,$(copy_from))
     22 
     23 $(copy_to) : $(TARGET_OUT)/usr/srec/config/en.us/% : $(LOCAL_PATH)/% | $(ACP)
     24 	$(transform-prebuilt-to-target)
     25 
     26 ALL_PREBUILT += $(copy_to)
     27 
     28 
     29 # define paths to some grammar tools
     30 GRXML=$(HOST_OUT_EXECUTABLES)/grxmlcompile
     31 MAKE_G2G=$(HOST_OUT_EXECUTABLES)/make_g2g
     32 DEFAULT_PAR=$(ASR_ROOT_DIR)/config/en.us/baseline11k.par
     33 G2G_INSTALL_PATH=$(TARGET_OUT)/usr/srec/config/en.us/grammars
     34 
     35 srec_grammars : \
     36 	$(G2G_INSTALL_PATH)/enroll.g2g \
     37 	$(G2G_INSTALL_PATH)/bothtags5.g2g \
     38 	$(G2G_INSTALL_PATH)/dynamic-test.g2g \
     39 	$(G2G_INSTALL_PATH)/digits.g2g \
     40 	$(G2G_INSTALL_PATH)/boolean.g2g \
     41 	$(G2G_INSTALL_PATH)/homonym_test1.g2g \
     42 	$(G2G_INSTALL_PATH)/homonym_test2.g2g \
     43 	$(G2G_INSTALL_PATH)/homonym_test3.g2g \
     44 	$(G2G_INSTALL_PATH)/homonym_test4.g2g \
     45 	$(G2G_INSTALL_PATH)/ipaq_commands.g2g \
     46 	$(G2G_INSTALL_PATH)/lookup.g2g \
     47 
     48 ALL_PREBUILT += $(G2G_INSTALL_PATH)/VoiceDialer.g2g \
     49 	$(G2G_INSTALL_PATH)/boolean.g2g \
     50 	$(G2G_INSTALL_PATH)/phone_type_choice.g2g
     51 
     52 #---------------------------------------------------------------------------------
     53 # Explicit rules.
     54 # Those without explicit rules are subject to the rule at the end of this makefile
     55 #---------------------------------------------------------------------------------
     56 
     57 # This needs an explicit rule to specify the vocabulary (dictionary)
     58 $(G2G_INSTALL_PATH)/enroll.g2g: $(LOCAL_PATH)/grammars/enroll.grxml $(GRXML) $(MAKE_G2G) $(DEFAULT_PAR) $(LOCAL_PATH)/dictionary/enroll.ok
     59 	mkdir -p $(G2G_INSTALL_PATH)
     60 	$(GRXML) -par $(DEFAULT_PAR) -grxml $< -vocab dictionary/enroll.ok -outdir $(G2G_INSTALL_PATH)
     61 	$(MAKE_G2G) -base $(G2G_INSTALL_PATH)/enroll,addWords=0 -out $@
     62 	(cd $(G2G_INSTALL_PATH); rm -f $*.Grev2.det.txt $*.map $*.omap $*.P.txt $*.params $*.PCLG.txt $*.script)
     63 
     64 
     65 #---------------------------------------------------------------------------------
     66 # Those without explicit rules are subject to the rule below
     67 #---------------------------------------------------------------------------------
     68 
     69 $(G2G_INSTALL_PATH)/%.g2g: $(LOCAL_PATH)/grammars/%.grxml $(GRXML) $(MAKE_G2G) $(DEFAULT_PAR) $(LOCAL_PATH)/dictionary/cmu6plus.ok.zip
     70 	mkdir -p $(G2G_INSTALL_PATH)
     71 	$(GRXML) -par $(DEFAULT_PAR) -grxml $< -outdir $(G2G_INSTALL_PATH)
     72 	$(MAKE_G2G) -base $(G2G_INSTALL_PATH)/$*,addWords=0 -out $@
     73 	(cd $(G2G_INSTALL_PATH); rm -f $*.Grev2.det.txt $*.map $*.omap $*.P.txt $*.params $*.PCLG.txt $*.script)
     74 
     75 
     76 #-----------------------------------------------------------------
     77 # this rule generates cmu6plus.ok.zip, which is built manually and checked in.
     78 # the grxml compiler expects this (and other) data files to be here.
     79 # $ g4 edit external/srec/config/en.us/dictionary/cmu6plus.ok.zip
     80 # $ make cmu6plus.ok.zip
     81 #
     82 # To make the resulting zip as small as possible, install advzip from
     83 # the advancecomp suite of compression utilities.  (On ubuntu,
     84 # "apt-get install advancecomp".)  It makes the output about 10% smaller.
     85 # This make rule will fall back to 'zip' if 'advzip' is not
     86 # available.
     87 #-----------------------------------------------------------------
     88 
     89 CMU2NUANCE=$(HOST_OUT_EXECUTABLES)/cmu2nuance
     90 DICT_DIR=$(ASR_ROOT_DIR)/config/en.us/dictionary
     91 
     92 cmu6plus.ok.zip: $(CMU2NUANCE) $(DICT_DIR)/c0.6 $(DICT_DIR)/numbers.ok $(DICT_DIR)/fixit.ok $(DICT_DIR)/enroll.ok
     93 	$(CMU2NUANCE) < $(DICT_DIR)/c0.6 > $(DICT_DIR)/c0.6.ok
     94 	sort -u $(DICT_DIR)/c0.6.ok $(DICT_DIR)/numbers.ok $(DICT_DIR)/fixit.ok $(DICT_DIR)/enroll.ok > $(DICT_DIR)/cmu6plus.ok
     95 	$(hide) (cd $(DICT_DIR)/ && advzip -a -4 cmu6plus.ok.zip cmu6plus.ok || \
     96 	 (zip cmu6plus.ok.zip cmu6plus.ok && \
     97           echo -e "\n+++ advzip not installed; fell back to zip\n    cmu6plus.ok.zip (`du -h cmu6plus.ok.zip | cut -f 1`) could be ~10% smaller with advzip\n"))
     98 
     99 
    100 
    101 #-----------------------------------------------------------------
    102 # build cmu2nuance dictionary conversion program, to prevent bitrot
    103 #-----------------------------------------------------------------
    104 
    105 LOCAL_SRC_FILES:= dictionary/cmu2nuance.cpp
    106 
    107 LOCAL_MODULE:= cmu2nuance
    108 
    109 include $(BUILD_HOST_EXECUTABLE)
    110 
    111