]> granicus.if.org Git - onig/blob - Makefile.am
apply patch from Giulio Paci
[onig] / Makefile.am
1 ## Makefile.am for Oniguruma
2 encdir    = $(top_srcdir)/enc
3 sampledir = $(top_srcdir)/sample
4 libname = libonig.la
5
6 ACLOCAL_AMFLAGS = -I m4
7 #AM_CFLAGS = -DNOT_RUBY
8 AM_CFLAGS =
9 INCLUDES  = -I$(top_srcdir) -I$(includedir)
10
11 SUBDIRS = . sample
12
13 include_HEADERS = oniguruma.h oniggnu.h onigposix.h
14 lib_LTLIBRARIES = $(libname)
15
16 libonig_la_SOURCES = regint.h regparse.h regenc.h st.h \
17         regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \
18         regenc.c regsyntax.c regtrav.c regversion.c st.c \
19         regposix.c regposerr.c \
20         $(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf8.c \
21         $(encdir)/utf16_be.c $(encdir)/utf16_le.c \
22         $(encdir)/utf32_be.c $(encdir)/utf32_le.c \
23         $(encdir)/euc_jp.c $(encdir)/sjis.c $(encdir)/iso8859_1.c \
24         $(encdir)/iso8859_2.c  $(encdir)/iso8859_3.c \
25         $(encdir)/iso8859_4.c  $(encdir)/iso8859_5.c \
26         $(encdir)/iso8859_6.c  $(encdir)/iso8859_7.c \
27         $(encdir)/iso8859_8.c  $(encdir)/iso8859_9.c \
28         $(encdir)/iso8859_10.c $(encdir)/iso8859_11.c \
29         $(encdir)/iso8859_13.c $(encdir)/iso8859_14.c \
30         $(encdir)/iso8859_15.c $(encdir)/iso8859_16.c \
31         $(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \
32         $(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/cp1251.c
33
34 libonig_la_LDFLAGS = -version-info $(LTVERSION)
35
36 EXTRA_DIST = HISTORY README.ja index.html index_ja.html \
37         doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \
38         win32/Makefile win32/config.h win32/testc.c \
39         $(encdir)/koi8.c $(encdir)/mktable.c \
40         $(sampledir)/encode.c $(sampledir)/listcap.c $(sampledir)/names.c \
41         $(sampledir)/posix.c $(sampledir)/simple.c $(sampledir)/sql.c \
42         $(sampledir)/syntax.c
43
44 bin_SCRIPTS = onig-config
45
46 onig-config: onig-config.in
47
48 do_subst = sed                                          \
49       -e 's,[@]datadir[@],$(datadir),g'                 \
50       -e 's,[@]datarootdir[@],$(datarootdir),g'         \
51       -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
52       -e 's,[@]prefix[@],$(prefix),g'                   \
53       -e 's,[@]exec_prefix[@],$(exec_prefix),g'         \
54       -e 's,[@]libdir[@],$(libdir),g'                   \
55       -e 's,[@]includedir[@],$(includedir),g'
56
57 oniguruma.pc: $(srcdir)/oniguruma.pc.in Makefile
58         $(do_subst) < $(<) > $(@)
59
60 pkgconfigdir   = $(libdir)/pkgconfig
61 pkgconfig_DATA = onig.pc
62
63 dll:
64         $(CXX) -shared -Wl,--output-def,libonig.def -o libonig.dll *.o \
65         $(LIBS)
66         strip libonig.dll
67
68 # Ruby TEST
69 rtest:
70         $(RUBYDIR)/ruby -w -Ke $(srcdir)/test.rb
71
72 # character-types-table source generator
73 mktable: $(encdir)/mktable.c $(srcdir)/regenc.h
74         $(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.c
75
76
77 # TEST
78 TESTS = testc testp testcu
79
80 check_PROGRAMS = testc testp testcu
81
82 atest: testc testp testcu
83         @echo "[Oniguruma API, ASCII/EUC-JP check]"
84         @$(top_builddir)/testc  | grep RESULT
85         @echo "[POSIX API, ASCII/EUC-JP check]"
86         @$(top_builddir)/testp  | grep RESULT
87         @echo "[Oniguruma API, UTF-16 check]"
88         @$(top_builddir)/testcu | grep RESULT
89
90 testc_SOURCES = testc.c
91 testc_LDADD = libonig.la
92
93 testp_SOURCES = testc.c
94 testp_LDADD = libonig.la
95 testp_CFLAGS = -DPOSIX_TEST
96
97 testcu_SOURCES = testu.c
98 testcu_LDADD = libonig.la
99
100
101 #testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb
102 #       ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@
103
104 #testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb
105 #       ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@
106
107 #win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb
108 #       ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | nkf -cs > $@
109
110 ## END OF FILE