pcre.c, etc.: Support the PCRE2 library.
[anag] / Makefile.am
CommitLineData
0279756e
MW
1### -*-makefile-*-
2###
3### Build script for `anag'
4###
5### (c) 2001, 2016 Mark Wooding
6###
0484a0d9 7
0279756e
MW
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of Anag: a simple wordgame helper.
11###
12### Anag is free software; you can redistribute it and/or modify
13### it under the terms of the GNU General Public License as published by
14### the Free Software Foundation; either version 2 of the License, or
15### (at your option) any later version.
16###
17### Anag is distributed in the hope that it will be useful,
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU General Public License for more details.
21###
22### You should have received a copy of the GNU General Public License
23### along with Anag; if not, write to the Free Software Foundation,
24### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26EXTRA_DIST =
27CLEANFILES =
28SUFFIXES =
29
30bin_PROGRAMS =
31bin_SCRIPTS =
32
7c2b74ab 33LDADD =
650bb9da
MW
34if HAVE_PCRE2
35 LDADD += $(PCRE2_LIBS)
36else
7c2b74ab
MW
37if HAVE_PCRE
38 LDADD += $(PCRE_LIBS)
39endif
650bb9da 40endif
7c2b74ab 41
0279756e
MW
42###--------------------------------------------------------------------------
43### Making substitutions.
44
45confsubst = $(top_srcdir)/config/confsubst
46V_SUBST = $(V_SUBST_$(V))
47V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
48V_SUBST_0 = @echo " SUBST $@";
49SUBST = $(V_SUBST)$(confsubst)
50SUBSTITUTIONS = \
51 PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
52 DICTIONARY=$(DICTIONARY) \
53 WISH=$(WISH) \
54 ANAG=$(bindir)/anag
55
56EXTRA_DIST += config/confsubst
57
58###--------------------------------------------------------------------------
59### Main program.
60
61bin_PROGRAMS += anag
62anag_SOURCES = anag.c anag.h util.c
63anag_SOURCES += anagram.c
64anag_SOURCES += longest.c
65anag_SOURCES += mono.c
650bb9da 66if HAVE_PCRE2
7c2b74ab 67 anag_SOURCES += pcre.c
650bb9da
MW
68else
69if HAVE_PCRE
70 anag_SOURCES += pcre.c
71endif
7c2b74ab
MW
72endif
73if HAVE_REGCOMP
74 anag_SOURCES += regexp.c
75endif
0279756e
MW
76anag_SOURCES += trackword.c
77anag_SOURCES += wildcard.c
78
79###--------------------------------------------------------------------------
80### Java frontend.
0484a0d9 81
0279756e
MW
82JAVAC = @JAVAC@
83SUFFIXES += .java .class
84CLEANFILES += *.class *.jar
85V_JAVAC = $(V_JAVAC_$(V))
86V_JAVAC_ = $(V_JAVAC_$(AM_DEFAULT_VERBOSITY))
87V_JAVAC_0 = @echo " JAVAC $@";
88V_JAR = $(V_JAR_$(V))
89V_JAR_ = $(V_JAR_$(AM_DEFAULT_VERBOSITY))
90V_JAR_0 = @echo " JAR $@";
91.java.class:; $(V_JAVAC)$(JAVAC) -d . $(JAVACFLAGS) $<
dc460403 92
0279756e 93javadir = $(datadir)/java
6e403221 94
0279756e
MW
95if HAVE_JAVAC
96java_DATA = anag.jar
97endif
e439a998 98
0279756e
MW
99EXTRA_DIST += anag.manifest
100EXTRA_DIST += AnagGUI.java
dc460403 101anag.jar: AnagGUI.class
0279756e
MW
102 $(V_JAR)jar cfm $@ $(srcdir)/anag.manifest *.class
103
104###--------------------------------------------------------------------------
105### Tcl/Tk frontend.
106
107if HAVE_WISH
108bin_SCRIPTS += anag-gui
109endif
110
111EXTRA_DIST += anag-gui.in
112CLEANFILES += anag-gui
113
114anag-gui: anag-gui.in Makefile
115 $(SUBST) $(srcdir)/anag-gui.in >$@.new $(SUBSTITUTIONS) && \
116 chmod +x $@.new && mv $@.new $@
f7ebae38 117
0279756e
MW
118###--------------------------------------------------------------------------
119### Distribution arrangements.
120
121## Version number tracking.
122dist-hook:
123 echo $(VERSION) >$(distdir)/RELEASE
124
125EXTRA_DIST += config/auto-version
126
127## Zip file for DOSish platforms.
f7ebae38 128doszip: distdir
129 rm -f $(PACKAGE).zip
130 zip -qlr $(PACKAGE).zip $(distdir)
131 rm -rf $(distdir)
dc460403 132
0279756e
MW
133## Debian packaging.
134EXTRA_DIST += debian/control debian/changelog debian/copyright
135EXTRA_DIST += debian/rules debian/compat debian/source/format
136EXTRA_DIST += debian/anag.install
137EXTRA_DIST += debian/anag-gui-java.install
138EXTRA_DIST += debian/anag-gui-java.postinst
139EXTRA_DIST += debian/anag-gui-java.prerm
140EXTRA_DIST += debian/anag-gui.java
141EXTRA_DIST += debian/anag-gui-tk.install
142EXTRA_DIST += debian/anag-gui-tk.postinst
143EXTRA_DIST += debian/anag-gui-tk.prerm
dc460403 144
6e403221 145##----- That's all, folks ---------------------------------------------------