| 1 |
# |
| 2 |
# $Id: Makefile,v 1.129 2022-03-11 00:46:51-08 geoff Exp $ |
| 3 |
# |
| 4 |
# Copyright 1992, 1993, 1999, 2001, 2005, Geoff Kuenning, Claremont, CA |
| 5 |
# All rights reserved. |
| 6 |
# |
| 7 |
# Redistribution and use in source and binary forms, with or without |
| 8 |
# modification, are permitted provided that the following conditions |
| 9 |
# are met: |
| 10 |
# |
| 11 |
# 1. Redistributions of source code must retain the above copyright |
| 12 |
# notice, this list of conditions and the following disclaimer. |
| 13 |
# 2. Redistributions in binary form must reproduce the above copyright |
| 14 |
# notice, this list of conditions and the following disclaimer in the |
| 15 |
# documentation and/or other materials provided with the distribution. |
| 16 |
# 3. All modifications to the source code must be clearly marked as |
| 17 |
# such. Binary redistributions based on modified source code |
| 18 |
# must be clearly marked as modified versions in the documentation |
| 19 |
# and/or other materials provided with the distribution. |
| 20 |
# 4. The code that causes the 'ispell -v' command to display a prominent |
| 21 |
# link to the official ispell Web site may not be removed. |
| 22 |
# 5. The name of Geoff Kuenning may not be used to endorse or promote |
| 23 |
# products derived from this software without specific prior |
| 24 |
# written permission. |
| 25 |
# |
| 26 |
# THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND |
| 27 |
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 28 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 29 |
# ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE |
| 30 |
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 31 |
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 32 |
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 33 |
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 34 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 35 |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 36 |
# SUCH DAMAGE. |
| 37 |
# |
| 38 |
# You will have to create a local.h file before building; look over |
| 39 |
# config.X to learn what things you may need to define, or use one of |
| 40 |
# the sample local.h files shipped. |
| 41 |
# |
| 42 |
# the argument syntax for buildhash to make alternate dictionary files |
| 43 |
# is simply: |
| 44 |
# |
| 45 |
# buildhash <dictfile> <affix-file> <outfile> |
| 46 |
|
| 47 |
# $Log: Makefile,v $ |
| 48 |
# Revision 1.129 2022-03-11 00:46:51-08 geoff |
| 49 |
# Make ispell.1 depend on version.h |
| 50 |
# |
| 51 |
# Revision 1.128 2018-01-18 22:50:11-08 geoff |
| 52 |
# When symlinking DEFHASH, don't use DESTDIR (DESTDIR is specified to be |
| 53 |
# a temporary before files are moved to a final location, so the symlink |
| 54 |
# should reference the eventual installation location). |
| 55 |
# |
| 56 |
# Revision 1.127 2015-02-08 01:10:54-08 geoff |
| 57 |
# Support DESTDIR. |
| 58 |
# |
| 59 |
# Revision 1.126 2015-02-08 00:44:20-08 geoff |
| 60 |
# During installation, make sure we don't accidentally get stuck in BINDIR. |
| 61 |
# |
| 62 |
# Revision 1.125 2005/09/06 06:31:32 geoff |
| 63 |
# In the "doedit" dependency, pick out the ispell version and make it |
| 64 |
# available to edited files. |
| 65 |
# |
| 66 |
# Revision 1.124 2005/05/25 13:56:32 geoff |
| 67 |
# Make language subdirectories in reverse order so that the English |
| 68 |
# makefiles can install a default dictionary linked to the first-mentioned |
| 69 |
# language. |
| 70 |
# |
| 71 |
# Revision 1.123 2005/05/25 13:22:33 geoff |
| 72 |
# Bug fix: make sure HASHSUFFIX set before using it during installation. |
| 73 |
# |
| 74 |
# Revision 1.122 2005/05/01 23:19:12 geoff |
| 75 |
# Make constructed files depend on the Makefile |
| 76 |
# |
| 77 |
# Revision 1.121 2005/05/01 23:07:59 geoff |
| 78 |
# Add EXTEXT usage (courtesy of Eli Zaretskii). |
| 79 |
# |
| 80 |
# Revision 1.120 2005/05/01 22:35:00 geoff |
| 81 |
# Get rid of references to fixispell-a in the installation process (but |
| 82 |
# blow away any previously installed copies). Add BAKEXT to the stuff |
| 83 |
# that's in config.sh and that's substituted when editing .X files. |
| 84 |
# Sort the list of edit substitutions. When generating DEFHASH, use the |
| 85 |
# configurable has suffix. |
| 86 |
# |
| 87 |
# Revision 1.119 2005/04/28 01:03:11 geoff |
| 88 |
# Improve the generation of defhash.h to set up DEFLANG and to allow all |
| 89 |
# definitions to be overridden by local.h. Clean up defhash.h in "make |
| 90 |
# clean". |
| 91 |
# |
| 92 |
# Revision 1.118 2005/04/28 00:26:06 geoff |
| 93 |
# Dynamically generate MASTERHASH and DEFHASH from the first dictionary |
| 94 |
# name specified in LANGUAGES. |
| 95 |
# |
| 96 |
# Revision 1.117 2005/04/27 01:18:34 geoff |
| 97 |
# Work around idiotic POSIX incompatibilies in tail. Proactively use |
| 98 |
# the -e switch to sed against the day when they decide to make sed |
| 99 |
# incompatible as well. |
| 100 |
# |
| 101 |
# Revision 1.116 2005/04/21 14:08:58 geoff |
| 102 |
# Insert a missing "silencing at". Change the name of the sample |
| 103 |
# local.h file. |
| 104 |
# |
| 105 |
# Revision 1.115 2005/04/14 15:19:37 geoff |
| 106 |
# Fix typos in the special term.o rule. |
| 107 |
# |
| 108 |
# Revision 1.114 2005/04/14 14:38:23 geoff |
| 109 |
# Update license. Integrate Ed Avis's changes. Add fixispell-a (broken |
| 110 |
# though it is). Generate ispell.5 dynamically. Put term.o first to |
| 111 |
# improve detection of misconfigurations, and generate a special message |
| 112 |
# if it won't compile. Play funny games with y.tab.c to deal with |
| 113 |
# MS-DOS stupidity. |
| 114 |
# |
| 115 |
# Revision 1.113 2002/06/20 23:46:15 geoff |
| 116 |
# Put sq/unsq back, since some dictionaries are still distributed in sq |
| 117 |
# format. Add code to make directory paths when necessary. |
| 118 |
# |
| 119 |
# Revision 1.112 2001/09/06 00:30:28 geoff |
| 120 |
# Many changes from Eli Zaretskii to support DJGPP compilation. |
| 121 |
# |
| 122 |
# Revision 1.111 2001/07/25 21:51:45 geoff |
| 123 |
# Minor license update. |
| 124 |
# |
| 125 |
# Revision 1.110 2001/07/23 20:24:02 geoff |
| 126 |
# Update the copyright and the license. |
| 127 |
# |
| 128 |
# Revision 1.109 2001/06/07 19:06:33 geoff |
| 129 |
# When creating local.h, make it user-writable. |
| 130 |
# |
| 131 |
# Revision 1.108 2001/06/07 08:02:18 geoff |
| 132 |
# Add the deformatters to the default dependencies. |
| 133 |
# |
| 134 |
# Revision 1.107 1999/01/13 01:34:15 geoff |
| 135 |
# Get rid of some leftover references to emacs stuff. |
| 136 |
# |
| 137 |
# Revision 1.106 1999/01/08 04:32:31 geoff |
| 138 |
# Don't try to build or install ispell.el and ispell.info. |
| 139 |
# |
| 140 |
# Revision 1.105 1999/01/07 01:22:29 geoff |
| 141 |
# Update the copyright. Get rid of old shar-based dictionary building. |
| 142 |
# |
| 143 |
# Revision 1.104 1995/11/08 05:09:06 geoff |
| 144 |
# When invoking "showversion", ignore any errors that happen. Fix a |
| 145 |
# place where I forgot to double a dollar sign in install-languages. |
| 146 |
# |
| 147 |
# Revision 1.103 1995/10/25 03:35:38 geoff |
| 148 |
# Don't assume the presence of "head" in the showversion dependency; use |
| 149 |
# old reliable sed instead. Also make showversion depend on ispell |
| 150 |
# itself, since it uses it. |
| 151 |
# |
| 152 |
# Revision 1.102 1995/10/11 04:30:25 geoff |
| 153 |
# Allow DEFHASH and MASTERHASH to be the same. |
| 154 |
# |
| 155 |
# Revision 1.101 1995/08/05 23:19:33 geoff |
| 156 |
# Add the showversion target to ease the job of debugging people's make |
| 157 |
# output. Make sure SHELLDEBUG is set for the entire process of making |
| 158 |
# config.sh. |
| 159 |
# |
| 160 |
# Revision 1.100 1995/03/06 02:42:39 geoff |
| 161 |
# Run iwhich explicitly from the shell, so that we don't have to worry |
| 162 |
# about PATH problems and whether it's executable or not. Also fix a |
| 163 |
# place where -nw was not removed from the batch emacs switch list. |
| 164 |
# |
| 165 |
# Revision 1.99 1995/01/08 23:23:23 geoff |
| 166 |
# Get rid of an obsolete etags flag. Add some new variables to config.sh. |
| 167 |
# |
| 168 |
# Revision 1.98 1994/12/27 23:08:43 geoff |
| 169 |
# Use the new "iwhich" script to decide whether to install emacs-related |
| 170 |
# stuff. Make correct.o depend on version.h so that "ispell -a" always |
| 171 |
# reports the correct version. |
| 172 |
# |
| 173 |
# Revision 1.97 1994/11/21 07:02:51 geoff |
| 174 |
# Specify default values for the BUILD macros, so that some systems |
| 175 |
# don't accidentally override them and make ispell think that the |
| 176 |
# dictionaries are missing. |
| 177 |
# |
| 178 |
# Revision 1.96 1994/10/25 05:45:54 geoff |
| 179 |
# Make the installation command configurable. |
| 180 |
# |
| 181 |
# Revision 1.95 1994/10/18 04:03:17 geoff |
| 182 |
# Get rid of DICTVARIANTS, which is obsolete. Compile term.o first, so |
| 183 |
# that errors in it (which are common) will show up first. Improve the |
| 184 |
# rules for generation of msgs.h. |
| 185 |
# |
| 186 |
# Revision 1.94 1994/09/16 05:06:55 geoff |
| 187 |
# Split installation up into basic and dictionary-building tools, so |
| 188 |
# that we can have a partial-install target. |
| 189 |
# |
| 190 |
# Revision 1.93 1994/09/16 04:51:28 geoff |
| 191 |
# Handle installations that have ELISPDIR but not TEXINFODIR |
| 192 |
# |
| 193 |
# Revision 1.92 1994/09/16 02:45:52 geoff |
| 194 |
# Don't strip non-binaries. Fix an accidentally-doubled backslash. |
| 195 |
# |
| 196 |
# Revision 1.91 1994/08/31 05:58:27 geoff |
| 197 |
# Strip binaries before installing them. Create directories before |
| 198 |
# installing into them. Make sure manual pages are installed with the |
| 199 |
# correct protection modes. |
| 200 |
# |
| 201 |
# Revision 1.90 1994/05/25 04:29:16 geoff |
| 202 |
# Don't remove english.4 after the English makefile has carefully |
| 203 |
# installed it. |
| 204 |
# |
| 205 |
# Revision 1.89 1994/05/24 05:31:22 geoff |
| 206 |
# Return to the old sed-based method of parsing LANGUAGES, so that things |
| 207 |
# will work on broken systems like BSDI. |
| 208 |
# |
| 209 |
# Revision 1.88 1994/05/24 04:54:30 geoff |
| 210 |
# Fix the emacs installation to use emacs batch mode properly, so that a |
| 211 |
# terminal isn't required. |
| 212 |
# |
| 213 |
# Revision 1.87 1994/03/21 01:55:17 geoff |
| 214 |
# If a hard link can't be made to msgs.h, copy it instead |
| 215 |
# |
| 216 |
# Revision 1.86 1994/02/22 06:09:03 geoff |
| 217 |
# Add SHELLDEBUG. Change the language-subdirs target to use the shell |
| 218 |
# IFS variable to parse things, simplifying things and improving |
| 219 |
# efficiency (thanks to Hagen Ross for the idea and implemenation). |
| 220 |
# |
| 221 |
# Revision 1.85 1994/02/13 23:25:31 geoff |
| 222 |
# Fix multiple-language processing to not pass subsequent specifications to |
| 223 |
# the first Makefile. Also fix the language shell loop to be more flexible. |
| 224 |
# |
| 225 |
# Revision 1.84 1994/02/07 08:10:40 geoff |
| 226 |
# When processing the LANGUAGES configuration variable (from local.h), |
| 227 |
# use sed instead of expr to process it. This gets around versions of |
| 228 |
# expr that have 127-character limitations (though it probably still |
| 229 |
# limits us to 512 characters with some versions of sed, so further work |
| 230 |
# may be needed here). |
| 231 |
# |
| 232 |
# Revision 1.83 1994/02/07 06:31:20 geoff |
| 233 |
# Clarify how to change variables in local.h |
| 234 |
# |
| 235 |
# Revision 1.82 1994/02/07 06:29:31 geoff |
| 236 |
# Add a dummy else clause to shell if-test for Ultrix |
| 237 |
# |
| 238 |
# Revision 1.81 1994/02/07 05:35:34 geoff |
| 239 |
# Make realclean run dictclean |
| 240 |
# |
| 241 |
# Revision 1.80 1994/01/26 07:44:43 geoff |
| 242 |
# Make yacc configurable through local.h. |
| 243 |
# |
| 244 |
# Revision 1.79 1994/01/25 07:11:11 geoff |
| 245 |
# Get rid of all old RCS log lines in preparation for the 3.1 release. |
| 246 |
# |
| 247 |
# |
| 248 |
|
| 249 |
# |
| 250 |
# !!!DO NOT EDIT HERE!!! |
| 251 |
# |
| 252 |
# Unlike previous versions of ispell, there should be no need to edit |
| 253 |
# your Makefile. Instead, #define the corresponding variables in your |
| 254 |
# local.h file; the Makefile will automatically pick them up. The |
| 255 |
# only reason you should need to edit the Makefile might to be to add |
| 256 |
# non-English dictionary support. |
| 257 |
# |
| 258 |
# For example, if you want to set CFLAGS to "-g -Wall", don't put it |
| 259 |
# here. Put: |
| 260 |
# |
| 261 |
# #define CFLAGS "-g -Wall" |
| 262 |
# |
| 263 |
# in local.h. Otherwise, it won't have any effect. |
| 264 |
# |
| 265 |
EXTRADICT = Use_config.sh |
| 266 |
|
| 267 |
SHELL = /bin/sh |
| 268 |
MAKE = make |
| 269 |
|
| 270 |
# |
| 271 |
# Prefix to apply to installation directories. This is not controlled |
| 272 |
# by config.X; if you want to make a global change of that sort you |
| 273 |
# should just set BINDIR, LIBDIR, etc. appropriately. The DESTDIR |
| 274 |
# prefix is useful if you want to specify a prefix at the time you |
| 275 |
# invoke make; this approach is useful in some large installations. |
| 276 |
# |
| 277 |
# Note that DESTDIR should be specified with a trailing slash. |
| 278 |
# |
| 279 |
DESTDIR = |
| 280 |
|
| 281 |
# |
| 282 |
# Set this to "-vx" in the make command line if you need to |
| 283 |
# debug the complex shell commands. |
| 284 |
# |
| 285 |
SHELLDEBUG = +vx |
| 286 |
|
| 287 |
all: config.sh |
| 288 |
all: programs defmt-programs showversion ispell.1 ispell.5 |
| 289 |
all: all-languages |
| 290 |
|
| 291 |
programs: buildhash findaffix tryaffix ispell |
| 292 |
programs: icombine ijoin munchlist |
| 293 |
programs: subset zapdups |
| 294 |
|
| 295 |
defmt-programs: |
| 296 |
cd deformatters; $(MAKE) all |
| 297 |
|
| 298 |
showversion: ispell |
| 299 |
-./ispell -v | sed -e 1q |
| 300 |
|
| 301 |
.c.o: |
| 302 |
@. ./config.sh; \ |
| 303 |
set -x; \ |
| 304 |
$$CC $$CFLAGS -DCFLAGS="\"$$CFLAGS\"" -c $< |
| 305 |
|
| 306 |
# |
| 307 |
# The funny business with y_tab.c is necessary for MS-DOS systems, |
| 308 |
# where filenames can't have multiple periods. |
| 309 |
# |
| 310 |
.y.o: |
| 311 |
@. ./config.sh; \ |
| 312 |
set -x; \ |
| 313 |
$$YACC $<; \ |
| 314 |
[ -f y_tab.c ] || mv y.tab.c y_tab.c; \ |
| 315 |
$$CC $$CFLAGS -DCFLAGS="$$CFLAGS" -c y_tab.c; \ |
| 316 |
mv y_tab.o $@; \ |
| 317 |
rm -f y_tab.c |
| 318 |
|
| 319 |
all-languages: munchable |
| 320 |
$(MAKE) LANGUAGE_TARGET=all SHELLDEBUG=$(SHELLDEBUG) language-subdirs |
| 321 |
|
| 322 |
install: config.sh all install-basic install-deformatters |
| 323 |
install: install-dictbuild install-languages |
| 324 |
|
| 325 |
partial-install: config.sh all install-basic install-languages |
| 326 |
|
| 327 |
install-basic: |
| 328 |
@. ./config.sh; \ |
| 329 |
set -x; \ |
| 330 |
[ -d $(DESTDIR)$$BINDIR ] || $(MAKE) NEWDIR=$(DESTDIR)$$BINDIR mkdirpath; \ |
| 331 |
cd $(DESTDIR)$$BINDIR; \ |
| 332 |
rm -f ispell$$EXEEXT |
| 333 |
@. ./config.sh; \ |
| 334 |
set -x; \ |
| 335 |
$$INSTALL ispell$$EXEEXT $(DESTDIR)$$BINDIR |
| 336 |
@. ./config.sh; \ |
| 337 |
set -x; \ |
| 338 |
cd $(DESTDIR)$$BINDIR; \ |
| 339 |
chmod 755 ispell$$EXEEXT |
| 340 |
@. ./config.sh; \ |
| 341 |
set -x; \ |
| 342 |
[ -d $(DESTDIR)$$MAN1DIR ] || $(MAKE) NEWDIR=$(DESTDIR)$$MAN1DIR mkdirpath; \ |
| 343 |
[ -d $(DESTDIR)$$MAN45DIR ] || $(MAKE) NEWDIR=$(DESTDIR)$$MAN45DIR mkdirpath; \ |
| 344 |
cd $(DESTDIR)$$MAN1DIR; \ |
| 345 |
rm -f ispell$$MAN1EXT; \ |
| 346 |
cd $(DESTDIR)$$MAN45DIR; \ |
| 347 |
rm -f ispell$$MAN45EXT |
| 348 |
@. ./config.sh; \ |
| 349 |
set -x; \ |
| 350 |
$$INSTALL ispell.1 $(DESTDIR)$$MAN1DIR/ispell$$MAN1EXT; \ |
| 351 |
$$INSTALL ispell.5 $(DESTDIR)$$MAN45DIR/ispell$$MAN45EXT |
| 352 |
@. ./config.sh; \ |
| 353 |
set -x; \ |
| 354 |
cd $(DESTDIR)$$MAN1DIR; \ |
| 355 |
chmod 644 ispell$$MAN1EXT; \ |
| 356 |
cd $(DESTDIR)$$MAN45DIR; \ |
| 357 |
chmod 644 ispell$$MAN45EXT |
| 358 |
|
| 359 |
mkdirpath: |
| 360 |
@[ "X$(NEWDIR)" = X ] && (echo NEWDIR unset 1>&2; exit 1); exit 0 |
| 361 |
@path=; \ |
| 362 |
umask 22; \ |
| 363 |
for i in `echo $(NEWDIR) | tr / ' '`; do \ |
| 364 |
path="$$path/$$i"; \ |
| 365 |
if [ ! -d $$path ]; then \ |
| 366 |
echo mkdir $$path; \ |
| 367 |
mkdir $$path; \ |
| 368 |
fi; \ |
| 369 |
done |
| 370 |
|
| 371 |
install-deformatters: |
| 372 |
@. ./config.sh; \ |
| 373 |
set -x; \ |
| 374 |
cd deformatters; \ |
| 375 |
$(MAKE) EXEEXT=$$EXEEXT install |
| 376 |
|
| 377 |
install-dictbuild: |
| 378 |
@. ./config.sh; \ |
| 379 |
set -x; \ |
| 380 |
[ -d $(DESTDIR)$$BINDIR ] \ |
| 381 |
|| $(MAKE) NEWDIR=$(DESTDIR)$$BINDIR mkdirpath; \ |
| 382 |
(cd $(DESTDIR)$$BINDIR; \ |
| 383 |
rm -f buildhash icombine ijoin \ |
| 384 |
munchlist findaffix fixispell-a tryaffix sq unsq); \ |
| 385 |
rm -f $(DESTDIR)$$LIBDIR/icombine |
| 386 |
@. ./config.sh; \ |
| 387 |
set -x; \ |
| 388 |
$$INSTALL buildhash icombine ijoin munchlist findaffix \ |
| 389 |
tryaffix \ |
| 390 |
$(DESTDIR)$$BINDIR |
| 391 |
@. ./config.sh; \ |
| 392 |
set -x; \ |
| 393 |
cd $(DESTDIR)$$BINDIR; \ |
| 394 |
chmod 755 buildhash$$EXEEXT icombine$$EXEEXT ijoin$$EXEEXT \ |
| 395 |
munchlist findaffix tryaffix |
| 396 |
@. ./config.sh; \ |
| 397 |
set -x; \ |
| 398 |
[ -d $(DESTDIR)$$MAN1DIR ] \ |
| 399 |
|| $(MAKE) NEWDIR=$(DESTDIR)$$MAN1DIR mkdirpath; \ |
| 400 |
[ -d $(DESTDIR)$$MAN45DIR ] \ |
| 401 |
|| $(MAKE) NEWDIR=$(DESTDIR)$$MAN45DIR mkdirpath; \ |
| 402 |
cd $(DESTDIR)$$MAN1DIR; \ |
| 403 |
rm -f fixispell-a$$MAN1EXT |
| 404 |
@. ./config.sh; \ |
| 405 |
set -x; \ |
| 406 |
$$INSTALL sq.1 $(DESTDIR)$$MAN1DIR/sq$$MAN1EXT; \ |
| 407 |
for m in buildhash munchlist findaffix tryaffix; do \ |
| 408 |
echo ".so `basename $$MAN1DIR`/ispell$$MAN1EXT" \ |
| 409 |
> $(DESTDIR)$$MAN1DIR/$$m$$MAN1EXT; \ |
| 410 |
done; \ |
| 411 |
echo ".so `basename $$MAN1DIR`/sq$$MAN1EXT" \ |
| 412 |
> $(DESTDIR)$$MAN1DIR/unsq$$MAN1EXT |
| 413 |
@. ./config.sh; \ |
| 414 |
set -x; \ |
| 415 |
cd $(DESTDIR)$$MAN1DIR; \ |
| 416 |
chmod 644 buildhash$$MAN1EXT \ |
| 417 |
munchlist$$MAN1EXT findaffix$$MAN1EXT tryaffix$$MAN1EXT |
| 418 |
|
| 419 |
install-languages: |
| 420 |
$(MAKE) DESTDIR=$(DESTDIR) LANGUAGE_TARGET=install \ |
| 421 |
SHELLDEBUG=$(SHELLDEBUG) \ |
| 422 |
language-subdirs |
| 423 |
. ./config.sh; \ |
| 424 |
[ -d $(DESTDIR)$$LIBDIR ] \ |
| 425 |
|| $(MAKE) NEWDIR=$(DESTDIR)$$LIBDIR mkdirpath; \ |
| 426 |
set -x; \ |
| 427 |
cd $(DESTDIR)$$LIBDIR; \ |
| 428 |
if [ $$MASTERHASH != debian-none ] && [ $$MASTERHASH != $$DEFHASH ]; then \ |
| 429 |
rm -f $$DEFHASH; \ |
| 430 |
$$LINK -s $$LIBDIR/$$MASTERHASH $$DEFHASH; \ |
| 431 |
fi |
| 432 |
|
| 433 |
munchable: findaffix tryaffix munchlist buildhash ispell icombine |
| 434 |
munchable: ijoin |
| 435 |
|
| 436 |
# |
| 437 |
# The following auxiliary dependency is used to make targets in |
| 438 |
# the language directories. Do you find it intimidating? No |
| 439 |
# surprise; remember that this is by the guy who wrote munchlist. |
| 440 |
# |
| 441 |
LANGUAGE_TARGET = Do_not_try_to_make_this_target_yourself |
| 442 |
BUILD = build |
| 443 |
CBUILD = build |
| 444 |
DBUILD = build |
| 445 |
|
| 446 |
language-subdirs: config.sh |
| 447 |
@. ./config.sh; \ |
| 448 |
set $(SHELLDEBUG); \ |
| 449 |
set +e; \ |
| 450 |
while [ "X$$LANGUAGES" != X ]; do \ |
| 451 |
( \ |
| 452 |
descriptor=`echo "$$LANGUAGES" \ |
| 453 |
| sed -e 's/.*{\([^}]*\)}[^{]*$$/\1/'`; \ |
| 454 |
dir=`echo "$$descriptor" | sed -e 's/\([^,]*\).*/\1/'`; \ |
| 455 |
descriptor=`echo "$$descriptor" \ |
| 456 |
| sed -e 's/[^,]*,*\(.*\).*/\1/'`; \ |
| 457 |
makeargs=''; \ |
| 458 |
while [ "X$$descriptor" != X ]; \ |
| 459 |
do \ |
| 460 |
nextvar=`echo "$$descriptor" \ |
| 461 |
| sed -e 's/\([^,]*\).*/\1/'`; \ |
| 462 |
makeargs="$$makeargs '$$nextvar'"; \ |
| 463 |
descriptor=`echo "$$descriptor" \ |
| 464 |
| sed -e 's/[^,]*,*\(.*\).*/\1/'`; \ |
| 465 |
done; \ |
| 466 |
set -x; \ |
| 467 |
cd languages/$$dir; \ |
| 468 |
eval $(MAKE) BUILD=$(BUILD) DBUILD=$(DBUILD) CBUILD=$(CBUILD) \ |
| 469 |
SHELLDEBUG=$(SHELLDEBUG) "$$makeargs" $(LANGUAGE_TARGET) \ |
| 470 |
|| exit 1; \ |
| 471 |
) || exit 1; \ |
| 472 |
LANGUAGES=`echo "$$LANGUAGES" \ |
| 473 |
| sed -e 's/\(.*\){[^{]*$$/\1/'`; \ |
| 474 |
case "$$LANGUAGES" in \ |
| 475 |
''|*{*}*) \ |
| 476 |
;; \ |
| 477 |
*) \ |
| 478 |
echo "Bad language specification: '$$LANGUAGES'" \ |
| 479 |
1>&2; \ |
| 480 |
exit 2 \ |
| 481 |
;; \ |
| 482 |
esac; \ |
| 483 |
done; \ |
| 484 |
exit 0 |
| 485 |
|
| 486 |
buildhash: config.sh buildhash.o hash.o makedent.o parse.o |
| 487 |
@. ./config.sh; \ |
| 488 |
set -x; \ |
| 489 |
$$CC $(LDFLAGS) -o buildhash buildhash.o hash.o makedent.o parse.o \ |
| 490 |
$$LIBES |
| 491 |
|
| 492 |
icombine: config.sh icombine.o makedent.o parse.o |
| 493 |
@. ./config.sh; \ |
| 494 |
set -x; \ |
| 495 |
$$CC $(LDFLAGS) -o icombine icombine.o makedent.o parse.o \ |
| 496 |
$$LIBES |
| 497 |
|
| 498 |
ijoin: config.sh ijoin.o fields.o |
| 499 |
@. ./config.sh; \ |
| 500 |
set -x; \ |
| 501 |
$$CC $(LDFLAGS) -o ijoin ijoin.o fields.o $$LIBES |
| 502 |
|
| 503 |
EDITFILE = notthere |
| 504 |
OUTFILE = /dev/null |
| 505 |
CFLAGS ?= -O |
| 506 |
|
| 507 |
# |
| 508 |
# Note: we use "sed -n -e $$p" to achieve "tail -1" here because some |
| 509 |
# idiot decided to break backwards compatibility in some versions of |
| 510 |
# tail. I have nothing but contempt for such fools. |
| 511 |
# |
| 512 |
defhash.h: config.X local.h Makefile |
| 513 |
set $(SHELLDEBUG); \ |
| 514 |
MASTERHASH=`cat config.X local.h \ |
| 515 |
| sed -n -e \ |
| 516 |
's/^#define[ ]*LANGUAGES[ ][^}]*HASHFILES=\([^,}]*\).*$$/\1/p' \ |
| 517 |
| sed -n -e '$$p'`; \ |
| 518 |
HASHSUFFIX=`cat config.X local.h \ |
| 519 |
| sed -n -e \ |
| 520 |
's/^#define[ ]*HASHSUFFIX[ ]*"\(.*\)"/\1/p' \ |
| 521 |
| sed -n -e '$$p'`; \ |
| 522 |
case "$$MASTERHASH" in \ |
| 523 |
american*|british*) DEFHASH="english$$HASHSUFFIX";; \ |
| 524 |
*) DEFHASH="$$MASTERHASH";; \ |
| 525 |
esac; \ |
| 526 |
DEFLANG=`expr "$$DEFHASH" : '\(.*\)\..*$$'`.aff; \ |
| 527 |
echo "/* This file is generated by the Makefile. Don't edit it! */" \ |
| 528 |
> defhash.h; \ |
| 529 |
echo '' >> defhash.h; \ |
| 530 |
echo '#ifndef MASTERHASH' >> defhash.h; \ |
| 531 |
echo '#define MASTERHASH "'"$$MASTERHASH"'"' >> defhash.h; \ |
| 532 |
echo '#endif' >> defhash.h; \ |
| 533 |
echo '#ifndef DEFHASH' >> defhash.h; \ |
| 534 |
echo '#define DEFHASH "'"$$DEFHASH"'"' >> defhash.h; \ |
| 535 |
echo '#endif' >> defhash.h; \ |
| 536 |
echo '#ifndef DEFLANG' >> defhash.h; \ |
| 537 |
echo '#define DEFLANG "'"$$DEFLANG"'"' >> defhash.h; \ |
| 538 |
echo '#endif' >> defhash.h |
| 539 |
|
| 540 |
config.sh: config.X defhash.h local.h Makefile |
| 541 |
set $(SHELLDEBUG); \ |
| 542 |
for var in BAKEXT BINDIR COUNTSUFFIX DEFDICT DEFHASH \ |
| 543 |
DEFLANG EXEEXT HASHSUFFIX INSTALL \ |
| 544 |
LANGUAGES LIBDIR LIBES LINK LINT LINTFLAGS LOOK_XREF \ |
| 545 |
MAKE_SORTTMP MAN1DIR MAN1EXT MAN45DIR MAN45EXT MAN45SECT MASTERHASH \ |
| 546 |
MSGLANG POUNDBANG REGLIB STATSUFFIX \ |
| 547 |
SPELL_XREF TERMLIB TIB_XREF WORDS YACC \ |
| 548 |
; do \ |
| 549 |
cat config.X defhash.h local.h \ |
| 550 |
| sed -n -e "s/^#define[ ]*$$var[ ]*"'"'"/$$var=/p" \ |
| 551 |
| sed -e 's/"[^"]*$$/'"'/" -e "s/=/='/" -e 's/\\"/"/g' \ |
| 552 |
| sed -n -e '$$p'; \ |
| 553 |
done > config.sh; \ |
| 554 |
echo "CC='$(CC)'" >> config.sh; \ |
| 555 |
echo "CFLAGS='$(CFLAGS)'" >> config.sh; \ |
| 556 |
echo 'case "$$MAKE_SORTTMP" in "") \ |
| 557 |
SORTTMP="-e /!!SORTTMP!!/s/=.*$$/=/";; *) SORTTMP=;; esac' \ |
| 558 |
>> config.sh |
| 559 |
|
| 560 |
doedit: |
| 561 |
. ./config.sh; \ |
| 562 |
set $(SHELLDEBUG); \ |
| 563 |
VERSION=`sed -n \ |
| 564 |
'/International Ispell/s/^.*\(International .*\)".*$$/\1/p' \ |
| 565 |
version.h`; \ |
| 566 |
sed \ |
| 567 |
-e "s@!!BAKEXT!!@$$BAKEXT@g" \ |
| 568 |
-e "s@!!COUNTSUFFIX!!@$$COUNTSUFFIX@g" \ |
| 569 |
-e "s@!!DEFHASH!!@$$DEFHASH@" -e "s@!!DEFLANG!!@$$DEFLANG@" \ |
| 570 |
-e "s@!!HASHSUFFIX!!@$$HASHSUFFIX@g" \ |
| 571 |
-e "s@!!LIBDIR!!@$$LIBDIR@" -e "s@!!DEFDICT!!@$$DEFDICT@" \ |
| 572 |
-e "s@!!LOOK_XREF!!@$$LOOK_XREF@g" \ |
| 573 |
-e "s@!!MAN45SECT!!@$$MAN45SECT@g" \ |
| 574 |
-e "s@!!POUNDBANG!!@$$POUNDBANG@g" \ |
| 575 |
-e "s@!!SPELL_XREF!!@$$SPELL_XREF@g" \ |
| 576 |
-e "s@!!STATSUFFIX!!@$$STATSUFFIX@g" \ |
| 577 |
-e "s@!!TIB_XREF!!@$$TIB_XREF@g" \ |
| 578 |
-e "s@!!WORDS!!@$$WORDS@g" \ |
| 579 |
-e "s@!!VERSION!!@$$VERSION@g" \ |
| 580 |
$$SORTTMP < $(EDITFILE) > $(OUTFILE) |
| 581 |
|
| 582 |
findaffix: findaffix.X config.sh |
| 583 |
@$(MAKE) EDITFILE=findaffix.X OUTFILE=findaffix doedit |
| 584 |
chmod +x findaffix |
| 585 |
|
| 586 |
ispell.1: ispell.1X config.sh version.h |
| 587 |
@$(MAKE) EDITFILE=ispell.1X OUTFILE=ispell.1 SHELLDEBUG=$(SHELLDEBUG) \ |
| 588 |
doedit |
| 589 |
|
| 590 |
ispell.5: ispell.5X config.sh |
| 591 |
@$(MAKE) EDITFILE=ispell.5X OUTFILE=ispell.5 SHELLDEBUG=$(SHELLDEBUG) \ |
| 592 |
doedit |
| 593 |
|
| 594 |
munchlist: munchlist.X config.sh |
| 595 |
@$(MAKE) EDITFILE=munchlist.X OUTFILE=munchlist \ |
| 596 |
SHELLDEBUG=$(SHELLDEBUG) doedit |
| 597 |
chmod +x munchlist |
| 598 |
|
| 599 |
subset: subset.X config.sh |
| 600 |
@$(MAKE) EDITFILE=subset.X OUTFILE=subset SHELLDEBUG=$(SHELLDEBUG) \ |
| 601 |
doedit |
| 602 |
chmod +x subset |
| 603 |
|
| 604 |
tryaffix: tryaffix.X config.sh |
| 605 |
@$(MAKE) EDITFILE=tryaffix.X OUTFILE=tryaffix \ |
| 606 |
SHELLDEBUG=$(SHELLDEBUG) doedit |
| 607 |
chmod +x tryaffix |
| 608 |
|
| 609 |
zapdups: zapdups.X config.sh |
| 610 |
@$(MAKE) EDITFILE=zapdups.X OUTFILE=zapdups SHELLDEBUG=$(SHELLDEBUG) \ |
| 611 |
doedit |
| 612 |
chmod +x zapdups |
| 613 |
|
| 614 |
# |
| 615 |
# We put term.o first because it is the most common cause of |
| 616 |
# compilation errors. Ispell.o is listed second because it's the main |
| 617 |
# program. The remainder of the object files are listed |
| 618 |
# alphabetically. |
| 619 |
# |
| 620 |
OBJS = term.o ispell.o correct.o defmt.o dump.o exp_table.o fields.o \ |
| 621 |
good.o lookup.o hash.o makedent.o tgood.o tree.o xgets.o |
| 622 |
|
| 623 |
# |
| 624 |
# A special rule for term.o to suggest configuration changes |
| 625 |
# |
| 626 |
term.o: term.c |
| 627 |
@. ./config.sh; \ |
| 628 |
echo $$CC $$CFLAGS -c term.c 1>&2; \ |
| 629 |
$$CC $$CFLAGS -c term.c \ |
| 630 |
|| (echo \ |
| 631 |
"term.c wouldn't compile. Try inverting USG in local.h" \ |
| 632 |
1>&2; \ |
| 633 |
exit 1) |
| 634 |
|
| 635 |
ispell: config.sh $(OBJS) |
| 636 |
@. ./config.sh; \ |
| 637 |
set -x; \ |
| 638 |
$$CC $(LDFLAGS) -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES |
| 639 |
|
| 640 |
sq: config.sh msgs.h sq.c |
| 641 |
@@. ./config.sh; \ |
| 642 |
set -x; \ |
| 643 |
$$CC $$CFLAGS $(LDFLAGS) -o sq sq.c |
| 644 |
|
| 645 |
unsq: config.sh msgs.h unsq.c |
| 646 |
@@. ./config.sh; \ |
| 647 |
set -x; \ |
| 648 |
$$CC $$CFLAGS $(LDFLAGS) -o unsq unsq.c |
| 649 |
|
| 650 |
$(OBJS) buildhash.o icombine.o hash.o parse.o: config.h ispell.h local.h |
| 651 |
$(OBJS) buildhash.o icombine.o hash.o parse.o: proto.h msgs.h config.sh |
| 652 |
$(OBJS) buildhash.o icombine.o hash.o parse.o: defhash.h |
| 653 |
exp_table.o tgood.o: exp_table.h |
| 654 |
fields.o: fields.h |
| 655 |
ijoin.o: config.sh config.h ispell.h local.h |
| 656 |
ijoin.o: proto.h fields.h |
| 657 |
buildhash.o correct.o ispell.o: version.h |
| 658 |
|
| 659 |
config.h: config.X local.h |
| 660 |
cp config.X config.h |
| 661 |
chmod u+w config.h |
| 662 |
echo '' >> config.h |
| 663 |
echo '/* AUTOMATICALLY-GENERATED SYMBOLS */' >> config.h |
| 664 |
cat local.h config.X \ |
| 665 |
| egrep '^#define[ ]*SIGNAL_TYPE' \ |
| 666 |
| sed -e 's/TYPE[ ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \ |
| 667 |
>> config.h |
| 668 |
cat local.h config.X \ |
| 669 |
| egrep '^#define[ ]*MASKTYPE' \ |
| 670 |
| sed -e 's/TYPE[ ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \ |
| 671 |
>> config.h |
| 672 |
|
| 673 |
# Create a sample local.h if no such file currently exists |
| 674 |
local.h: |
| 675 |
set +e; \ |
| 676 |
[ -r local.h ] || (cp local.h.generic local.h; chmod u+w local.h) |
| 677 |
|
| 678 |
msgs.h: config.sh FRC |
| 679 |
@. ./config.sh; \ |
| 680 |
set $(SHELLDEBUG); \ |
| 681 |
set +e; \ |
| 682 |
if [ -r languages/$$MSGLANG/msgs.h ]; then \ |
| 683 |
msgs=languages/$$MSGLANG/msgs.h; \ |
| 684 |
else \ |
| 685 |
msgs=languages/english/msgs.h; \ |
| 686 |
fi; \ |
| 687 |
if cmp -s msgs.h $$msgs; then \ |
| 688 |
:; \ |
| 689 |
else \ |
| 690 |
set -x; \ |
| 691 |
rm -f msgs.h; $$LINK -s $$msgs msgs.h || cp $$msgs msgs.h; \ |
| 692 |
fi |
| 693 |
|
| 694 |
FRC: |
| 695 |
|
| 696 |
tags: config.h *.[chy] |
| 697 |
ctags -w -t *.[chy] |
| 698 |
sed -e s/config.h/config.X/ tags > ntags |
| 699 |
mv ntags tags |
| 700 |
|
| 701 |
TAGS: config.h *.[chy] |
| 702 |
etags *.[chy] |
| 703 |
sed -e s/config.h/config.X/ TAGS > NTAGS |
| 704 |
mv NTAGS TAGS |
| 705 |
|
| 706 |
# |
| 707 |
# The funny business with y_tab.c is necessary for MS-DOS systems, |
| 708 |
# where filenames can't have multiple periods. |
| 709 |
# |
| 710 |
lint: languages/*/msgs.h |
| 711 |
lint: config.sh config.h ispell.h proto.h *.[cy] |
| 712 |
@. ./config.sh; \ |
| 713 |
$$LINT $$LINTFLAGS ispell.c correct.c defmt.c dump.c exp_table.c \ |
| 714 |
good.c hash.c lookup.c makedent.c tgood.c term.c tree.c xgets.c; \ |
| 715 |
$$YACC parse.y; \ |
| 716 |
[ -f y_tab.c ] || mv y.tab.c y_tab.c; \ |
| 717 |
$$LINT $$LINTFLAGS buildhash.c hash.c makedent.c y_tab.c; \ |
| 718 |
$$LINT $$LINTFLAGS icombine.c makedent.c y_tab.c; \ |
| 719 |
$$LINT $$LINTFLAGS ijoin.c fields.c |
| 720 |
@rm -f y_tab.c |
| 721 |
|
| 722 |
clean: config.sh clean-deformatters clean-languages |
| 723 |
@. ./config.sh; \ |
| 724 |
set -x; \ |
| 725 |
rm -f $$DEFHASH $$FOREIGNHASHES |
| 726 |
rm -f *.o core a.out mon.out hash.out y.tab.c y_tab.c *.stat *.cnt \ |
| 727 |
config.h defhash.h msgs.h unpacked |
| 728 |
rm -f buildhash findaffix tryaffix ispell icombine ijoin \ |
| 729 |
munchlist subset sq unsq zapdups ispell.1 ispell.5 ispell.info |
| 730 |
|
| 731 |
clean-deformatters: |
| 732 |
cd deformatters; $(MAKE) clean |
| 733 |
|
| 734 |
clean-languages: |
| 735 |
$(MAKE) LANGUAGE_TARGET=clean SHELLDEBUG=$(SHELLDEBUG) language-subdirs |
| 736 |
|
| 737 |
realclean veryclean: clean dictclean |
| 738 |
rm -f config.sh |
| 739 |
|
| 740 |
# |
| 741 |
# The following target allows you to clean out the combined |
| 742 |
# dictionary files. For safety, so you don't lose your files, |
| 743 |
# it makes sure that there is something to work from, but it can |
| 744 |
# only be so smart, so be careful! |
| 745 |
# |
| 746 |
dictclean: |
| 747 |
$(MAKE) LANGUAGE_TARGET=dictclean SHELLDEBUG=$(SHELLDEBUG) \ |
| 748 |
language-subdirs |