summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-02-19 15:44:36 +0800
committerPeng Wu <alexepico@gmail.com>2013-02-19 15:44:36 +0800
commit8280f39b9e4c765d50029c034d07f775900d1657 (patch)
tree8ffd6ff77ca1b3680164ba7091b7a2861cc92a14
parent46e6218e04b40b3fece89f752c8ac6334e5782d1 (diff)
downloadlibpinyin-8280f39b9e4c765d50029c034d07f775900d1657.zip
libpinyin-8280f39b9e4c765d50029c034d07f775900d1657.tar.gz
libpinyin-8280f39b9e4c765d50029c034d07f775900d1657.tar.xz
improves automake
-rw-r--r--data/Makefile.am22
-rw-r--r--utils/training/gen_unigram.cpp2
2 files changed, 12 insertions, 12 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 8a3f356..7b35dcd 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -16,23 +16,23 @@
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-textual_model_data = interpolation2.text \
- gb_char.table gbk_char.table \
+tablefiles = gb_char.table gbk_char.table \
merged.table \
art.table culture.table economy.table \
geology.table history.table life.table \
nature.table scitech.table \
society.table sport.table
+binfiles = ${tablefiles:.table=.bin}
+
+
+textual_model_data = interpolation2.text \
+ $(tablefiles)
+
-binary_model_data = gb_char.bin gbk_char.bin \
- phrase_index.bin pinyin_index.bin \
+binary_model_data = phrase_index.bin pinyin_index.bin \
bigram.db \
- merged.bin \
- art.bin culture.bin economy.bin \
- geology.bin history.bin life.bin \
- nature.bin scitech.bin \
- society.bin sport.bin
+ $(binfiles)
MAINTAINERCLEANFILES = Makefile.in
@@ -50,7 +50,7 @@ interpolation2.text:
tar xvf model2.text.tar.gz -C $(top_srcdir)/data
-gb_char.table gbk_char.table: interpolation2.text
+$(tablefiles): interpolation2.text
bigram.db: $(textual_model_data)
$(RM) $(binary_model_data)
@@ -58,7 +58,7 @@ bigram.db: $(textual_model_data)
../utils/storage/import_interpolation < $(top_srcdir)/data/interpolation2.text
../utils/training/gen_unigram
-gb_char.bin gbk_char.bin phrase_index.bin pinyin_index.bin: bigram.db
+phrase_index.bin pinyin_index.bin $(binfiles): bigram.db
rebuild:
git reset --hard
diff --git a/utils/training/gen_unigram.cpp b/utils/training/gen_unigram.cpp
index c47c6ca..e1a91fd 100644
--- a/utils/training/gen_unigram.cpp
+++ b/utils/training/gen_unigram.cpp
@@ -46,7 +46,7 @@ int main(int argc, char * argv[]){
bool retval = chunk->load(binfile);
if (!retval) {
fprintf(stderr, "load %s failed!\n", binfile);
- return false;
+ exit(ENOENT);
}
phrase_index.load(i, chunk);