Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 5 — not the installed (fully patched) source.
5 Debian patches touch this file
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 -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 -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 strip ispell$$EXEEXT; \
340 chmod 755 ispell$$EXEEXT
341 @. ./config.sh; \
342 set -x; \
343 [ -d $(DESTDIR)$$MAN1DIR ] || $(MAKE) NEWDIR=$(DESTDIR)$$MAN1DIR mkdirpath; \
344 [ -d $(DESTDIR)$$MAN45DIR ] || $(MAKE) NEWDIR=$(DESTDIR)$$MAN45DIR mkdirpath; \
345 cd $(DESTDIR)$$MAN1DIR; \
346 rm -f ispell$$MAN1EXT; \
347 cd $(DESTDIR)$$MAN45DIR; \
348 rm -f ispell$$MAN45EXT
349 @. ./config.sh; \
350 set -x; \
351 $$INSTALL ispell.1 $(DESTDIR)$$MAN1DIR/ispell$$MAN1EXT; \
352 $$INSTALL ispell.5 $(DESTDIR)$$MAN45DIR/ispell$$MAN45EXT
353 @. ./config.sh; \
354 set -x; \
355 cd $(DESTDIR)$$MAN1DIR; \
356 chmod 644 ispell$$MAN1EXT; \
357 cd $(DESTDIR)$$MAN45DIR; \
358 chmod 644 ispell$$MAN45EXT
359
360 mkdirpath:
361 @[ "X$(NEWDIR)" = X ] && (echo NEWDIR unset 1>&2; exit 1); exit 0
362 @path=; \
363 umask 22; \
364 for i in `echo $(NEWDIR) | tr / ' '`; do \
365 path="$$path/$$i"; \
366 if [ ! -d $$path ]; then \
367 echo mkdir $$path; \
368 mkdir $$path; \
369 fi; \
370 done
371
372 install-deformatters:
373 @. ./config.sh; \
374 set -x; \
375 cd deformatters; \
376 $(MAKE) EXEEXT=$$EXEEXT install
377
378 install-dictbuild:
379 @. ./config.sh; \
380 set -x; \
381 [ -d $(DESTDIR)$$BINDIR ] \
382 || $(MAKE) NEWDIR=$(DESTDIR)$$BINDIR mkdirpath; \
383 (cd $(DESTDIR)$$BINDIR; \
384 rm -f buildhash icombine ijoin \
385 munchlist findaffix fixispell-a tryaffix sq unsq); \
386 rm -f $(DESTDIR)$$LIBDIR/icombine
387 @. ./config.sh; \
388 set -x; \
389 $$INSTALL buildhash icombine ijoin munchlist findaffix \
390 tryaffix \
391 $(DESTDIR)$$BINDIR
392 @. ./config.sh; \
393 set -x; \
394 cd $(DESTDIR)$$BINDIR; \
395 strip buildhash$$EXEEXT icombine$$EXEEXT ijoin$$EXEEXT; \
396 chmod 755 buildhash$$EXEEXT icombine$$EXEEXT ijoin$$EXEEXT \
397 munchlist findaffix tryaffix
398 @. ./config.sh; \
399 set -x; \
400 [ -d $(DESTDIR)$$MAN1DIR ] \
401 || $(MAKE) NEWDIR=$(DESTDIR)$$MAN1DIR mkdirpath; \
402 [ -d $(DESTDIR)$$MAN45DIR ] \
403 || $(MAKE) NEWDIR=$(DESTDIR)$$MAN45DIR mkdirpath; \
404 cd $(DESTDIR)$$MAN1DIR; \
405 rm -f fixispell-a$$MAN1EXT
406 @. ./config.sh; \
407 set -x; \
408 $$INSTALL sq.1 $(DESTDIR)$$MAN1DIR/sq$$MAN1EXT; \
409 for m in buildhash munchlist findaffix tryaffix; do \
410 echo ".so `basename $$MAN1DIR`/ispell$$MAN1EXT" \
411 > $(DESTDIR)$$MAN1DIR/$$m$$MAN1EXT; \
412 done; \
413 echo ".so `basename $$MAN1DIR`/sq$$MAN1EXT" \
414 > $(DESTDIR)$$MAN1DIR/unsq$$MAN1EXT
415 @. ./config.sh; \
416 set -x; \
417 cd $(DESTDIR)$$MAN1DIR; \
418 chmod 644 buildhash$$MAN1EXT \
419 munchlist$$MAN1EXT findaffix$$MAN1EXT tryaffix$$MAN1EXT
420
421 install-languages:
422 $(MAKE) DESTDIR=$(DESTDIR) LANGUAGE_TARGET=install \
423 SHELLDEBUG=$(SHELLDEBUG) \
424 language-subdirs
425 . ./config.sh; \
426 [ -d $(DESTDIR)$$LIBDIR ] \
427 || $(MAKE) NEWDIR=$(DESTDIR)$$LIBDIR mkdirpath; \
428 set -x; \
429 cd $(DESTDIR)$$LIBDIR; \
430 if [ $$MASTERHASH != $$DEFHASH ]; then \
431 rm -f $$DEFHASH; \
432 $$LINK -s $$LIBDIR/$$MASTERHASH $$DEFHASH; \
433 fi
434
435 munchable: findaffix tryaffix munchlist buildhash ispell icombine
436 munchable: ijoin
437
438 #
439 # The following auxiliary dependency is used to make targets in
440 # the language directories. Do you find it intimidating? No
441 # surprise; remember that this is by the guy who wrote munchlist.
442 #
443 LANGUAGE_TARGET = Do_not_try_to_make_this_target_yourself
444 BUILD = build
445 CBUILD = build
446 DBUILD = build
447
448 language-subdirs: config.sh
449 @. ./config.sh; \
450 set $(SHELLDEBUG); \
451 set +e; \
452 while [ "X$$LANGUAGES" != X ]; do \
453 ( \
454 descriptor=`echo "$$LANGUAGES" \
455 | sed -e 's/.*{\([^}]*\)}[^{]*$$/\1/'`; \
456 dir=`echo "$$descriptor" | sed -e 's/\([^,]*\).*/\1/'`; \
457 descriptor=`echo "$$descriptor" \
458 | sed -e 's/[^,]*,*\(.*\).*/\1/'`; \
459 makeargs=''; \
460 while [ "X$$descriptor" != X ]; \
461 do \
462 nextvar=`echo "$$descriptor" \
463 | sed -e 's/\([^,]*\).*/\1/'`; \
464 makeargs="$$makeargs '$$nextvar'"; \
465 descriptor=`echo "$$descriptor" \
466 | sed -e 's/[^,]*,*\(.*\).*/\1/'`; \
467 done; \
468 set -x; \
469 cd languages/$$dir; \
470 eval $(MAKE) BUILD=$(BUILD) DBUILD=$(DBUILD) CBUILD=$(CBUILD) \
471 SHELLDEBUG=$(SHELLDEBUG) "$$makeargs" $(LANGUAGE_TARGET) \
472 || exit 1; \
473 ) || exit 1; \
474 LANGUAGES=`echo "$$LANGUAGES" \
475 | sed -e 's/\(.*\){[^{]*$$/\1/'`; \
476 case "$$LANGUAGES" in \
477 ''|*{*}*) \
478 ;; \
479 *) \
480 echo "Bad language specification: '$$LANGUAGES'" \
481 1>&2; \
482 exit 2 \
483 ;; \
484 esac; \
485 done; \
486 exit 0
487
488 buildhash: config.sh buildhash.o hash.o makedent.o parse.o
489 @. ./config.sh; \
490 set -x; \
491 $$CC $$CFLAGS -o buildhash buildhash.o hash.o makedent.o parse.o \
492 $$LIBES
493
494 icombine: config.sh icombine.o makedent.o parse.o
495 @. ./config.sh; \
496 set -x; \
497 $$CC $$CFLAGS -o icombine icombine.o makedent.o parse.o \
498 $$LIBES
499
500 ijoin: config.sh ijoin.o fields.o
501 @. ./config.sh; \
502 set -x; \
503 $$CC $$CFLAGS -o ijoin ijoin.o fields.o $$LIBES
504
505 EDITFILE = notthere
506 OUTFILE = /dev/null
507
508 #
509 # Note: we use "sed -n -e $$p" to achieve "tail -1" here because some
510 # idiot decided to break backwards compatibility in some versions of
511 # tail. I have nothing but contempt for such fools.
512 #
513 defhash.h: config.X local.h Makefile
514 set $(SHELLDEBUG); \
515 MASTERHASH=`cat config.X local.h \
516 | sed -n -e \
517 's/^#define[ ]*LANGUAGES[ ][^}]*HASHFILES=\([^,}]*\).*$$/\1/p' \
518 | sed -n -e '$$p'`; \
519 HASHSUFFIX=`cat config.X local.h \
520 | sed -n -e \
521 's/^#define[ ]*HASHSUFFIX[ ]*"\(.*\)"/\1/p' \
522 | sed -n -e '$$p'`; \
523 case "$$MASTERHASH" in \
524 american*|british*) DEFHASH="english$$HASHSUFFIX";; \
525 *) DEFHASH="$$MASTERHASH";; \
526 esac; \
527 DEFLANG=`expr "$$DEFHASH" : '\(.*\)\..*$$'`.aff; \
528 echo "/* This file is generated by the Makefile. Don't edit it! */" \
529 > defhash.h; \
530 echo '' >> defhash.h; \
531 echo '#ifndef MASTERHASH' >> defhash.h; \
532 echo '#define MASTERHASH "'"$$MASTERHASH"'"' >> defhash.h; \
533 echo '#endif' >> defhash.h; \
534 echo '#ifndef DEFHASH' >> defhash.h; \
535 echo '#define DEFHASH "'"$$DEFHASH"'"' >> defhash.h; \
536 echo '#endif' >> defhash.h; \
537 echo '#ifndef DEFLANG' >> defhash.h; \
538 echo '#define DEFLANG "'"$$DEFLANG"'"' >> defhash.h; \
539 echo '#endif' >> defhash.h
540
541 config.sh: config.X defhash.h local.h Makefile
542 set $(SHELLDEBUG); \
543 for var in BAKEXT BINDIR CC CFLAGS COUNTSUFFIX DEFDICT DEFHASH \
544 DEFLANG EXEEXT HASHSUFFIX INSTALL \
545 LANGUAGES LIBDIR LIBES LINK LINT LINTFLAGS LOOK_XREF \
546 MAKE_SORTTMP MAN1DIR MAN1EXT MAN45DIR MAN45EXT MAN45SECT MASTERHASH \
547 MSGLANG POUNDBANG REGLIB STATSUFFIX \
548 SPELL_XREF TERMLIB TIB_XREF WORDS YACC \
549 ; do \
550 cat config.X defhash.h local.h \
551 | sed -n -e "s/^#define[ ]*$$var[ ]*"'"'"/$$var=/p" \
552 | sed -e 's/"[^"]*$$/'"'/" -e "s/=/='/" -e 's/\\"/"/g' \
553 | sed -n -e '$$p'; \
554 done > config.sh; \
555 echo 'case "$$MAKE_SORTTMP" in "") \
556 SORTTMP="-e /!!SORTTMP!!/s/=.*$$/=/";; *) SORTTMP=;; esac' \
557 >> config.sh
558
559 doedit:
560 . ./config.sh; \
561 set $(SHELLDEBUG); \
562 VERSION=`sed -n \
563 '/International Ispell/s/^.*\(International .*\)".*$$/\1/p' \
564 version.h`; \
565 sed \
566 -e "s@!!BAKEXT!!@$$BAKEXT@g" \
567 -e "s@!!COUNTSUFFIX!!@$$COUNTSUFFIX@g" \
568 -e "s@!!DEFHASH!!@$$DEFHASH@" -e "s@!!DEFLANG!!@$$DEFLANG@" \
569 -e "s@!!HASHSUFFIX!!@$$HASHSUFFIX@g" \
570 -e "s@!!LIBDIR!!@$$LIBDIR@" -e "s@!!DEFDICT!!@$$DEFDICT@" \
571 -e "s@!!LOOK_XREF!!@$$LOOK_XREF@g" \
572 -e "s@!!MAN45SECT!!@$$MAN45SECT@g" \
573 -e "s@!!POUNDBANG!!@$$POUNDBANG@g" \
574 -e "s@!!SPELL_XREF!!@$$SPELL_XREF@g" \
575 -e "s@!!STATSUFFIX!!@$$STATSUFFIX@g" \
576 -e "s@!!TIB_XREF!!@$$TIB_XREF@g" \
577 -e "s@!!WORDS!!@$$WORDS@g" \
578 -e "s@!!VERSION!!@$$VERSION@g" \
579 $$SORTTMP < $(EDITFILE) > $(OUTFILE)
580
581 findaffix: findaffix.X config.sh
582 @$(MAKE) EDITFILE=findaffix.X OUTFILE=findaffix doedit
583 chmod +x findaffix
584
585 ispell.1: ispell.1X config.sh version.h
586 @$(MAKE) EDITFILE=ispell.1X OUTFILE=ispell.1 SHELLDEBUG=$(SHELLDEBUG) \
587 doedit
588
589 ispell.5: ispell.5X config.sh
590 @$(MAKE) EDITFILE=ispell.5X OUTFILE=ispell.5 SHELLDEBUG=$(SHELLDEBUG) \
591 doedit
592
593 munchlist: munchlist.X config.sh
594 @$(MAKE) EDITFILE=munchlist.X OUTFILE=munchlist \
595 SHELLDEBUG=$(SHELLDEBUG) doedit
596 chmod +x munchlist
597
598 subset: subset.X config.sh
599 @$(MAKE) EDITFILE=subset.X OUTFILE=subset SHELLDEBUG=$(SHELLDEBUG) \
600 doedit
601 chmod +x subset
602
603 tryaffix: tryaffix.X config.sh
604 @$(MAKE) EDITFILE=tryaffix.X OUTFILE=tryaffix \
605 SHELLDEBUG=$(SHELLDEBUG) doedit
606 chmod +x tryaffix
607
608 zapdups: zapdups.X config.sh
609 @$(MAKE) EDITFILE=zapdups.X OUTFILE=zapdups SHELLDEBUG=$(SHELLDEBUG) \
610 doedit
611 chmod +x zapdups
612
613 #
614 # We put term.o first because it is the most common cause of
615 # compilation errors. Ispell.o is listed second because it's the main
616 # program. The remainder of the object files are listed
617 # alphabetically.
618 #
619 OBJS = term.o ispell.o correct.o defmt.o dump.o exp_table.o fields.o \
620 good.o lookup.o hash.o makedent.o tgood.o tree.o xgets.o
621
622 #
623 # A special rule for term.o to suggest configuration changes
624 #
625 term.o: term.c
626 @. ./config.sh; \
627 echo $$CC $$CFLAGS -c term.c 1>&2; \
628 $$CC $$CFLAGS -c term.c \
629 || (echo \
630 "term.c wouldn't compile. Try inverting USG in local.h" \
631 1>&2; \
632 exit 1)
633
634 ispell: config.sh $(OBJS)
635 @. ./config.sh; \
636 set -x; \
637 $$CC $$CFLAGS -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES
638
639 sq: config.sh msgs.h sq.c
640 @@. ./config.sh; \
641 set -x; \
642 $$CC $$CFLAGS -o sq sq.c
643
644 unsq: config.sh msgs.h unsq.c
645 @@. ./config.sh; \
646 set -x; \
647 $$CC $$CFLAGS -o unsq unsq.c
648
649 $(OBJS) buildhash.o icombine.o hash.o parse.o: config.h ispell.h local.h
650 $(OBJS) buildhash.o icombine.o hash.o parse.o: proto.h msgs.h config.sh
651 $(OBJS) buildhash.o icombine.o hash.o parse.o: defhash.h
652 exp_table.o tgood.o: exp_table.h
653 fields.o: fields.h
654 ijoin.o: config.sh config.h ispell.h local.h
655 ijoin.o: proto.h fields.h
656 buildhash.o correct.o ispell.o: version.h
657
658 config.h: config.X local.h
659 cp config.X config.h
660 chmod u+w config.h
661 echo '' >> config.h
662 echo '/* AUTOMATICALLY-GENERATED SYMBOLS */' >> config.h
663 cat local.h config.X \
664 | egrep '^#define[ ]*SIGNAL_TYPE' \
665 | sed -e 's/TYPE[ ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \
666 >> config.h
667 cat local.h config.X \
668 | egrep '^#define[ ]*MASKTYPE' \
669 | sed -e 's/TYPE[ ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \
670 >> config.h
671
672 # Create a sample local.h if no such file currently exists
673 local.h:
674 set +e; \
675 [ -r local.h ] || (cp local.h.generic local.h; chmod u+w local.h)
676
677 msgs.h: config.sh FRC
678 @. ./config.sh; \
679 set $(SHELLDEBUG); \
680 set +e; \
681 if [ -r languages/$$MSGLANG/msgs.h ]; then \
682 msgs=languages/$$MSGLANG/msgs.h; \
683 else \
684 msgs=languages/english/msgs.h; \
685 fi; \
686 if cmp -s msgs.h $$msgs; then \
687 :; \
688 else \
689 set -x; \
690 rm -f msgs.h; $$LINK -s $$msgs msgs.h || cp $$msgs msgs.h; \
691 fi
692
693 FRC:
694
695 tags: config.h *.[chy]
696 ctags -w -t *.[chy]
697 sed -e s/config.h/config.X/ tags > ntags
698 mv ntags tags
699
700 TAGS: config.h *.[chy]
701 etags *.[chy]
702 sed -e s/config.h/config.X/ TAGS > NTAGS
703 mv NTAGS TAGS
704
705 #
706 # The funny business with y_tab.c is necessary for MS-DOS systems,
707 # where filenames can't have multiple periods.
708 #
709 lint: languages/*/msgs.h
710 lint: config.sh config.h ispell.h proto.h *.[cy]
711 @. ./config.sh; \
712 $$LINT $$LINTFLAGS ispell.c correct.c defmt.c dump.c exp_table.c \
713 good.c hash.c lookup.c makedent.c tgood.c term.c tree.c xgets.c; \
714 $$YACC parse.y; \
715 [ -f y_tab.c ] || mv y.tab.c y_tab.c; \
716 $$LINT $$LINTFLAGS buildhash.c hash.c makedent.c y_tab.c; \
717 $$LINT $$LINTFLAGS icombine.c makedent.c y_tab.c; \
718 $$LINT $$LINTFLAGS ijoin.c fields.c
719 @rm -f y_tab.c
720
721 clean: config.sh clean-deformatters clean-languages
722 @. ./config.sh; \
723 set -x; \
724 rm -f $$DEFHASH $$FOREIGNHASHES
725 rm -f *.o core a.out mon.out hash.out y.tab.c y_tab.c *.stat *.cnt \
726 config.h defhash.h msgs.h unpacked
727 rm -f buildhash findaffix tryaffix ispell icombine ijoin \
728 munchlist subset sq unsq zapdups ispell.1 ispell.5 ispell.info
729
730 clean-deformatters:
731 cd deformatters; $(MAKE) clean
732
733 clean-languages:
734 $(MAKE) LANGUAGE_TARGET=clean SHELLDEBUG=$(SHELLDEBUG) language-subdirs
735
736 realclean veryclean: clean dictclean
737 rm -f config.sh
738
739 #
740 # The following target allows you to clean out the combined
741 # dictionary files. For safety, so you don't lose your files,
742 # it makes sure that there is something to work from, but it can
743 # only be so smart, so be careful!
744 #
745 dictclean:
746 $(MAKE) LANGUAGE_TARGET=dictclean SHELLDEBUG=$(SHELLDEBUG) \
747 language-subdirs