| 1 |
## Makefile.am for Onigmo |
| 2 |
encdir = $(top_srcdir)/enc |
| 3 |
sampledir = $(top_srcdir)/sample |
| 4 |
libname = libonigmo.la |
| 5 |
|
| 6 |
PYTHON = @python_prog@ |
| 7 |
|
| 8 |
ACLOCAL_AMFLAGS = -I m4 |
| 9 |
AM_CFLAGS = -Wall |
| 10 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(includedir) -I$(encdir)/unicode |
| 11 |
|
| 12 |
SUBDIRS = . sample |
| 13 |
|
| 14 |
include_HEADERS = onigmo.h onigmognu.h onigmoposix.h |
| 15 |
lib_LTLIBRARIES = $(libname) |
| 16 |
|
| 17 |
libonigmo_la_SOURCES = regint.h regparse.h regenc.h st.h \ |
| 18 |
regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \ |
| 19 |
regenc.c regsyntax.c regtrav.c regversion.c st.c \ |
| 20 |
regposix.c regposerr.c \ |
| 21 |
$(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf_8.c \ |
| 22 |
$(encdir)/utf_16be.c $(encdir)/utf_16le.c \ |
| 23 |
$(encdir)/utf_32be.c $(encdir)/utf_32le.c \ |
| 24 |
$(encdir)/unicode/casefold.h $(encdir)/unicode/name2ctype.h \ |
| 25 |
$(encdir)/euc_jp.c $(encdir)/shift_jis.c $(encdir)/windows_31j.c \ |
| 26 |
$(encdir)/jis/props.h $(encdir)/jis/props.kwd \ |
| 27 |
$(encdir)/iso_8859.h $(encdir)/iso_8859_1.c \ |
| 28 |
$(encdir)/iso_8859_2.c $(encdir)/iso_8859_3.c \ |
| 29 |
$(encdir)/iso_8859_4.c $(encdir)/iso_8859_5.c \ |
| 30 |
$(encdir)/iso_8859_6.c $(encdir)/iso_8859_7.c \ |
| 31 |
$(encdir)/iso_8859_8.c $(encdir)/iso_8859_9.c \ |
| 32 |
$(encdir)/iso_8859_10.c $(encdir)/iso_8859_11.c \ |
| 33 |
$(encdir)/iso_8859_13.c $(encdir)/iso_8859_14.c \ |
| 34 |
$(encdir)/iso_8859_15.c $(encdir)/iso_8859_16.c \ |
| 35 |
$(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \ |
| 36 |
$(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/koi8_u.c \ |
| 37 |
$(encdir)/windows_1250.c $(encdir)/windows_1251.c \ |
| 38 |
$(encdir)/windows_1252.c $(encdir)/windows_1253.c \ |
| 39 |
$(encdir)/windows_1254.c $(encdir)/windows_1257.c |
| 40 |
|
| 41 |
libonigmo_la_LDFLAGS = -version-info $(LTVERSION) -no-undefined |
| 42 |
|
| 43 |
EXTRA_DIST = .gitignore onigmo.pc.in HISTORY README.ja README.md \ |
| 44 |
doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \ |
| 45 |
doc/UnicodeProps.txt \ |
| 46 |
tool/.gitignore tool/Makefile tool/case-folding.rb \ |
| 47 |
tool/convert-name2ctype.sh tool/convert-jis-props.sh \ |
| 48 |
tool/enc-unicode.rb tool/download-ucd.sh tool/update-doc.py \ |
| 49 |
win32/Makefile win32/Makefile.mingw win32/config.h win32/testc.c \ |
| 50 |
win32/makedef.py win32/onigmo.rc \ |
| 51 |
$(encdir)/mktable.c \ |
| 52 |
test.rb testconv.rb testconvu.rb \ |
| 53 |
onigmo.py testpy.py .editorconfig |
| 54 |
|
| 55 |
bin_SCRIPTS = onigmo-config |
| 56 |
|
| 57 |
onigmo-config: onigmo-config.in |
| 58 |
|
| 59 |
do_subst = sed \ |
| 60 |
-e 's,[@]datadir[@],$(datadir),g' \ |
| 61 |
-e 's,[@]datarootdir[@],$(datarootdir),g' \ |
| 62 |
-e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ |
| 63 |
-e 's,[@]prefix[@],$(prefix),g' \ |
| 64 |
-e 's,[@]exec_prefix[@],$(exec_prefix),g' \ |
| 65 |
-e 's,[@]libdir[@],$(libdir),g' \ |
| 66 |
-e 's,[@]includedir[@],$(includedir),g' |
| 67 |
|
| 68 |
onigmo.pc: $(srcdir)/onigmo.pc.in Makefile |
| 69 |
$(do_subst) < $(srcdir)/onigmo.pc.in > $(@) |
| 70 |
|
| 71 |
pkgconfigdir = $(libdir)/pkgconfig |
| 72 |
pkgconfig_DATA = onigmo.pc |
| 73 |
CLEANFILES = onigmo.pc |
| 74 |
|
| 75 |
# character-types-table source generator |
| 76 |
mktable: $(encdir)/mktable.c $(srcdir)/regenc.h |
| 77 |
$(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.c |
| 78 |
|
| 79 |
|
| 80 |
# TEST |
| 81 |
TESTS = testc testp testcu |
| 82 |
|
| 83 |
check_PROGRAMS = testc testp testcu |
| 84 |
|
| 85 |
test: atest pytest |
| 86 |
$(MAKE) -C sample test |
| 87 |
|
| 88 |
atest: testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT) |
| 89 |
@echo "[Onigmo API, ASCII/EUC-JP check]" |
| 90 |
@$(top_builddir)/testc | grep RESULT |
| 91 |
@echo "[POSIX API, ASCII/EUC-JP check]" |
| 92 |
@$(top_builddir)/testp | grep RESULT |
| 93 |
@echo "[Onigmo API, UTF-16 check]" |
| 94 |
@$(top_builddir)/testcu | grep RESULT |
| 95 |
|
| 96 |
testc_SOURCES = testc.c |
| 97 |
testc_LDADD = libonigmo.la |
| 98 |
|
| 99 |
testp_SOURCES = testc.c |
| 100 |
testp_LDADD = libonigmo.la |
| 101 |
testp_CFLAGS = -DPOSIX_TEST |
| 102 |
|
| 103 |
testcu_SOURCES = testu.c |
| 104 |
testcu_LDADD = libonigmo.la |
| 105 |
|
| 106 |
|
| 107 |
#$(srcdir)/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb |
| 108 |
$(srcdir)/testc.c: |
| 109 |
ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@ |
| 110 |
|
| 111 |
#$(srcdir)/testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb |
| 112 |
$(srcdir)/testu.c: |
| 113 |
ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@ |
| 114 |
|
| 115 |
#$(srcdir)/win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb |
| 116 |
$(srcdir)/win32/testc.c: |
| 117 |
ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | iconv -f euc-jp -t cp932 | sed -e "s/$$/\r/" > $@ |
| 118 |
|
| 119 |
# Python TEST |
| 120 |
pytest: |
| 121 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py EUC-JP |
| 122 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py SJIS |
| 123 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-8 |
| 124 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16LE |
| 125 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16BE |
| 126 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32LE |
| 127 |
LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32BE |
| 128 |
|
| 129 |
|
| 130 |
# lcov |
| 131 |
|
| 132 |
# Collect coverage data and write to coverage.info, then create HTML output |
| 133 |
# in the coverage directory. |
| 134 |
lcov: |
| 135 |
if [ ! -f $(builddir)/enc/jis/props.kwd ]; then mkdir -p $(builddir)/enc/jis; cp $(srcdir)/enc/jis/props.kwd $(builddir)/enc/jis/props.kwd; fi |
| 136 |
lcov -c -d .libs -o coverage.info |
| 137 |
genhtml -o coverage coverage.info |
| 138 |
|
| 139 |
# Clear coverage data. |
| 140 |
lcov-clear: |
| 141 |
lcov -d . -z |
| 142 |
|
| 143 |
## END OF FILE |