summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-05 16:37:28 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-05 16:46:57 +0800
commit0572b575851a7c7055ae10b7c22d072fe685c5be (patch)
tree50d805a5419833675e5b608181ca70956be51e6b
parent237bd7b076ec9df92e6fdf021a34bf6ef811ae1b (diff)
downloadlibpinyin-0572b575851a7c7055ae10b7c22d072fe685c5be.tar.gz
libpinyin-0572b575851a7c7055ae10b7c22d072fe685c5be.tar.xz
libpinyin-0572b575851a7c7055ae10b7c22d072fe685c5be.zip
add data subdir
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.data8
-rw-r--r--configure.ac1
-rw-r--r--data/Makefile.am43
4 files changed, 47 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 4762363..607020a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
EXTRA_DIST = COPYING
AUTOMAKE_OPTIONS = gnu
-SUBDIRS = src utils tests
+SUBDIRS = src utils tests libltdl data
MAINTAINERCLEANFILES = Makefile.in
diff --git a/Makefile.data b/Makefile.data
index 473a375..3cb9f4a 100644
--- a/Makefile.data
+++ b/Makefile.data
@@ -1,12 +1,8 @@
-CLEANUP_FILES = bigram.db gb_char.bin gbk_char.bin \
- phrase_index.bin pinyin_index.bin
-
clean:
- cd data ; $(RM) $(CLEANUP_FILES) ; cd "$(CURDIR)"
+ make -C data clean
build:
- cd utils/storage ; ./gen_binary_files ; cd "$(CURDIR)"
- cd utils/storage ; ./import_interpolation < ../../data/interpolation.text ; cd "$(CURDIR)"
+ make -C data build-data
rebuild:
git reset --hard
diff --git a/configure.ac b/configure.ac
index 763c264..7df5d55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,7 @@ AC_SEARCH_LIBS([db_create], [db], [], AC_MSG_ERROR([Cannot find Berkeley DB libr
AC_CONFIG_FILES([libpinyin.pc
Makefile
+ data/Makefile
src/Makefile
src/include/Makefile
src/storage/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..a9dab88
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,43 @@
+## Makefile.am -- Process this file with automake to produce Makefile.in
+## Copyright (C) 2011 Peng Wu
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+textual_model_data = interpolation.text \
+ gb_char.table gbk_char.table
+
+binary_model_data = gb_char.bin gbk_char.bin \
+ phrase_index.bin pinyin_index.bin \
+ bigram.db
+
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST = $(textual_model_data) \
+ $(binary_model_data)
+
+libpinyin_db_DATA = $(binary_model_data)
+
+libpinyin_dbdir = $(pkgdatadir)/data
+
+CLEANFILES = $(binary_model_data)
+
+build-data: $(textual_model_data)
+ $(RM) $(binary_model_data)
+ cd ../utils/storage ; ./gen_binary_files ; cd -
+ cd ../utils/storage ; ./import_interpolation < ../../data/interpolation.text ; cd -
+
+$(binary_model_data): build-data