chiark / gitweb /
configure.ac, Makefile.am, pcre.c, regexp.c: Overhaul conditional building.
[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
MW
33LDADD =
34if HAVE_PCRE
35 LDADD += $(PCRE_LIBS)
36endif
37
0279756e
MW
38###--------------------------------------------------------------------------
39### Making substitutions.
40
41confsubst = $(top_srcdir)/config/confsubst
42V_SUBST = $(V_SUBST_$(V))
43V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
44V_SUBST_0 = @echo " SUBST $@";
45SUBST = $(V_SUBST)$(confsubst)
46SUBSTITUTIONS = \
47 PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
48 DICTIONARY=$(DICTIONARY) \
49 WISH=$(WISH) \
50 ANAG=$(bindir)/anag
51
52EXTRA_DIST += config/confsubst
53
54###--------------------------------------------------------------------------
55### Main program.
56
57bin_PROGRAMS += anag
58anag_SOURCES = anag.c anag.h util.c
59anag_SOURCES += anagram.c
60anag_SOURCES += longest.c
61anag_SOURCES += mono.c
7c2b74ab
MW
62if HAVE_PCRE
63 anag_SOURCES += pcre.c
64endif
65if HAVE_REGCOMP
66 anag_SOURCES += regexp.c
67endif
0279756e
MW
68anag_SOURCES += trackword.c
69anag_SOURCES += wildcard.c
70
71###--------------------------------------------------------------------------
72### Java frontend.
0484a0d9 73
0279756e
MW
74JAVAC = @JAVAC@
75SUFFIXES += .java .class
76CLEANFILES += *.class *.jar
77V_JAVAC = $(V_JAVAC_$(V))
78V_JAVAC_ = $(V_JAVAC_$(AM_DEFAULT_VERBOSITY))
79V_JAVAC_0 = @echo " JAVAC $@";
80V_JAR = $(V_JAR_$(V))
81V_JAR_ = $(V_JAR_$(AM_DEFAULT_VERBOSITY))
82V_JAR_0 = @echo " JAR $@";
83.java.class:; $(V_JAVAC)$(JAVAC) -d . $(JAVACFLAGS) $<
dc460403 84
0279756e 85javadir = $(datadir)/java
6e403221 86
0279756e
MW
87if HAVE_JAVAC
88java_DATA = anag.jar
89endif
e439a998 90
0279756e
MW
91EXTRA_DIST += anag.manifest
92EXTRA_DIST += AnagGUI.java
dc460403 93anag.jar: AnagGUI.class
0279756e
MW
94 $(V_JAR)jar cfm $@ $(srcdir)/anag.manifest *.class
95
96###--------------------------------------------------------------------------
97### Tcl/Tk frontend.
98
99if HAVE_WISH
100bin_SCRIPTS += anag-gui
101endif
102
103EXTRA_DIST += anag-gui.in
104CLEANFILES += anag-gui
105
106anag-gui: anag-gui.in Makefile
107 $(SUBST) $(srcdir)/anag-gui.in >$@.new $(SUBSTITUTIONS) && \
108 chmod +x $@.new && mv $@.new $@
f7ebae38 109
0279756e
MW
110###--------------------------------------------------------------------------
111### Distribution arrangements.
112
113## Version number tracking.
114dist-hook:
115 echo $(VERSION) >$(distdir)/RELEASE
116
117EXTRA_DIST += config/auto-version
118
119## Zip file for DOSish platforms.
f7ebae38 120doszip: distdir
121 rm -f $(PACKAGE).zip
122 zip -qlr $(PACKAGE).zip $(distdir)
123 rm -rf $(distdir)
dc460403 124
0279756e
MW
125## Debian packaging.
126EXTRA_DIST += debian/control debian/changelog debian/copyright
127EXTRA_DIST += debian/rules debian/compat debian/source/format
128EXTRA_DIST += debian/anag.install
129EXTRA_DIST += debian/anag-gui-java.install
130EXTRA_DIST += debian/anag-gui-java.postinst
131EXTRA_DIST += debian/anag-gui-java.prerm
132EXTRA_DIST += debian/anag-gui.java
133EXTRA_DIST += debian/anag-gui-tk.install
134EXTRA_DIST += debian/anag-gui-tk.postinst
135EXTRA_DIST += debian/anag-gui-tk.prerm
dc460403 136
6e403221 137##----- That's all, folks ---------------------------------------------------