1 # Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2 # Written by James Clark (jjc@jclark.com)
4 # This file is part of groff.
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2, or (at your option) any later
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 # You should have received a copy of the GNU General Public License along
17 # with groff; see the file COPYING. If not, write to the Free Software
18 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 top_srcdir
=@abs_top_srcdir@
25 top_builddir
=@abs_top_builddir@
28 version
=`cat $(top_srcdir)/VERSION`
29 # No additional number if revision is zero.
30 revision
=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
32 # Define `page' to be letter if your PostScript printer uses 8.5x11
33 # paper (USA) and define it to be A4, if it uses A4 paper (rest of the
37 # Normally the Postscript driver, grops, produces output that conforms
38 # to version 3.0 of the Adobe Document Structuring Conventions.
39 # Unfortunately some spoolers and previewers can't handle such output.
40 # The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
41 # make its output acceptable to such programs. This variable controls
42 # only the default behaviour of grops; the behaviour can be changed at
43 # runtime by the grops -b option (and so by groff -P-b).
44 # Use a value of 0 if your spoolers and previewers are able to handle
45 # conforming PostScript correctly.
46 # Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
47 # this is needed for early versions of TranScript that get confused by
48 # anything between the %%EndProlog line and the first %%Page: comment.
49 # Add 2 if lines in included files beginning with %! should be
50 # stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
51 # Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
52 # stripped out of included files; this is needed for spoolers that
53 # don't understand the %%{Begin,End}Document comments. I suspect this
54 # includes early versions of TranScript.
55 # Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
56 # rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
57 # with a printer that requires page reversal.
58 BROKEN_SPOOLER_FLAGS
=@BROKEN_SPOOLER_FLAGS@
60 # `DEVICE' is the default device.
63 # `TTYDEVDIRS' is either `font/devascii font/devlatin1' (for
64 # ASCII) or `font/devcp1047' (for EBCDIC) plus font/devutf8.
65 TTYDEVDIRS
=@TTYDEVDIRS@ font
/devutf8
67 # `OTHERDEVDIRS' is either `font/devlj4 font/devlbp' (for ASCII) or
69 OTHERDEVDIRS
=@OTHERDEVDIRS@
71 # `PSPRINT' is the command to use for printing a PostScript file,
75 # `DVIPRINT' is the command to use for printing a TeX dvi file,
76 # for example `lpr -d'.
79 # Prefix for names of programs that have Unix counterparts.
80 # For example, if `g' is `g' then troff will be installed as
81 # gtroff. This doesn't affect programs like grops or groff that have
82 # no Unix counterparts. Note that the groff versions of eqn and tbl
83 # will not work with Unix troff.
86 # Common prefix for installation directories.
87 # Used in definitions of exec_prefix, datasubdir, fontpath, manroot.
88 # This must already exist when you do make install.
90 exec_prefix=@
exec_prefix@
92 # `bindir' says where to install executables.
95 # `libdir' says where to install platform-dependent data.
97 libprogramdir
=$(libdir)/groff
99 # `datasubdir' says where to install platform-independent data files.
101 dataprogramdir
=$(datadir)/groff
102 datasubdir
=$(dataprogramdir
)/$(version
)$(revision
)
104 # `infodir' says where to install info files.
107 # `docdir' says where to install documentation files.
108 docdir
=$(datadir)/doc
/groff
/$(version
)$(revision
)
110 # `exampledir' says where to install example files.
111 exampledir
=$(docdir
)/examples
113 # `htmldocdir' says where to install documentation in HTML format.
114 htmldocdir
=$(docdir
)/html
116 # `fontdir' says where to install dev*/*.
117 fontdir
=$(datasubdir
)/font
119 # `localfontdir' says where local fonts will be installed (as dev*/*).
120 localfontdir
=$(dataprogramdir
)/site-font
122 # `legacyfontdir' is for compatibility with non-GNU troff.
123 legacyfontdir
=/usr
/lib
/font
125 # `fontpath' says where to look for dev*/*.
126 fontpath
=$(localfontdir
)$(SEP
)$(fontdir
)$(SEP
)$(legacyfontdir
)
128 # `tmacdir' says where to install macros.
129 tmacdir
=$(datasubdir
)/tmac
131 # `systemtmacdir' says where to install platform-dependent macros.
132 systemtmacdir
=$(libprogramdir
)/site-tmac
134 # `localtmacdir' says where local files will be installed.
135 localtmacdir
=$(dataprogramdir
)/site-tmac
137 # `tmacpath' says where to look for macro files.
138 # The current directory will be prepended in unsafe mode only; the home
139 # directory will be always added.
140 # `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the
141 # current nor in the home directory.
142 tmacpath
=$(systemtmacdir
)$(SEP
)$(localtmacdir
)$(SEP
)$(tmacdir
)
144 # `sys_tmac_prefix' is prefix (if any) for system macro packages.
145 sys_tmac_prefix
=@sys_tmac_prefix@
147 # `pnmtops_nosetpage' is the command to be run to generate an eps
148 # file. Some versions of pnmtops provide the -nosetpage option.
149 # We detect this and use it if present.
150 pnmtops_nosetpage
=@pnmtops_nosetpage@
152 # `tmac_wrap' is list of system macro packages that should be made
153 # available to groff by creating a corresponding macro package
154 # in the groff macro directory that references the system macro
156 tmac_wrap
=@tmac_wrap@
158 # If there is a groff version of a macro package listed in $(tmac_wrap),
159 # then the groff version will be installed with a prefix of this.
160 # Don't make this empty.
163 # The groff -mm macros will be available as -m$(tmac_m_prefix)m.
165 `for i in $(tmac_wrap) ""; do case "$$i" in m) echo $(tmac_prefix);; esac; done`
166 # The groff -ms macros will be available as -m$(tmac_s_prefix)s.
168 `for i in $(tmac_wrap) ""; do case "$$i" in s) echo $(tmac_prefix);; esac; done`
169 # The groff -man macros will be available as -m$(tmac_an_prefix)an.
171 `for i in $(tmac_wrap) ""; do case "$$i" in an) echo $(tmac_prefix);; esac; done`
173 # Extension to be used for refer index files. Index files are not
174 # sharable between different architectures, so you might want to use
175 # different suffixes for different architectures. Choose an extension
176 # that doesn't conflict with refer or any other indexing program.
179 # Directory containing the default index for refer.
180 indexdir
=/usr
/dict
/papers
182 # The filename (without suffix) of the default index for refer.
185 # common_words_file is a file containing a list of common words.
186 # If your system provides /usr/lib/eign it will be copied onto this,
187 # otherwise the supplied eign file will be used.
188 common_words_file
=$(datasubdir
)/eign
190 # `manroot' is the root of the man page directory tree.
194 # `man1ext' is the man section for user commands.
196 man1dir=$(manroot
)/man
$(man1ext)
198 # `man5ext' is the man section for file formats.
200 man5dir=$(manroot
)/man
$(man5ext)
202 # `man7ext' is the man section for macros.
204 man7dir=$(manroot
)/man
$(man7ext)
206 # The configure script checks whether all necessary utility programs for
207 # grohtml are available -- only then we can build the HTML documentation.
208 make_html
=@make_html@
209 make_install_html
=@make_install_html@
211 # DEFINES should include the following:
212 # -DHAVE_MMAP if you have mmap() and <sys/mman.h>
213 # -DARRAY_DELETE_NEEDS_SIZE if your C++ doesn't understand `delete []'
214 # -DSYS_SIGLIST_DECLARED if you have sys_siglist[]
215 # -DWCOREFLAG=0200 if the 0200 bit of the status returned by
216 # wait() indicates whether a core image was
217 # produced for a process that was terminated
220 # -DHAVE_DIRENT_H if you have <dirent.h>
221 # -DHAVE_LIMITS_H if you have <limits.h>
222 # -DHAVE_CC_LIMITS_H if you have a C++ <limits.h>
223 # -DHAVE_MATH_H if you have <math.h>
224 # -DHAVE_CC_OSFCN_H if you have a C++ <osfcn.h>
225 # -DHAVE_CC_STDINT_H if you have a C++ <stdint.h>
226 # -DHAVE_STDLIB_H if you have <stdlib.h>
227 # -DHAVE_STRING_H if you have <string.h>
228 # -DHAVE_STRINGS_H if you have <strings.h>
229 # -DHAVE_SYS_DIR_H if you have <sys/dir.h>
230 # -DHAVE_SYS_TIME_H if you have <sys/time.h>
231 # -DHAVE_UNISTD_H if you have <unistd.h>
233 # -DHAVE_FMOD if you have fmod()
234 # -DHAVE_GETCWD if you have getcwd()
235 # -DHAVE_GETTIMEOFDAY if you have gettimeofday()
236 # -DHAVE_ISATTY if you have isatty()
237 # -DHAVE_KILL if you have kill()
238 # -DHAVE_MKSTEMP if you have mkstemp()
239 # -DHAVE_MMAP if you have mmap()
240 # -DHAVE_PUTENV if you have putenv()
241 # -DHAVE_RENAME if you have rename()
242 # -DHAVE_SETLOCALE if you have setlocale()
243 # -DHAVE_SNPRINTF if you have snprintf()
244 # -DHAVE_STRCASECMP if you have strcasecmp()
245 # -DHAVE_STRNCASECMP if you have strncasecmp()
246 # -DHAVE_STRERROR if you have strerror()
247 # -DHAVE_STRSEP if you have strsep()
248 # -DHAVE_STRTOL if you have strtol()
249 # -DHAVE_VSNPRINTF if you have vsnprintf()
251 # -DNEED_DECLARATION_GETTIMEOFTODAY
252 # if your C++ <sys/time.h> doesn't declare
254 # -DNEED_DECLARATION_HYPOT if your C++ <math.h> doesn't declare hypot()
255 # -DNEED_DECLARATION_PCLOSE if your C++ <stdio.h> doesn't declare pclose()
256 # -DNEED_DECLARATION_POPEN if your C++ <stdio.h> doesn't declare popen()
257 # -DNEED_DECLARATION_PUTENV if your C++ <stdlib.h> doesn't declare
259 # -DNEED_DECLARATION_RAND if your C++ <stdlib.h> doesn't declare rand()
260 # -DNEED_DECLARATION_SNPRINTF if your C++ <stdio.h> doesn't declare
262 # -DNEED_DECLARATION_SRAND if your C++ <stdlib.h> doesn't declare srand()
263 # -DNEED_DECLARATION_STRCASECMP if your C++ <string.h> doesn't declare
265 # -DNEED_DECLARATION_STRNCASECMP
266 # if your C++ <string.h> doesn't declare
268 # -DNEED_DECLARATION_VFPRINTF if your C++ <stdio.h> doesn't declare
270 # -DNEED_DECLARATION_VSNPRINTF if your C++ <stdio.h> doesn't declare
273 # -DRET_TYPE_SRAND_IS_VOID if srand() returns void not int
274 # -DHAVE_SYS_NERR if you have sysnerr in <errno.h> or <stdio.h>
275 # -DHAVE_SYS_ERRLIST if you have sys_errlist in <errno.h> or
277 # -DTRADITIONAL_CPP if your C++ compiler uses a traditional
278 # (Reiser) preprocessor
279 # -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t *
280 # -DHAVE_STRUCT_EXCEPTION if <math.h> defines struct exception
281 # -DRETSIGTYPE=int if signal handlers return int not void
282 # -DIS_EBCDIC_HOST if the host's encoding is EBCDIC
283 # -DPAGEA4 if the the printer's page size is A4
288 # {fmod,getcwd,mkstemp,putenv,snprintf,strcasecmp,
289 # strerror,strncasecmp,strtol}.$(OBJEXT)
291 # in LIBOBJS if your C library is missing the corresponding function.
292 # vsnprintf is defined in the snprintf.$(OBJEXT) module.
295 # `CCC' is the compiler for C++ (.cpp) files.
298 # CCDEFINES are definitions for C++ compilations.
300 # CDEFINES are definitions for C compilations.
311 # a simple heuristic assumption
312 LIBEXT
=`case $(OBJEXT) in obj) echo lib;; *) echo a;; esac`
317 INSTALL_PROGRAM
=@INSTALL_PROGRAM@
318 INSTALL_SCRIPT
=@INSTALL_SCRIPT@
319 INSTALL_DATA
=@INSTALL_DATA@
320 INSTALL_INFO
=@INSTALL_INFO@
325 # Flag that tells etags to assume C++.
329 # Sed command with which to edit sh scripts.
330 SH_SCRIPT_SED_CMD
=@SH_SCRIPT_SED_CMD@
332 # The program to create directory hierarchies.
333 mkinstalldirs
= $(SHELL
) $(top_srcdir
)/mkinstalldirs
337 #PURIFYCCFLAGS=-g++=yes \
338 # -collector=`dirname \`$(CCC) -print-libgcc-file-name\``/ld
340 # Passing down MAKEOVERRIDES prevents $(MAKE) from containing a second
341 # copy of $(MDEFINES) when making individual directories; this could
342 # cause the argument list to become too long on some systems.
345 "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
348 "CCDEFINES=$(CCDEFINES)" \
349 "CCFLAGS=$(CCFLAGS)" \
350 "CDEFINES=$(CDEFINES)" \
353 "DVIPRINT=$(DVIPRINT)" \
355 "ETAGSCCFLAG=$(ETAGSCCFLAG)" \
356 "ETAGSFLAGS=$(ETAGSFLAGS)" \
358 "INSTALL_DATA=$(INSTALL_DATA)" \
359 "INSTALL_INFO=$(INSTALL_INFO)" \
360 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
361 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
362 "LDFLAGS=$(LDFLAGS)" \
365 "LIBOBJS=$(LIBOBJS)" \
367 "MAKEOVERRIDES=$(MAKEOVERRIDES)" \
369 "OTHERDEVDIRS=$(OTHERDEVDIRS)" \
371 "PERLPATH=$(PERLPATH)" \
372 "PSPRINT=$(PSPRINT)" \
374 "PURIFYCCFLAGS=$(PURIFYCCFLAGS)" \
378 "SH_SCRIPT_SED_CMD=$(SH_SCRIPT_SED_CMD)" \
379 "TTYDEVDIRS=$(TTYDEVDIRS)" \
381 "YACCFLAGS=$(YACCFLAGS)" \
383 "common_words_file=$(common_words_file)" \
384 "datadir=$(datadir)" \
385 "dataprogramdir=$(dataprogramdir)" \
386 "datasubdir=$(datasubdir)" \
388 "exampledir=$(exampledir)" \
389 "exec_prefix=$(exec_prefix)" \
390 "fontdir=$(fontdir)" \
391 "fontpath=$(fontpath)" \
393 "htmldocdir=$(htmldocdir)" \
394 "indexdir=$(indexdir)" \
395 "indexext=$(indexext)" \
396 "indexname=$(indexname)" \
397 "infodir=$(infodir)" \
398 "legacyfontdir=$(legacyfontdir)" \
400 "libprogramdir=$(libprogramdir)" \
401 "localfontdir=$(localfontdir)" \
402 "localtmacdir=$(localtmacdir)" \
403 "make_html=$(make_html)" \
404 "make_install_html=$(make_install_html)" \
405 "man1dir=$(man1dir)" \
406 "man1ext=$(man1ext)" \
407 "man5dir=$(man5dir)" \
408 "man5ext=$(man5ext)" \
409 "man7dir=$(man7dir)" \
410 "man7ext=$(man7ext)" \
411 "manroot=$(manroot)" \
412 "mkinstalldirs=$(mkinstalldirs)" \
414 "revision=$(revision)" \
415 "sys_tmac_prefix=$(sys_tmac_prefix)" \
416 "pnmtops_nosetpage=$(pnmtops_nosetpage)" \
417 "systemtmacdir=$(systemtmacdir)" \
418 "tmac_an_prefix=$(tmac_an_prefix)" \
419 "tmac_m_prefix=$(tmac_m_prefix)" \
420 "tmac_s_prefix=$(tmac_s_prefix)" \
421 "tmac_wrap=$(tmac_wrap)" \
422 "tmacdir=$(tmacdir)" \
423 "tmacpath=$(tmacpath)" \
424 "top_builddir=$(top_builddir)" \
425 "top_srcdir=$(top_srcdir)" \
447 src
/devices
/grohtml \
455 CPROGDIRS
=src
/utils
/pfbtops
456 PROGDIRS
=$(CCPROGDIRS
) $(CPROGDIRS
)
483 ALLDIRS
=$(INCDIRS
) $(LIBDIRS
) $(PROGDIRS
) \
484 $(DEVDIRS
) $(OTHERDEVDIRS
) $(TTYDEVDIRS
) $(OTHERDIRS
)
486 font
/devps
/generate \
487 font
/devdvi
/generate \
488 font
/devlj4
/generate \
493 contrib
/mm
/examples \
495 contrib
/mom
/examples \
499 $(INCDIRS
) $(LIBDIRS
) $(PROGDIRS
) $(DEVDIRS
) $(OTHERDEVDIRS
) \
500 $(ALLTTYDEVDIRS
) $(OTHERDIRS
) $(EXTRADIRS
) $(NOMAKEDIRS
)
501 TARGETS
=all install install_bin
install_data clean distclean mostlyclean \
502 realclean extraclean distfiles TAGS depend uninstall_sub
504 # This ENVSETUP gork is required by the DJGPP build on Windows 9X,
505 # where Make needs to be case-sensitive to find files like BI and VERSION.
507 if
test -f
$(srcdir)/makefile.ccpg
* && \
508 test -f
$(srcdir)/Makefile.ccpg
*; then \
509 FNCASE
=y
; export FNCASE
; \
514 dodirs
=$(ALLDIRS
) dot
515 # Default target for subdir_Makefile
516 subdir
=src
/roff
/troff
520 @
$(ENVSETUP
); $(MAKE
) $(MDEFINES
) do
=$@
$(dodirs
)
524 $(MAKE
) $(MDEFINES
) srcdir=$(srcdir) VPATH
=$(srcdir) \
525 -f
$(top_srcdir
)/Makefile.comm \
526 -f
$(top_srcdir
)/Makefile.sub
$(do
)
530 if
test $(srcdir) = .
; then \
533 srcdir=`cd $(srcdir); pwd`/$@
; \
535 test -d
$@ ||
$(mkinstalldirs
) $@
; \
537 test -f Makefile.dep || touch Makefile.dep
; \
538 $(MAKE
) $(MDEFINES
) srcdir=$$srcdir VPATH
=$$srcdir \
539 -f
$(top_srcdir
)/Makefile.comm \
540 -f
$$srcdir/Makefile.sub \
541 -f
$(top_srcdir
)/Makefile.lib \
542 -f Makefile.dep
$(do
)
546 if
test $(srcdir) = .
; then \
549 srcdir=`cd $(srcdir); pwd`/$@
; \
551 test -d
$@ ||
$(mkinstalldirs
) $@
; \
553 test -f Makefile.dep || touch Makefile.dep
; \
554 $(MAKE
) $(MDEFINES
) srcdir=$$srcdir VPATH
=$$srcdir \
555 -f
$(top_srcdir
)/Makefile.comm \
556 -f
$$srcdir/Makefile.sub \
557 -f
$(top_srcdir
)/Makefile.cpg \
558 -f Makefile.dep
$(do
)
562 if
test $(srcdir) = .
; then \
565 srcdir=`cd $(srcdir); pwd`/$@
; \
567 test -d
$@ ||
$(mkinstalldirs
) $@
; \
569 test -f Makefile.dep || touch Makefile.dep
; \
570 $(MAKE
) $(MDEFINES
) srcdir=$$srcdir VPATH
=$$srcdir \
571 -f
$(top_srcdir
)/Makefile.comm \
572 -f
$$srcdir/Makefile.sub \
573 -f
$(top_srcdir
)/Makefile.ccpg \
574 -f Makefile.dep
$(do
)
576 $(DEVDIRS
) $(OTHERDEVDIRS
) $(TTYDEVDIRS
): FORCE
578 if
test $(srcdir) = .
; then \
581 srcdir=`cd $(srcdir); pwd`/$@
; \
583 test -d
$@ ||
$(mkinstalldirs
) $@
; \
585 $(MAKE
) $(MDEFINES
) srcdir=$$srcdir VPATH
=$$srcdir \
586 -f
$(top_srcdir
)/Makefile.comm \
587 -f
$$srcdir/Makefile.sub \
588 -f
$(top_srcdir
)/Makefile.dev
$(do
)
590 $(INCDIRS
) $(OTHERDIRS
): FORCE
592 if
test $(srcdir) = .
; then \
595 srcdir=`cd $(srcdir); pwd`/$@
; \
597 test -d
$@ ||
$(mkinstalldirs
) $@
; \
599 $(MAKE
) $(MDEFINES
) srcdir=$$srcdir VPATH
=$$srcdir \
600 -f
$(top_srcdir
)/Makefile.comm \
601 -f
$$srcdir/Makefile.sub \
602 -f
$(top_srcdir
)/Makefile.man
$(do
)
607 rm -f groff-
$(version
)$(revision
).
tar.gz
609 for d in
$(DISTDIRS
); do \
610 $(mkinstalldirs
) tmp
/$$d; \
612 srcdir=`cd $(srcdir); pwd`; \
614 $(LN_S
) ..
/Makefile .
; \
615 $(LN_S
) $$srcdir/* .
2>/dev
/null || true
; \
617 for d in
$(DISTDIRS
); do \
619 $(LN_S
) $$srcdir/$$d/* .
2>/dev
/null
; \
620 rm -rf CVS || true
); \
622 $(MAKE
) srcdir=. VPATH
=. distfiles
; \
623 $(MAKE
) srcdir=. VPATH
=. extraclean
; \
624 for d in
$(EXTRADIRS
); do \
625 (cd
$$d; $(MAKE
) extraclean
); \
628 $(LN_S
) $$srcdir/Makefile.init Makefile
629 mv tmp groff-
$(version
)$(revision
)
630 tar cfh
- groff-
$(version
)$(revision
) | \
631 gzip
-c
>groff-
$(version
)$(revision
).
tar.gz
632 rm -fr groff-
$(version
)$(revision
)
634 # $(PROGDIRS): libgroff
635 # grops grotty grodvi: libdriver
636 # refer lookbib indxbib lkbib: libbib
637 # $(LIBDIRS) $(PROGDIRS): include
639 .PHONY
: $(ALLDIRS
) dot
$(TARGETS
) FORCE
641 # Create a Makefile in $(subdir). This is useful for development since it
642 # avoids running make recursively.
643 subdir_Makefile
: Makefile.cfg
644 $(MAKE
) do
=Makefile
$(subdir
)
646 Makefile.cfg
: Makefile
648 for var in
$(MDEFINES
); do \
649 echo
"$$var" >>Makefile.cfg
; \
652 Makefile
: Makefile.in
653 $(SHELL
) config.status
656 uninstall: uninstall_sub uninstall_dirs
658 .PHONY
: uninstall_dirs
660 # Use `rmdir' here so that the directories are only removed if they are empty.
661 -rmdir
$(man1dir) $(man5dir) $(man7dir) $(manroot
) \
662 $(tmacdir
) $(systemtmacdir
) $(localtmacdir
) \
663 $(fontdir
) $(localfontdir
) $(bindir) \
664 $(datasubdir
) $(dataprogramdir
) $(datadir) $(infodir) \
665 $(exampledir
) $(htmldocdir
) $(docdir
) \
666 $(libprogramdir
) $(libdir)