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