Imported Upstream version 1.22.4
[platform/upstream/groff.git] / Makefile.am
1 # Copyright (C) 1989-2018 Free Software Foundation, Inc.
2 # Original Makefile.in written by James Clark (jjc@jclark.com)
3 # Migrated to Automake by Bertrand Garrigues
4 #
5 # Last update: 2017-11-02
6 #
7 # This file is part of groff.
8 #
9 # groff is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free
11 # Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 # for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 #
22 # Makefile.am
23 #
24
25 # The variables that are listed in the following comments will be
26 # automatically set by automake in the generated Makefile.in
27
28 # SHELL
29
30 # PACKAGE_TARNAME
31
32 # srcdir
33
34 # top_srcdir
35
36 # VPATH
37
38 # top_builddir
39
40 # HOST
41 # `HOST' is the canonical host specification,
42 #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
43 # or
44 #    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
45
46 # `RT_SEP' is the operating system's native PATH SEPARATOR CHAR, which
47 # is to be used in runtime PATHs compiled into groff executables.
48 RT_SEP=@GROFF_PATH_SEPARATOR@
49
50 # `SH_SEP' is a alternative PATH SEPARATOR CHAR, to be used in shell
51 # scripts and makefile rules; it may be the same as `RT_SEP', but,
52 # particularly in some Microsoft environments, it may differ.
53 SH_SEP=@PATH_SEPARATOR@
54
55 # GLIBC2
56 # `GLIBC21' is yes if the host operating system uses GNU libc 2.1 or newer,
57 # otherwise no.
58
59
60 # VERSION is set by automake, based on what is passed to AC_INIT.
61
62 # PAGE
63 # Define `page' to be letter if your PostScript printer uses 8.5x11
64 # paper (USA) and define it to be A4, if it uses A4 paper (rest of the
65 # world).
66
67 # GHOSTSCRIPT
68 # The name of the ghostscript program. Normally, gs, on GNU/Linux
69 # but it might be different on MS-DOS/MS-WIN32 systems.
70
71 # ALT_GHOSTSCRIPT_PROGS
72 # `ALT_GHOSTSCRIPT_PROGS' specifies a list alternative names,
73 # which can be tried if `GHOSTSCRIPT' cannot be found at run time.
74
75 # ALT_AWK_PROGS
76 # Similarly, `ALT_AWK_PROGS' specifies a list of alternative names,
77 # which can be tried at run time, to identify the awk program.
78
79 # BROKEN_SPOOLER_FLAGS
80 # Normally the Postscript driver, grops, produces output that conforms
81 # to version 3.0 of the Adobe Document Structuring Conventions.
82 # Unfortunately some spoolers and previewers can't handle such output.
83 # The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
84 # make its output acceptable to such programs.  This variable controls
85 # only the default behaviour of grops; the behaviour can be changed at
86 # runtime by the grops -b option (and so by groff -P-b).
87 # Use a value of 0 if your spoolers and previewers are able to handle
88 # conforming PostScript correctly.
89 # Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
90 # this is needed for early versions of TranScript that get confused by
91 # anything between the %%EndProlog line and the first %%Page: comment.
92 # Add 2 if lines in included files beginning with %! should be
93 # stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
94 # Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
95 # stripped out of included files; this is needed for spoolers that
96 # don't understand the %%{Begin,End}Document comments. I suspect this
97 # includes early versions of TranScript.
98 # Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
99 # rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
100 # with a printer that requires page reversal.
101
102
103 # `DEVICE' is the default device.
104 DEVICE=ps
105
106 # XDEVIDIRS
107 # `XDEVDIRS' is either `font/devX{75,100}{,-12}' or empty.
108
109 # XPROGDIRS
110 # `XPROGDIRS' is either `src/devices/xditview src/utils/xtotroff' or empty.
111
112 # XLIBDIRS
113 # `XLIBDIRS' is either `src/libs/libxutil' or empty.
114
115 # `TTYDEVDIRS' is either `font/devascii font/devlatin1' (for
116 # ASCII) or `font/devcp1047' (for EBCDIC) plus font/devutf8.
117 TTYDEVDIRS=@TTYDEVDIRS@ font/devutf8
118
119 # OTHERDEVDIRS
120 # `OTHERDEVDIRS' is either `font/devlj4 font/devlbp' (for ASCII) or
121 # empty (for EBCDIC).
122
123 # PSPRINT
124 # `PSPRINT' is the command to use for printing a PostScript file,
125 # for example `lpr'.
126
127 # DVIPRINT
128 # `DVIPRINT' is the command to use for printing a TeX dvi file,
129 # for example `lpr -d'.
130
131 # g
132 # Prefix for names of programs that have Unix counterparts.
133 # For example, if `g' is `g' then troff will be installed as
134 # gtroff.  This doesn't affect programs like grops or groff that have
135 # no Unix counterparts.  Note that the groff versions of eqn and tbl
136 # will not work with Unix troff.
137
138 # prefix
139 # exec_prefix
140 # Common prefix for installation directories.
141 # Used in definitions of exec_prefix, datasubdir, fontpath, manroot.
142 # This must already exist when you do make install.
143
144 # bindir
145 # `bindir' says where to install executables.
146
147 # libdir
148 # `libdir' says where to install platform-dependent data.
149
150 # libprogramdir
151 # `libprogramdir' is $(libdir)/groff
152
153 # `datasubdir' says where to install platform-independent data files.
154 # datadir
155 # datarootdir
156 dataprogramdir=$(datadir)/groff
157 datasubdir=$(dataprogramdir)/$(SHORT_VERSION)
158
159 # infodir
160 # `infodir' says where to install info files.
161
162 # docdir
163 # `docdir' says where to install documentation files.  The default
164 # location is ${datarootdir}/doc/${PACKAGE}, but we add the version
165 docdir=$(datarootdir)/doc/${PACKAGE}-$(SHORT_VERSION)
166
167 # `exampledir' says where to install example files.
168 exampledir=$(docdir)/examples
169
170 # `htmldocdir' says where to install documentation in HTML format.
171 htmldocdir=$(docdir)/html
172
173 # `pdfdocdir' says where to install documentation in PDF format.
174 pdfdocdir=$(docdir)/pdf
175
176 # `fontdir' says where to install dev*/*.
177 fontdir=$(datasubdir)/font
178
179 # `oldfontdir' says where to install old font sets (as dev*/*).
180 oldfontdir=$(datasubdir)/oldfont
181
182 # `localfontdir' says where local fonts will be installed (as dev*/*).
183 localfontdir=$(dataprogramdir)/site-font
184
185 # `legacyfontdir' is for compatibility with non-GNU troff.
186 legacyfontdir=/usr/lib/font
187
188 # `fontpath' says where to look for dev*/*.
189 fontpath=$(localfontdir)$(RT_SEP)$(fontdir)$(RT_SEP)$(legacyfontdir)
190
191 # `tmacdir' says where to install macros.
192 tmacdir=$(datasubdir)/tmac
193
194 # `systemtmacdir' says where to install platform-dependent macros.
195 systemtmacdir=$(libprogramdir)/site-tmac
196
197 # `localtmacdir' says where local files will be installed.
198 localtmacdir=$(dataprogramdir)/site-tmac
199
200 # appresdir
201 # `appresdir' says where to install the application resource file for
202 # gxditview.
203
204 # groffer_dir
205 # glilypond_dir
206 # grog_dir
207 # gpinyin_dir
208
209 # `tmacpath' says where to look for macro files.
210 # The current directory will be prepended in unsafe mode only; the home
211 # directory will be always added.
212 # `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the
213 # current nor in the home directory.
214 tmacpath=$(systemtmacdir)$(RT_SEP)$(localtmacdir)$(RT_SEP)$(tmacdir)
215
216 # sys_tmac_prefix
217 # `sys_tmac_prefix' is prefix (if any) for system macro packages.
218
219 # pnmtops_nosetpage
220 # `pnmtops_nosetpage' is the command to be run to generate an eps
221 # file.  Some versions of pnmtops provide the -nosetpage option.
222 # We detect this and use it if present.
223
224 # tmac_wrap
225 # `tmac_wrap' is list of system macro packages that should be made
226 # available to groff by creating a corresponding macro package
227 # in the groff macro directory that references the system macro
228 # package.
229
230 # compatibility_wrappers
231 # (groff compatibility wrappers for vendor-provided non-GNU macro sets)
232 #
233 # `compatibility_wrappers' controls the creation and installation of
234 # compatibility wrappers for the macro sets named in `tmac_wrap'.
235 # Its value must be one of:
236 #   `yes'    install compatibility wrappers as the original macro set name
237 #            (that is, the default implementation of that macro set), and
238 #            install the groff implementation with a prefix (usually g).
239 #   `no'     do not install compatibility wrappers; only install the groff
240 #            implementation of each macro set.
241 #   `manual' install the compatibility wrappers as `<macro>-os' and install
242 #            the groff implementation of each macro set as the default
243 #            implementation of that macro set.
244
245 # Don't make this empty.
246 wrapper_suffix_default="-os"
247
248 wrapper_suffix=`if test $(compatibility_wrappers) = manual; then echo $(wrapper_suffix_default); fi`
249
250 # When `compatibility_wrappers' is `yes', if there is a groff implementation
251 # of a macro set listed in $(tmac_wrap), then the groff implementation will be
252 # installed with a prefix of $(tmac_prefix) via the collision detection
253 # variables $(tmac_m_prefix), $(tmac_s_prefix), and $(tmac_an_prefix).
254
255 # Don't make this empty.
256 tmac_prefix=g
257
258 # The groff -mm macros will be available as -m$(tmac_m_prefix)m.
259 tmac_m_prefix=\
260  `if test $(compatibility_wrappers) = yes; then \
261     for i in $(tmac_wrap) ""; do \
262       case "$$i" in m) echo $(tmac_prefix);; esac; \
263     done; \
264   fi`
265
266 # The groff -ms macros will be available as -m$(tmac_s_prefix)s.
267 tmac_s_prefix=\
268  `if test $(compatibility_wrappers) = yes; then \
269     for i in $(tmac_wrap) ""; do \
270       case "$$i" in s) echo $(tmac_prefix);; esac; \
271     done; \
272   fi`
273
274 # The groff -man macros will be available as -m$(tmac_an_prefix)an.
275 tmac_an_prefix=\
276  `if test $(compatibility_wrappers) = yes; then \
277     for i in $(tmac_wrap) ""; do \
278       case "$$i" in an) echo $(tmac_prefix);; esac; \
279     done; \
280   fi`
281
282 # Extension to be used for refer index files.  Index files are not
283 # sharable between different architectures, so you might want to use
284 # different suffixes for different architectures.  Choose an extension
285 # that doesn't conflict with refer or any other indexing program.
286 indexext=.i
287
288 # Directory containing the default index for refer.
289 indexdir=/usr/dict/papers
290
291 # The filename (without suffix) of the default index for refer.
292 indexname=Ind
293
294 # common_words_file is a file containing a list of common words.
295 # If your system provides /usr/lib/eign it will be copied onto this,
296 # otherwise the supplied eign file will be used.
297 common_words_file=$(datasubdir)/eign
298
299 # mandir
300 # `manroot' is the root of the man page directory tree.
301 manroot=$(mandir)
302
303 # `man1ext' is the man section for user commands.
304 man1ext=1
305 man1dir=$(manroot)/man$(man1ext)
306
307 # `man5ext' is the man section for file formats.
308 man5ext=5
309 man5dir=$(manroot)/man$(man5ext)
310
311 # `man7ext' is the man section for macros.
312 man7ext=7
313 man7dir=$(manroot)/man$(man7ext)
314
315 # doc_dist_target_ok
316 # `dist' target is disallowed in some `configure' combinations.
317
318 # The configure script checks whether the user wants the info documentation.
319 # For the repo version this mechanism also suppresses building via `makeinfo'.
320 # make_infodoc
321 # make_install_infodoc
322 # make_uninstall_infodoc
323
324 # The configure script checks whether all necessary utility programs for
325 # grohtml are available -- only then we can build the HTML documentation.
326 # make_htmldoc
327 # make_install_htmldoc
328 # make_uninstall_htmldoc
329
330 # make_htmlexamples
331 # make_install_htmlexamples
332 # make_uninstall_htmlexamples
333
334 # The configure script also checks whether all necessary utility programs
335 # for pdfroff are available -- only then we can build PDF documentation.
336 # make_pdfdoc
337 # make_install_pdfdoc
338 # make_uninstall_pdfdoc
339
340 # make_pdfexamples
341 # make_install_pdfexamples
342 # make_uninstall_pdfexamples
343
344 # `other' documentation, e.g., `meref.me' and `pic.ms', as well as their
345 # generated counterparts..
346 # make_otherdoc
347 # make_install_otherdoc
348 # make_uninstall_otherdoc
349
350 # `examples' -- a generic switch, but the generated examples are furtherly
351 # subdivided to catch HTML and PDF production availability.
352 # make_examples
353 # make_install_examples
354 # make_uninstall_examples
355
356 # Windows `.cmd' files
357 # make_winscripts
358 # make_install_winscripts
359 # make_uninstall_winscripts
360
361 # All the previous installation directories, when used, are prefixed with
362 # $(DESTDIR) during install and uninstall, to support staged installations.
363
364 # config.h might set the following defines:
365 #
366 # WORDS_BIGENDIAN               if your target platform is big-endian
367 # IS_EBCDIC_HOST                if the host's encoding is EBCDIC
368 #
369 # HAVE_DIRECT_H         if you have <direct.h>
370 # HAVE_DIRENT_H         if you have <dirent.h>
371 # HAVE_CC_INTTYPES_H            if you have a C++ <inttypes.h>
372 # HAVE_PROCESS_H                if you have <process.h>
373 # HAVE_LIMITS_H         if you have <limits.h>
374 # HAVE_CC_LIMITS_H              if you have a C++ <limits.h>
375 # HAVE_MATH_H                   if you have <math.h>
376 # HAVE_CC_OSFCN_H               if you have a C++ <osfcn.h>
377 # HAVE_STDDEF_H         if you have <stddef.h>
378 # HAVE_STDLIB_H         if you have <stdlib.h>
379 # HAVE_STRING_H         if you have <string.h>
380 # HAVE_STRINGS_H                if you have <strings.h>
381 # HAVE_SYS_DIR_H                if you have <sys/dir.h>
382 # HAVE_SYS_PARAM_H              if you have <sys/param.h>
383 # HAVE_SYS_STAT_H               if you have <sys/stat.h>
384 # HAVE_SYS_TIME_H               if you have <sys/time.h>
385 # HAVE_SYS_TYPES_H              if you have <sys/types.h>
386 # HAVE_UNISTD_H         if you have <unistd.h>
387 #
388 # HAVE_FMOD                     if you have fmod()
389 # HAVE_GETCWD                   if you have getcwd()
390 # HAVE_GETTIMEOFDAY             if you have gettimeofday()
391 # HAVE_ICONV                    if you have iconv()
392 # HAVE_ISATTY                   if you have isatty()
393 # HAVE_KILL                     if you have kill()
394 # HAVE_LANGINFO_CODESET if you have nl_langinfo()
395 # HAVE_MKSTEMP          if you have mkstemp()
396 # HAVE_MMAP                     if you have mmap()
397 # HAVE_PUTENV                   if you have putenv()
398 # HAVE_RENAME                   if you have rename()
399 # HAVE_SETLOCALE                if you have setlocale()
400 # HAVE_STRCASECMP               if you have strcasecmp()
401 # HAVE_STRNCASECMP              if you have strncasecmp()
402 # HAVE_STRERROR         if you have strerror()
403 # HAVE_STRSEP                   if you have strsep()
404 # HAVE_STRTOL                   if you have strtol()
405 # HAVE_SYMLINK          if you have symlink()
406 #
407 # NEED_DECLARATION_GETTIMEOFTODAY
408 #                               if your C++ <sys/time.h> doesn't declare
409 #                               gettimeofday()
410 # NEED_DECLARATION_HYPOT        if your C++ <math.h> doesn't declare hypot()
411 # NEED_DECLARATION_PCLOSE       if your C++ <stdio.h> doesn't declare pclose()
412 # NEED_DECLARATION_POPEN        if your C++ <stdio.h> doesn't declare popen()
413 # NEED_DECLARATION_PUTENV       if your C++ <stdlib.h> doesn't declare
414 #                               putenv()
415 # NEED_DECLARATION_RAND if your C++ <stdlib.h> doesn't declare rand()
416 # NEED_DECLARATION_SRAND        if your C++ <stdlib.h> doesn't declare srand()
417 # NEED_DECLARATION_STRCASECMP   if your C++ <string.h> doesn't declare
418 #                               strcasecmp()
419 # NEED_DECLARATION_STRNCASECMP
420 #                               if your C++ <string.h> doesn't declare
421 #                               strncasecmp()
422 # NEED_DECLARATION_VFPRINTF     if your C++ <stdio.h> doesn't declare
423 #                               vfprintf()
424 #
425 # HAVE_DECL_GETC_UNLOCKED       if you have getc_unlocked()
426 # HAVE_DECL_SYS_SIGLIST if you have sys_siglist[]
427 #
428 # HAVE_STRUCT_EXCEPTION if <math.h> defines struct exception
429 # HAVE_SYS_NERR         if you have sysnerr in <errno.h> or <stdio.h>
430 # HAVE_SYS_ERRLIST              if you have sys_errlist in <errno.h> or
431 #                               <stdio.h>
432 # ICONV_CONST=const             if declaration of iconv() needs const
433 # LONG_FOR_TIME_T               if localtime() takes a long * not a time_t *
434 # RETSIGTYPE=int                if signal handlers return int not void
435 # RET_TYPE_SRAND_IS_VOID        if srand() returns void not int
436 #
437 # WCOREFLAG=0200                if the 0200 bit of the status returned by
438 #                               wait() indicates whether a core image was
439 #                               produced for a process that was terminated
440 #                               by a signal
441 #
442 # HAVE_WORKING_O_NOATIME      define if <fcntl.h>'s O_NOATIME flag works
443 # HAVE_WORKING_O_NOFOLLOW     define if <fcntl.h>'s O_NOFOLLOW flag works
444 #
445 # uintmax_t=<value>             define to `unsigned long' or `unsigned long
446 #                               long' if <inttypes.h> does not exist
447 #
448 # TRADITIONAL_CPP               if your C++ compiler uses a traditional
449 #                               (Reiser) preprocessor
450 # ARRAY_DELETE_NEEDS_SIZE       if your C++ doesn't understand `delete []'
451 #
452 # PAGE=A4                       if the printer's page size is A4
453 # GHOSTSCRIPT=gs                the name (and directory if required) of the
454 #                               ghostscript program
455
456 # Include
457 #
458 #   {fmod,getcwd,mkstemp,putenv,strcasecmp,
459 #    strerror,strncasecmp,strtol}.$(OBJEXT)
460 #
461 # LIBOBJS
462 # in LIBOBJS if your C library is missing the corresponding function.
463
464 # `CCC' is the compiler for C++ (.cpp) files.
465 CCC=@CXX@
466 # CC
467 # CFLAGS
468 # CPPFLAGS
469 # LDFLAGS
470
471 # X_CFLAGS
472 # X_LIBS
473 # X_EXTRA_LIBS
474 # X_PRE_LIBS
475
476 # YACC
477
478 # GREP
479 # EGREP
480
481 # MAKEINFO
482
483 # EXEEXT
484 # OBJEXT
485 # LIBEXT
486 # LIBS
487 # LIBM
488 # LIBICONV
489 # RANLIB
490 # INSTALL
491 # INSTALL_PROGRAM
492 # INSTALL_SCRIPT
493 # INSTALL_DATA
494 # INSTALL_INFO
495 # LN_S
496
497 AR=ar
498 ETAGS=etags
499 ETAGSFLAGS=
500 # Flag that tells etags to assume C++.
501 ETAGSCCFLAG=-C
502 # Full path to perl.
503 # PERL
504 # PERLVERSION
505 # Sed command with which to edit sh scripts.
506 # SH_SCRIPT_SED_CMD
507 # Sed script to deal with OS dependencies in sh scripts.
508 SH_DEPS_SED_SCRIPT=$(top_builddir)/shdeps.sed
509
510 # On some platforms we need to set LANG and LC_ALL to C for sed
511 SED=\
512   LANG=C \
513   LC_ALL=C \
514   sed
515
516 # The program to create directory hierarchies.
517 # mkinstalldirs is now in gnulib/build-aux
518
519 PURIFY=purify
520 PURIFYCCFLAGS=
521 #PURIFYCCFLAGS=-g++=yes \
522 #  -collector=`dirname \`$(CCC) -print-libgcc-file-name\``/ld
523
524 # Add groff and gnulib m4 macros
525 ACLOCAL_AMFLAGS = -I m4 -I gnulib_m4
526
527 # Common preprocessor flags: gnulib includes, common includes in
528 # src/include, and config.h that is generated in the build tree
529 AM_CPPFLAGS = \
530   -I$(top_srcdir)/src/include \
531   -I$(top_srcdir)/lib \
532   -I$(top_builddir)/src/include \
533   -I$(top_builddir)/lib
534
535 # Define a custom string for rules that call groff in make's silence mode.
536 GROFF_V = $(GROFF_V_@AM_V@)
537 GROFF_V_ = $(GROFF_V_@AM_DEFAULT_V@)
538 GROFF_V_0 = @echo "  GROFF   " $@;
539
540 # The following Automake variables will be overloaded by the various
541 # .am files
542 bin_PROGRAMS =
543 nobase_bin_PROGRAMS =
544 bin_SCRIPTS =
545 dist_bin_SCRIPTS =
546 MOSTLYCLEANFILES =
547 MOSTLYCLEANADD =
548 noinst_LIBRARIES =
549 BUILT_SOURCES =
550 CLEANFILES =
551 # gnulib asks to include this file
552 EXTRA_DIST = gnulib_m4/gnulib-cache.m4
553 FONTFILES =
554 PREFIXMAN1 =
555 man1_MANS =
556 man5_MANS =
557 man7_MANS =
558
559 # for lex/yacc
560 AM_YFLAGS = -d -v
561
562 SUFFIXES =
563
564 # tests launched by make check
565 check_SCRIPTS =
566 check_PROGRAMS =
567 TESTS =
568 AM_TESTS_ENVIRONMENT = \
569   abs_top_srcdir=$(abs_top_srcdir) \
570   abs_top_builddir=$(abs_top_builddir) \
571   export abs_top_srcdir abs_top_builddir;
572
573 # We use Automake's Uniform Naming Scheme.
574 #
575 # prefixexecbin_PROGRAMS is the list of programs that may have a
576 # NAMEPREFIX if an existing non-GNU troff system was detected.
577 #
578 # This is done by the m4 macro GROFF_G that checks for the presence of
579 # GNU Troff built-in \n[.g] macro. If a Unix Troff binary was
580 # detected, the following programs and scripts names will have a 'g'
581 # prefix: chem, tbl, eqn, neqn, pic, soleimm grn, refer, lookbib,
582 # troff, nroff. Also, PROG_PREFIX will be set to 'g' in the generated
583 # header defs.h so that these programs could be called correctly.
584 #
585 # prefixexecbindir is used to temporary install these programs. They
586 # are then moved to bindir during the install-exec-hook.  Same thing
587 # for the scripts.
588 NAMEPREFIX=$(g)
589 prefixexecbin_PROGRAMS =
590 prefixexecbin_SCRIPTS =
591 if USEPROGRAMPREFIX
592 # We use datadir because the uninstall rule for the PROGRAMS attempt
593 # to cd into prefixexecbindir, and thus if prefixexecbindir is removed
594 # two consecutive uninstall would fail
595 prefixexecbindir = $(datadir)
596 else
597 prefixexecbindir = $(bindir)
598 endif
599
600 # Path to binaries and flags used by contribs and doc to generated doc.
601 # These may be overridden if cross-compiling.
602 GROFFBIN = $(abs_top_builddir)/groff
603 GROFF_BIN_PATH = $(abs_top_builddir)
604 PDFMOMBIN = $(abs_top_builddir)/pdfmom
605 # The second directories are needed for the case "cd build; ../configure".
606 FFLAG=-F$(abs_top_builddir)/font -F$(abs_top_srcdir)/font
607 TFLAG=-M$(abs_top_builddir)/tmac -M$(abs_top_srcdir)/tmac
608
609 # make builtin variable RM
610 if MAKE_DONT_HAVE_RM
611 RM = rm -f
612 endif
613
614 # 'VERSION' is generated by gnulib script git-version-gen, using the
615 # command 'git describe':
616 #
617 # - From a git repository: if the current commit corresponds to a
618 #   tag, then 'VERSION' is simply the tag (e.g. 1.22.3).  Otherwise
619 #   'VERSION' has the following format:
620 #     <tag>-<nb_commits>-<commit>
621 #
622 #   With:
623 #     . tag: the most recent tag reachable from the current commit
624 #     . nb_commits: number of commits between the most recent tag and
625 #       the current commit.
626 #     . current commit, abbreviated.
627 #   For example: 1.22.3.real.434-5aafd
628 #   The version is stored in .version.
629 #
630 # - From a tarball, the version is taken from .tarball-version
631 #
632 # REVISION is the full revision given by git-version-gen, which can
633 # have non-alphanumeric symbols.
634 #
635 # Also see configure.ac for the related SHORT_VERSION macro.
636
637 MAJOR_VERSION = `echo $(VERSION) | cut -d . -f 1`
638 MINOR_VERSION = `echo $(VERSION) | cut -d . -f 2`
639 REVISION      = `echo $(VERSION) | cut -d . -f 3`
640
641 # Non-recursive makefile system. See Automake manual '7.3 An
642 # Alternative Approach to Subdirectories'. We use a single Makefile.am
643 # that includes other .am files, rather than using SUBDIRS.  Note that
644 # relative paths in the following .am files are relative to the top
645 # source directory.
646
647 include $(top_srcdir)/lib/gnulib.mk
648 include $(top_srcdir)/arch/mingw/mingw.am
649 include $(top_srcdir)/arch/misc/misc.am
650 include $(top_srcdir)/contrib/chem/chem.am
651 include $(top_srcdir)/contrib/eqn2graph/eqn2graph.am
652 include $(top_srcdir)/contrib/gdiffmk/gdiffmk.am
653 include $(top_srcdir)/contrib/glilypond/glilypond.am
654 include $(top_srcdir)/contrib/gperl/gperl.am
655 include $(top_srcdir)/contrib/gpinyin/gpinyin.am
656 include $(top_srcdir)/contrib/grap2graph/grap2graph.am
657 include $(top_srcdir)/contrib/groff_filenames/groff_filenames.am
658 include $(top_srcdir)/contrib/groffer/groffer.am
659 include $(top_srcdir)/contrib/hdtbl/hdtbl.am
660 include $(top_srcdir)/contrib/mm/mm.am
661 include $(top_srcdir)/contrib/mom/mom.am
662 include $(top_srcdir)/contrib/pdfmark/pdfmark.am
663 include $(top_srcdir)/contrib/pic2graph/pic2graph.am
664 include $(top_srcdir)/doc/doc.am
665 include $(top_srcdir)/font/devX100/devX100.am
666 include $(top_srcdir)/font/devX100-12/devX100-12.am
667 include $(top_srcdir)/font/devX75/devX75.am
668 include $(top_srcdir)/font/devX75-12/devX75-12.am
669 include $(top_srcdir)/font/devascii/devascii.am
670 include $(top_srcdir)/font/devcp1047/devcp1047.am
671 include $(top_srcdir)/font/devdvi/devdvi.am
672 include $(top_srcdir)/font/devhtml/devhtml.am
673 include $(top_srcdir)/font/devlatin1/devlatin1.am
674 include $(top_srcdir)/font/devlbp/devlbp.am
675 include $(top_srcdir)/font/devlj4/devlj4.am
676 include $(top_srcdir)/font/devpdf/devpdf.am
677 include $(top_srcdir)/font/devps/devps.am
678 include $(top_srcdir)/font/devutf8/devutf8.am
679 include $(top_srcdir)/font/scripts/scripts.am
680 include $(top_srcdir)/man/man.am
681 include $(top_srcdir)/src/include/include.am
682 include $(top_srcdir)/src/libs/libbib/libbib.am
683 include $(top_srcdir)/src/libs/libdriver/libdriver.am
684 include $(top_srcdir)/src/libs/libgroff/libgroff.am
685 include $(top_srcdir)/src/libs/libxutil/libxutil.am
686 include $(top_srcdir)/src/devices/grodvi/grodvi.am
687 include $(top_srcdir)/src/devices/grohtml/grohtml.am
688 include $(top_srcdir)/src/devices/grolbp/grolbp.am
689 include $(top_srcdir)/src/devices/grolj4/grolj4.am
690 include $(top_srcdir)/src/devices/gropdf/gropdf.am
691 include $(top_srcdir)/src/devices/grops/grops.am
692 include $(top_srcdir)/src/devices/grotty/grotty.am
693 include $(top_srcdir)/src/devices/xditview/xditview.am
694 include $(top_srcdir)/src/preproc/eqn/eqn.am
695 include $(top_srcdir)/src/preproc/grn/grn.am
696 include $(top_srcdir)/src/preproc/html/html.am
697 include $(top_srcdir)/src/preproc/pic/pic.am
698 include $(top_srcdir)/src/preproc/preconv/preconv.am
699 include $(top_srcdir)/src/preproc/refer/refer.am
700 include $(top_srcdir)/src/preproc/soelim/soelim.am
701 include $(top_srcdir)/src/preproc/tbl/tbl.am
702 include $(top_srcdir)/src/roff/groff/groff.am
703 include $(top_srcdir)/src/roff/grog/grog.am
704 include $(top_srcdir)/src/roff/nroff/nroff.am
705 include $(top_srcdir)/src/roff/troff/troff.am
706 include $(top_srcdir)/src/utils/addftinfo/addftinfo.am
707 include $(top_srcdir)/src/utils/afmtodit/afmtodit.am
708 include $(top_srcdir)/src/utils/hpftodit/hpftodit.am
709 include $(top_srcdir)/src/utils/indxbib/indxbib.am
710 include $(top_srcdir)/src/utils/lkbib/lkbib.am
711 include $(top_srcdir)/src/utils/lookbib/lookbib.am
712 include $(top_srcdir)/src/utils/pfbtops/pfbtops.am
713 include $(top_srcdir)/src/utils/tfmtodit/tfmtodit.am
714 include $(top_srcdir)/src/utils/xtotroff/xtotroff.am
715 include $(top_srcdir)/tmac/tmac.am
716
717 # Adding defs.h to BUILT_SOURCES will ensure that it will be built on
718 # make all or make check before all other targets. However, if another
719 # target is built from a clean build tree, (for example make groff)
720 # the files in BUILT_SOURCES will not be built first. That is why
721 # additional dependencies where added in the .am files that lists
722 # objects that use defs (for exmaple in groff.am:
723 # src/roff/groff/groff.$(OBJEXT): defs.h)
724 BUILT_SOURCES += defs.h
725
726 # Force generation of test-groff even though we don't ship it.
727 BUILT_SOURCES += test-groff
728
729 # if there is a name prefix we install the man pages by hand
730 all: generate_man_files
731 install-data-hook: install-prefix-man
732 uninstall-hook: uninstall-prefix-man
733 if USEPROGRAMPREFIX
734 generate_man_files: $(PREFIXMAN1)
735 install-prefix-man:
736         for f in $(PREFIXMAN1); do \
737           cp -f $$f $(DESTDIR)$(man1dir)/$(NAMEPREFIX)`basename $$f`; \
738         done
739 uninstall-prefix-man:
740         for f in $(PREFIXMAN1); do \
741           rm -f $(DESTDIR)$(man1dir)/$(NAMEPREFIX)`basename $$f`; \
742         done
743 else
744 man1_MANS += $(PREFIXMAN1)
745 install-prefix-man:
746 uninstall-prefix-man:
747 generate_man_files:
748 endif
749
750 # Hook to create the 'current' symlink
751 install-data-hook: create_current_symlink
752 create_current_symlink:
753         cd $(DESTDIR)$(dataprogramdir); \
754           rm -f current; \
755           $(LN_S) $(SHORT_VERSION) current
756
757 # Hook to move the binaries that potentially have a prefix from
758 # prefixexecbindir to bindir.
759 install-exec-hook: move_binaries_with_prefix
760 move_binaries_with_prefix:
761 if USEPROGRAMPREFIX
762         if test -n "$(NAMEPREFIX)"; then \
763            for f in $(prefixexecbin_PROGRAMS) $(prefixexecbin_SCRIPTS); do \
764               mv -f $(DESTDIR)$(prefixexecbindir)/$$f$(EXEEXT) \
765                  $(DESTDIR)$(bindir)/$(NAMEPREFIX)$$f$(EXEEXT); \
766            done \
767         fi
768 endif
769
770 # Always create the site-font directory as a guide to the user.
771 install-data-hook: install_site_font
772 install_site_font:
773         -test -d $(DESTDIR)$(localfontdir) \
774           || $(mkinstalldirs) $(DESTDIR)$(localfontdir)
775
776 # Create systemtmacdir if not present
777 install-data-hook: install_tmacdir
778 install_tmacdir:
779         -test -d $(DESTDIR)$(systemtmacdir) \
780           || $(mkinstalldirs) $(DESTDIR)$(systemtmacdir)
781
782 # directories specific to groff
783 uninstall-hook: uninstall_groffdirs
784 uninstall_groffdirs:
785         if test -d $(DESTDIR)$(datasubdir); then \
786           rm -rf $(DESTDIR)$(fontdir); \
787           rm -rf $(DESTDIR)$(oldfontdir); \
788           rmdir $(DESTDIR)$(datasubdir); \
789         fi
790         if test -d $(DESTDIR)$(dataprogramdir); then \
791           if test -h $(DESTDIR)$(dataprogramdir)/current; then \
792             rm -f $(DESTDIR)$(dataprogramdir)/current; \
793           fi; \
794           if test -d $(DESTDIR)$(localfontdir); then \
795             rm -f $(DESTDIR)$(localfontdir)/*; \
796             rmdir $(DESTDIR)$(localfontdir); \
797           fi; \
798           rmdir $(DESTDIR)$(dataprogramdir); \
799         fi
800         if test -d $(DESTDIR)$(grog_dir); then \
801           rmdir $(DESTDIR)$(grog_dir); \
802         fi
803         if test -d $(DESTDIR)$(libprogramdir); then \
804           if test -d $(DESTDIR)$(systemtmacdir); then \
805             rm -f $(DESTDIR)$(systemtmacdir)/*; \
806             rmdir $(DESTDIR)$(systemtmacdir); \
807           fi; \
808           rmdir $(DESTDIR)$(libprogramdir); \
809         fi
810         if test -d $(DESTDIR)$(docdir); then \
811           if test -d $(DESTDIR)$(exampledir); then \
812             rmdir $(DESTDIR)$(exampledir); \
813           fi; \
814           if test -d $(DESTDIR)$(htmldocdir); then \
815             rmdir $(DESTDIR)$(htmldocdir); \
816           fi; \
817           rmdir $(DESTDIR)$(docdir); \
818         fi
819
820 # Uninstall program that have a 'g' prefix
821 uninstall-hook: uninstall_binaries_with_prefix
822 uninstall_binaries_with_prefix:
823 if USEPROGRAMPREFIX
824         if test -n "$(NAMEPREFIX)"; then \
825            for f in $(prefixexecbin_PROGRAMS) $(prefixexecbin_SCRIPTS); do \
826               rm -f $(DESTDIR)$(bindir)/$(NAMEPREFIX)$$f$(EXEEXT); \
827            done; \
828         fi
829 endif
830
831 # Other files that should be present in the distribution tarball.
832 EXTRA_DIST += \
833   BUG-REPORT \
834   ChangeLog.115 \
835   ChangeLog.116 \
836   ChangeLog.117 \
837   ChangeLog.118 \
838   ChangeLog.119 \
839   ChangeLog.120 \
840   ChangeLog.121 \
841   FDL \
842   FOR-RELEASE \
843   gendef.sh \
844   INSTALL.REPO \
845   INSTALL.extra \
846   LICENSES \
847   MANIFEST \
848   mdate.pl \
849   MORE.STUFF \
850   PROBLEMS \
851   PROJECTS \
852   README.MinGW \
853   arch/djgpp \
854   font/util/make-Rproto \
855   makevarescape.sed
856
857 MOSTLYCLEANFILES += $(prefixexecbin_SCRIPTS) $(bin_SCRIPTS) \
858   $(man1_MANS) $(man5_MANS) $(man7_MANS) \
859   $(PREFIXMAN1) \
860   test-groff
861
862 # Suffix rule to build .1, .5 and .7 files from .1.man, .5.man and
863 # .7.man files.  The brackets around the @ are used to prevent the
864 # substitution of the variable by automake.
865 #
866 # The sed script transforms - to \-, ~ to \(ti, and so forth, (with an
867 # extra layer of backslashes--see below) so that Makefile variables
868 # containing ASCII characters that do not represent themselves literally
869 # in *roff (see groff_char(7)) are correctly interpolated into man page
870 # text.
871 #
872 # Note that while the script, combined with this target, will transform
873 # ` to \(ga, including grave accents in Makefile variables is likely to
874 # fail when the shell lexes the argument to echo within the old-style
875 # command substitution `` below.  Testing shows that grave accents
876 # should work* if POSIX-style command substitution $() is done instead.
877 # However, $() is less portable.  (Triple-escaping grave accents \\\`
878 # inside the interpolated Makefile variable will work, but is not
879 # attempted here.)
880 #
881 # Note also that the amount of backslash-escaping in the sed script is
882 # excessive (and incorrect) for normal purposes, but required here
883 # because a command substitution is being nested inside yet another
884 # invocation of sed.
885 #
886 # * For this target; no assurances about the good behavior of unusual
887 #   characters in Makefile variables in other aspects of the groff build
888 #   are offered.
889 makevarescape=$(top_srcdir)/makevarescape.sed
890
891 SUFFIXES += .man
892 .man:
893         $(AM_V_GEN)rm -f $@ \
894         && $(MKDIR_P) `dirname $@` \
895         && LC_ALL=C \
896          sed -e "s|[@]APPRESDIR[@]|`echo $(appresdir) | sed -f $(makevarescape)`|g" \
897              -e "s|[@]BINDIR[@]|`echo $(bindir) | sed -f $(makevarescape)`|g" \
898              -e "s|[@]COMMON_WORDS_FILE[@]|`echo $(common_words_file) | sed -f $(makevarescape)`|g" \
899              -e "s|[@]DATASUBDIR[@]|`echo $(datasubdir) | sed -f $(makevarescape)`|g" \
900              -e "s|[@]DEFAULT_INDEX[@]|`echo $(indexdir)/$(indexname) | sed -f $(makevarescape)`|g" \
901              -e "s|[@]DEFAULT_INDEX_NAME[@]|`echo $(indexname) | sed -f $(makevarescape)`|g" \
902              -e "s|[@]DEVICE[@]|$(DEVICE)|g" \
903              -e "s|[@]DOCDIR[@]|`echo $(docdir) | sed -f $(makevarescape)`|g" \
904              -e "s|[@]EXAMPLEDIR[@]|`echo $(exampledir) | sed -f $(makevarescape)`|g" \
905              -e "s|[@]FONTDIR[@]|`echo $(fontdir) | sed -f $(makevarescape)`|g" \
906              -e "s|[@]g[@]|$(g)|g" \
907              -e "s![@]G[@]!`echo $(g) | tr '[a-z]' '[A-Z]'`!g" \
908              -e "s|[@]HTMLDOCDIR[@]|`echo $(htmldocdir) | sed -f $(makevarescape)`|g" \
909              -e "s|[@]INDEX_SUFFIX[@]|$(indexext)|g" \
910              -e "s|[@]LEGACYFONTDIR[@]|`echo $(legacyfontdir) | sed -f $(makevarescape)`|g" \
911              -e "s|[@]LOCALFONTDIR[@]|`echo $(localfontdir) | sed -f $(makevarescape)`|g" \
912              -e "s|[@]LOCALMACRODIR[@]|`echo $(localtmacdir) | sed -f $(makevarescape)`|g" \
913              -e "s|[@]MACRODIR[@]|`echo $(tmacdir) | sed -f $(makevarescape)`|g" \
914              -e "s|[@]MAN1EXT[@]|$(man1ext)|g" \
915              -e "s|[@]MAN5EXT[@]|$(man5ext)|g" \
916              -e "s|[@]MAN7EXT[@]|$(man7ext)|g" \
917              -e "s|[@]MDATE[@]|`$(PERL) $(top_srcdir)/mdate.pl $<`|g" \
918              -e "s|[@]OLDFONTDIR[@]|`echo $(oldfontdir) | sed -f $(makevarescape)`|g" \
919              -e "s|[@]PDFDOCDIR[@]|`echo $(pdfdocdir) | sed -f $(makevarescape)`|g" \
920              -e "s|[@]SYSTEMMACRODIR[@]|`echo $(systemtmacdir) | sed -f $(makevarescape)`|g" \
921              -e "s|[@]TMAC_AN_PREFIX[@]|$(tmac_an_prefix)|g" \
922              -e "s|[@]TMAC_M_PREFIX[@]|$(tmac_m_prefix)|g" \
923              -e "s|[@]TMAC_MDIR[@]|$(tmacdir)/mm|g" \
924              -e "s|[@]TMAC_S_PREFIX[@]|$(tmac_s_prefix)|g" \
925              -e "s|[@]VERSION[@]|$(VERSION)|g" \
926              $< \
927              >$@
928
929 # Version files - see script 'build-aux/git-gen-version'
930 EXTRA_DIST += $(top_srcdir)/.version
931 BUILT_SOURCES += $(top_srcdir)/.version
932 $(top_srcdir)/.version:
933         echo $(VERSION) > $@-t && mv $@-t $@
934 dist-hook:
935         echo $(VERSION) > $(distdir)/.tarball-version
936
937 ########################################################################
938 ### Emacs settings
939 # Local Variables:
940 # mode: makefile-automake
941 # End: