summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2018-06-06 14:17:15 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2018-06-06 15:13:40 +0900
commit08b34532dfc2681575329df8042e20a4c3360bd1 (patch)
tree8cdb1467c1898d37a31367b428639aafd37258d3
parent1b70b5cef901166f01d3a411191d0a493463dd67 (diff)
downloadlibhangul-08b34532dfc2681575329df8042e20a4c3360bd1.tar.gz
doc: builddir과 srcdir이 다른 경우에도 빌드되게 함
Makefile을 자동으로 업데이트하고 빌드되게 하려면 Makefile.am으로 처리하는 편이 편리한 것 같다.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--doc/Doxyfile.in14
-rw-r--r--doc/Makefile11
-rw-r--r--doc/Makefile.am28
-rwxr-xr-xdoc/gen_hangulkeyboards.py3
6 files changed, 39 insertions, 20 deletions
diff --git a/Makefile.am b/Makefile.am
index c8a416b..c85f681 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS = hangul data tools po
-DIST_SUBDIRS = hangul data tools po test
+DIST_SUBDIRS = hangul data tools po test doc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libhangul.pc
diff --git a/configure.ac b/configure.ac
index d49ad63..80ee216 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,7 @@ data/Makefile
data/hanja/Makefile
data/keyboards/Makefile
doc/Doxyfile
+doc/Makefile
hangul/Makefile
libhangul.pc
po/Makefile.in
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 1fdd062..19c7c59 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -450,13 +450,13 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ../hangul/hangul.h \
- ../hangul/hangulctype.c \
- ../hangul/hangulinputcontext.c \
- ../hangul/hangulkeyboard.c \
- ../hangul/hanja.c \
- mainpage.dox \
- hangulkeyboards.dox
+INPUT = @top_srcdir@/hangul/hangul.h \
+ @top_srcdir@/hangul/hangulctype.c \
+ @top_srcdir@/hangul/hangulinputcontext.c \
+ @top_srcdir@/hangul/hangulkeyboard.c \
+ @top_srcdir@/hangul/hanja.c \
+ @srcdir@/mainpage.dox \
+ @builddir@/hangulkeyboards.dox
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 1db3dbf..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-doc: Doxyfile hangulkeyboards.dox
- doxygen
-
-hangulkeyboards.dox: gen_hangulkeyboards.py
- ./gen_hangulkeyboards.py > $@
-
-Doxyfile: Doxyfile.in
- cd .. && ./config.status doc/$@
-
-clean:
- rm -rf html
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..5bfcc8a
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,28 @@
+# libhangul
+# Copyright (C) 2018 Choe Hwanjin
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+.DELETE_ON_ERROR:
+
+doc: Doxyfile hangulkeyboards.dox
+ doxygen Doxyfile
+
+hangulkeyboards.dox: gen_hangulkeyboards.py ../hangul/hangulkeyboard.h
+ $(srcdir)/gen_hangulkeyboards.py $(top_srcdir)/hangul/hangulkeyboard.h > $@
+
+clean-local:
+ -rm -f hangulkeyboards.dox
+ -rm -rf html
diff --git a/doc/gen_hangulkeyboards.py b/doc/gen_hangulkeyboards.py
index 4176c81..701b0cb 100755
--- a/doc/gen_hangulkeyboards.py
+++ b/doc/gen_hangulkeyboards.py
@@ -8,7 +8,7 @@ table = {}
current_name = ''
current_table = []
-src = open('../hangul/hangulkeyboard.h', 'r')
+src = open(sys.argv[1], 'r')
for i in src.readlines():
pos = i.find('hangul_keyboard_table_')
if pos >= 0:
@@ -27,6 +27,7 @@ for i in src.readlines():
if len(current_name) > 0:
code = int(i.split()[0].replace(',', ''), 16)
current_table.append(code)
+src.close()
def jamo_to_compat_jamo(code):
table = [