Makefile.in revision 75584
1# Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
2#      Written by James Clark (jjc@jclark.com)
3# 
4# This file is part of groff.
5# 
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
9# version.
10# 
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
14# for more details.
15# 
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.
19
20srcdir=@srcdir@
21top_srcdir=@top_srcdir@
22VPATH=@srcdir@
23top_builddir=@top_builddir@
24
25version=`cat $(top_srcdir)/VERSION`
26# No additional number if revision is zero
27revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
28
29# Define `page' to be letter if your PostScript printer uses 8.5x11
30# paper (USA) and define it to be A4, if it uses A4 paper (rest of the
31# world).
32PAGE=@PAGE@
33
34# Normally the Postscript driver, grops, produces output that conforms
35# to version 3.0 of the Adobe Document Structuring Conventions.
36# Unfortunately some spoolers and previewers can't handle such output.
37# The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
38# make its output acceptable to such programs.  This variable controls
39# only the default behaviour of grops; the behaviour can be changed at
40# runtime by the grops -b option (and so by groff -P-b).
41# Use a value of 0 if your spoolers and previewers are able to handle
42# conforming PostScript correctly.
43# Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
44# this is needed for early versions of TranScript that get confused by
45# anything between the %%EndProlog line and the first %%Page: comment.
46# Add 2 if lines in included files beginning with %! should be
47# stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
48# Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
49# stripped out of included files; this is needed for spoolers that
50# don't understand the %%{Begin,End}Document comments. I suspect this
51# includes early versions of TranScript.
52# Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
53# rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
54# with a printer that requires page reversal.
55BROKEN_SPOOLER_FLAGS=@BROKEN_SPOOLER_FLAGS@
56
57# DEVICE is the default device.
58DEVICE=ps
59
60# TTYDEVDIRS is either `font/devascii font/devlatin1 font/devutf8' (for
61# ASCII) or `font/devcp1047' (for EBCDIC).
62TTYDEVDIRS=@TTYDEVDIRS@
63
64# PSPRINT is the command to use for printing a PostScript file,
65# for example `lpr'.
66PSPRINT=@PSPRINT@
67
68# DVIPRINT is the command to use for printing a TeX dvi file,
69# for example `lpr -d'.
70DVIPRINT=@DVIPRINT@
71
72# Prefix for names of programs that have Unix counterparts.
73# For example, if `g' is `g' then troff will be installed as
74# gtroff.  This doesn't affect programs like grops or groff that have
75# no Unix counterparts.  Note that the groff versions of eqn and tbl
76# will not work with Unix troff.
77g=@g@
78
79# Common prefix for installation directories.
80# Used in definitions of exec_prefix, datasubdir, fontpath, manroot.
81# This must already exist when you do make install.
82prefix=@prefix@
83exec_prefix=@exec_prefix@
84
85# bindir says where to install executables.
86bindir=@bindir@
87
88# libdir says where to install platform-dependent data
89libdir=@libdir@
90libprogramdir=$(libdir)/groff
91
92# datasubdir says where to install platform-independent data files
93datadir=@datadir@
94dataprogramdir=$(datadir)/groff
95datasubdir=$(dataprogramdir)/$(version)$(revision)
96
97# fontdir says where to install dev*/*.
98fontdir=$(datasubdir)/font
99
100# fontpath says where to look for dev*/*.
101fontpath=$(fontdir):/usr/lib/font
102
103# tmacdir says where to install macros.
104tmacdir=$(datasubdir)/tmac
105
106# systemtmacdir says where to install platform-dependent macros
107systemtmacdir=$(libprogramdir)/site-tmac
108
109# localtmacdir says where local files will be installed
110localtmacdir=$(dataprogramdir)/site-tmac
111
112# tmacpath says where to look for macro files.
113# The current directory will be prepended in unsafe mode only; the home
114# directory will be always added.
115# `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the
116# current nor in the home directory.
117tmacpath=$(systemtmacdir):$(localtmacdir):$(tmacdir)
118
119# sys_tmac_prefix is prefix (if any) for system macro packages
120sys_tmac_prefix=@sys_tmac_prefix@
121
122# tmac_wrap is list of system macro packages that should be made
123# available to groff by creating a corresponding macro package
124# in the groff macro directory that references the system macro
125# package.
126tmac_wrap=@tmac_wrap@
127
128# If there is a groff version of a macro package listed in $(tmac_wrap),
129# then the groff version will be installed with a prefix of this.
130# Don't make this empty.
131tmac_prefix=g
132
133# The groff -mm macros will be available as -m$(tmac_m_prefix)m.
134tmac_m_prefix=\
135 `for i in $(tmac_wrap) ""; do case "$$i" in m) echo $(tmac_prefix);; esac; done`
136# The groff -ms macros will be available as -m$(tmac_s_prefix)s.
137tmac_s_prefix=\
138 `for i in $(tmac_wrap) ""; do case "$$i" in s) echo $(tmac_prefix);; esac; done`
139# The groff -man macros will be available as -m$(tmac_an_prefix)an.
140tmac_an_prefix=\
141 `for i in $(tmac_wrap) ""; do case "$$i" in an) echo $(tmac_prefix);; esac; done`
142
143# Extension to be used for refer index files.  Index files are not
144# sharable between different architectures, so you might want to use
145# different suffixes for different architectures.  Choose an extension
146# that doesn't conflict with refer or any other indexing program.
147indexext=.i
148
149# Directory containing the default index for refer.
150indexdir=/usr/dict/papers
151
152# The filename (without suffix) of the default index for refer.
153indexname=Ind
154
155# common_words_file is a file containing a list of common words.
156# If your system provides /usr/lib/eign it will be copied onto this,
157# otherwise the supplied eign file will be used.
158common_words_file=$(datasubdir)/eign
159
160# manroot is the root of the man page directory tree.
161manroot=@mandir@
162
163# man1ext is the man section for user commands.
164man1ext=1
165man1dir=$(manroot)/man$(man1ext)
166
167# man5ext is the man section for file formats.
168man5ext=5
169man5dir=$(manroot)/man$(man5ext)
170
171# man7ext is the man section for macros.
172man7ext=7
173man7dir=$(manroot)/man$(man7ext)
174
175# DEFINES should include the following:
176# -DHAVE_MMAP			if you have mmap() and <sys/mman.h>
177# -DARRAY_DELETE_NEEDS_SIZE	if your C++ doesn't understand `delete []'
178# -DHAVE_SYS_SIGLIST		if you have sys_siglist[]
179# -DWCOREFLAG=0200		if the 0200 bit of the status returned by
180#				wait() indicates whether a core image was
181#				produced for a process that was terminated
182#				by a signal
183# -DHAVE_UNISTD_H		if you have <unistd.h>
184# -DHAVE_CC_OSFCN_H		if you have a C++ <osfcn.h>
185# -DHAVE_DIRENT_H		if you have <dirent.h>
186# -DHAVE_LIMITS_H		if you have <limits.h>
187# -DHAVE_CC_LIMITS_H		if you have a C++ <limits.h>
188# -DHAVE_SYS_DIR_H		if you have <sys/dir.h>
189# -DHAVE_STDLIB_H		if you have <stdlib.h>
190# -DHAVE_STRINGS_H		if you have <strings.h>
191# -DHAVE_RENAME			if you have rename()
192# -DHAVE_MKSTEMP		if you have mkstemp()
193# -DHAVE_STRDUP			if you have strdup()
194# -DHAVE_STRSEP			if you have strsep()
195# -DHAVE_STRCASECMP		if you have strcasecmp()
196# -DNEED_DECLARATION_HYPOT	if your C++ <math.h> doesn't declare hypot()
197# -DNEED_DECLARATION_PUTENV	if your C++ <stdlib.h> doesn't declare putenv()
198# -DNEED_DECLARATION_POPEN	if your C++ <stdio.h> doesn't declare popen()
199# -DNEED_DECLARATION_PCLOSE	if your C++ <stdio.h> doesn't declare pclose()
200# -DNEED_DECLARATION_STRNCASECMP
201#				if your C++ <string.h> doesn't declare
202#				strncasecmp()
203# -DRET_TYPE_SRAND_IS_VOID	if your srand() returns void or int
204# -DHAVE_SYS_NERR		if you have sysnerr in <errno.h> or <stdio.h>
205# -DHAVE_SYS_ERRLIST		if you have sys_errlist in <errno.h> or
206#				<stdio.h>
207# -DTRADITIONAL_CPP		if your C++ compiler uses a traditional
208#				(Reiser) preprocessor
209# -DLONG_FOR_TIME_T		if localtime() takes a long * not a time_t *
210# -DHAVE_STRUCT_EXCEPTION	if <math.h> defines struct exception
211# -DRETSIGTYPE=int		if signal handlers return int not void	
212# -DIS_EBCDIC_HOST		if the host's encoding is EBCDIC
213DEFINES=@DEFS@
214
215# Include fmod.o, strtol.o, getcwd.o, strerror.o, putenv.o in LIBOBJS if
216# your C library is missing the corresponding function.
217LIBOBJS=@LIBOBJS@
218
219# CCC is the compiler for C++ (.cc) files.
220CCC=@CXX@
221CC=@CC@
222# CCDEFINES are definitions for C++ compilations.
223CCDEFINES=$(DEFINES)
224# CDEFINES are definitions for C compilations.
225CDEFINES=$(DEFINES)
226
227CCFLAGS=@CXXFLAGS@
228CFLAGS=@CFLAGS@
229LDFLAGS=@LDFLAGS@
230YACC=@YACC@
231YACCFLAGS=-v
232
233LIBS=@LIBS@
234LIBM=@LIBM@
235RANLIB=@RANLIB@
236INSTALL=@INSTALL@
237INSTALL_PROGRAM=@INSTALL_PROGRAM@
238INSTALL_SCRIPT=@INSTALL_SCRIPT@
239INSTALL_DATA=@INSTALL_DATA@
240LN_S=@LN_S@
241AR=ar
242ETAGS=etags
243ETAGSFLAGS=
244# Flag that tells etags to assume C++.
245ETAGSCCFLAG=-C
246# Full path to perl.
247PERLPATH=@PERLPATH@
248# Sed command with which to edit sh scripts.
249SH_SCRIPT_SED_CMD=@SH_SCRIPT_SED_CMD@
250
251# the program to create directory hierarchies
252mkinstalldirs=$(top_srcdir)/mkinstalldirs
253
254PURIFY=purify
255PURIFYCCFLAGS=
256#PURIFYCCFLAGS=-g++=yes \
257#  -collector=`dirname \`$(CCC) -print-libgcc-file-name\``/ld
258
259# Passing down MAKEOVERRIDES prevents $(MAKE) from containing a second
260# copy of $(MDEFINES) when making individual directories; this could
261# cause the argument list to become too long on some systems.
262MDEFINES= \
263  "MAKEOVERRIDES=$(MAKEOVERRIDES)" \
264  "PAGE=$(PAGE)" \
265  "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
266  "DEVICE=$(DEVICE)" \
267  "TTYDEVDIRS=$(TTYDEVDIRS)" \
268  "PSPRINT=$(PSPRINT)" \
269  "DVIPRINT=$(DVIPRINT)" \
270  "top_srcdir=$(top_srcdir)" \
271  "top_builddir=$(top_builddir)" \
272  "prefix=$(prefix)" \
273  "exec_prefix=$(exec_prefix)" \
274  "g=$(g)" \
275  "datadir=$(datadir)" \
276  "dataprogramdir=$(dataprogramdir)" \
277  "datasubdir=$(datasubdir)" \
278  "libdir=$(libdir)" \
279  "libprogramdir=$(libprogramdir)" \
280  "bindir=$(bindir)" \
281  "fontdir=$(fontdir)" \
282  "fontpath=$(fontpath)" \
283  "tmacdir=$(tmacdir)" \
284  "systemtmacdir=$(systemtmacdir)" \
285  "localtmacdir=$(localtmacdir)" \
286  "tmacpath=$(tmacpath)" \
287  "indexext=$(indexext)" \
288  "indexdir=$(indexdir)" \
289  "indexname=$(indexname)" \
290  "common_words_file=$(common_words_file)" \
291  "manroot=$(manroot)" \
292  "man1ext=$(man1ext)" \
293  "man1dir=$(man1dir)" \
294  "man5ext=$(man5ext)" \
295  "man5dir=$(man5dir)" \
296  "man7ext=$(man7ext)" \
297  "man7dir=$(man7dir)" \
298  "mkinstalldirs=$(mkinstalldirs)" \
299  "tmac_wrap=$(tmac_wrap)" \
300  "sys_tmac_prefix=$(sys_tmac_prefix)" \
301  "tmac_an_prefix=$(tmac_an_prefix)" \
302  "tmac_s_prefix=$(tmac_s_prefix)" \
303  "tmac_m_prefix=$(tmac_m_prefix)" \
304  "CCC=$(CCC)" \
305  "CC=$(CC)" \
306  "CCDEFINES=$(CCDEFINES)" \
307  "CDEFINES=$(CDEFINES)" \
308  "CCFLAGS=$(CCFLAGS)" \
309  "CFLAGS=$(CFLAGS)" \
310  "LDFLAGS=$(LDFLAGS)" \
311  "YACC=$(YACC)" \
312  "YACCFLAGS=$(YACCFLAGS)" \
313  "LIBM=$(LIBM)" \
314  "LIBS=$(LIBS)" \
315  "LIBOBJS=$(LIBOBJS)" \
316  "RANLIB=$(RANLIB)" \
317  "AR=$(AR)" \
318  "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
319  "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
320  "INSTALL_DATA=$(INSTALL_DATA)" \
321  "ETAGS=$(ETAGS)" \
322  "ETAGSFLAGS=$(ETAGSFLAGS)" \
323  "ETAGSCCFLAG=$(ETAGSCCFLAG)" \
324  "PERLPATH=$(PERLPATH)" \
325  "SH_SCRIPT_SED_CMD=$(SH_SCRIPT_SED_CMD)" \
326  "PURIFY=$(PURIFY)" \
327  "PURIFYCCFLAGS=$(PURIFYCCFLAGS)"
328
329SHELL=/bin/sh
330INCDIRS=src/include
331LIBDIRS=\
332  src/libs/libgroff \
333  src/libs/libdriver \
334  src/libs/libbib
335CCPROGDIRS=\
336  src/roff/groff \
337  src/roff/troff \
338  src/preproc/tbl \
339  src/preproc/pic \
340  src/preproc/eqn \
341  src/preproc/grn \
342  src/preproc/refer \
343  src/preproc/soelim \
344  src/preproc/html \
345  src/devices/grops \
346  src/devices/grotty \
347  src/devices/grodvi \
348  src/devices/grolj4 \
349  src/devices/grohtml \
350  src/devices/grolbp \
351  src/utils/tfmtodit \
352  src/utils/hpftodit \
353  src/utils/lookbib \
354  src/utils/indxbib \
355  src/utils/lkbib \
356  src/utils/addftinfo
357CPROGDIRS=src/utils/pfbtops
358PROGDIRS=$(CCPROGDIRS) $(CPROGDIRS)
359DEVDIRS=\
360  font/devps \
361  font/devdvi \
362  font/devX75 \
363  font/devX75-12 \
364  font/devX100 \
365  font/devX100-12 \
366  font/devlj4 \
367  font/devhtml \
368  font/devlbp
369ALLTTYDEVDIRS=\
370  font/devascii \
371  font/devlatin1 \
372  font/devutf8 \
373  font/devcp1047
374OTHERDIRS=\
375  man \
376  tmac \
377  src/utils/afmtodit \
378  src/roff/grog \
379  src/roff/nroff \
380  contrib/mm
381ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
382  $(DEVDIRS) $(TTYDEVDIRS) $(OTHERDIRS)
383EXTRADIRS=\
384  font/devps/generate \
385  font/devdvi/generate \
386  src/xditview \
387  doc
388DISTDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
389  $(DEVDIRS) $(ALLTTYDEVDIRS) $(OTHERDIRS) $(EXTRADIRS)
390TARGETS=all install install_bin install_data clean distclean mostlyclean \
391  realclean extraclean distfiles TAGS depend uninstall_sub
392
393# This ENVSETUP gork is required by the DJGPP build on Windows 9X,
394# where Make needs to be case-sensitive to find files like BI and VERSION.
395ENVSETUP=\
396	if test -f $(srcdir)/makefile.ccpg* && \
397	   test -f $(srcdir)/Makefile.ccpg*; \
398	then FNCASE=y; export FNCASE; \
399	else :; \
400	fi
401
402do=all
403dodirs=$(ALLDIRS) dot
404# Default target for subdir_Makefile
405subdir=src/roff/troff
406
407
408$(TARGETS):
409	@$(ENVSETUP); $(MAKE) $(MDEFINES) do=$@ $(dodirs)
410
411dot: FORCE
412	@$(ENVSETUP); \
413	$(MAKE) $(MDEFINES) srcdir=$(srcdir) VPATH=$(srcdir) \
414	  -f $(top_srcdir)/Makefile.comm \
415	  -f $(top_srcdir)/Makefile.sub $(do)
416
417$(LIBDIRS): FORCE
418	@$(ENVSETUP); \
419	if test $(srcdir) = .; \
420	then srcdir=.; \
421	else srcdir=`cd $(srcdir); pwd`/$@; \
422	fi; \
423	test -d $@ || $(mkinstalldirs) $@; \
424	cd $@; \
425	test -f Makefile.dep || touch Makefile.dep; \
426	$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
427	  -f $(top_srcdir)/Makefile.comm \
428	  -f $$srcdir/Makefile.sub \
429	  -f $(top_srcdir)/Makefile.lib \
430	  -f Makefile.dep $(do)
431
432$(CPROGDIRS): FORCE
433	@$(ENVSETUP); \
434	if test $(srcdir) = .; \
435	then srcdir=.; \
436	else srcdir=`cd $(srcdir); pwd`/$@; \
437	fi; \
438	test -d $@ || $(mkinstalldirs) $@; \
439	cd $@; \
440	test -f Makefile.dep || touch Makefile.dep; \
441	$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
442	  -f $(top_srcdir)/Makefile.comm \
443	  -f $$srcdir/Makefile.sub \
444	  -f $(top_srcdir)/Makefile.cpg \
445	  -f Makefile.dep $(do)
446
447$(CCPROGDIRS): FORCE
448	@$(ENVSETUP); \
449	if test $(srcdir) = .; \
450	then srcdir=.; \
451	else srcdir=`cd $(srcdir); pwd`/$@; \
452	fi; \
453	test -d $@ || $(mkinstalldirs) $@; \
454	cd $@; \
455	test -f Makefile.dep || touch Makefile.dep; \
456	$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
457	  -f $(top_srcdir)/Makefile.comm \
458	  -f $$srcdir/Makefile.sub \
459	  -f $(top_srcdir)/Makefile.ccpg \
460	  -f Makefile.dep $(do)
461
462$(DEVDIRS) $(TTYDEVDIRS): FORCE
463	@$(ENVSETUP); \
464	if test $(srcdir) = .; \
465	then srcdir=.; \
466	else srcdir=`cd $(srcdir); pwd`/$@; \
467	fi; \
468	test -d $@ || $(mkinstalldirs) $@; \
469	cd $@; \
470	$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
471	  -f $(top_srcdir)/Makefile.comm \
472	  -f $$srcdir/Makefile.sub \
473	  -f $(top_srcdir)/Makefile.dev $(do)
474
475$(INCDIRS) $(OTHERDIRS): FORCE
476	@$(ENVSETUP); \
477	if test $(srcdir) = .; \
478	then srcdir=.; \
479	else srcdir=`cd $(srcdir); pwd`/$@; \
480	fi; \
481	test -d $@ || $(mkinstalldirs) $@; \
482	cd $@; \
483	$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
484	  -f $(top_srcdir)/Makefile.comm \
485	  -f $$srcdir/Makefile.sub \
486	  -f $(top_srcdir)/Makefile.man $(do)
487
488.PHONY: dist
489dist:
490	-rm -fr tmp
491	rm -f groff-$(version)$(revision).tar.gz
492	mkdir tmp
493	for d in $(DISTDIRS); do \
494	  $(mkinstalldirs) tmp/$$d; \
495	done
496	srcdir=`cd $(srcdir); pwd`; \
497	cd tmp; \
498	$(LN_S) ../Makefile .; \
499	$(LN_S) $$srcdir/* . 2>/dev/null || true; \
500	for d in $(DISTDIRS); do \
501	  (cd $$d; $(LN_S) $$srcdir/$$d/* . 2>/dev/null || true); \
502	done; \
503	$(MAKE) srcdir=$$srcdir VPATH=$$srcdir extraclean; \
504	for d in $(EXTRADIRS); do \
505	  (cd $$d; $(MAKE) extraclean); \
506	done; \
507	rm -f Makefile; \
508	$(LN_S) $$srcdir/Makefile.init Makefile
509	mv tmp groff-$(version)$(revision)
510	tar cfh - groff-$(version)$(revision) | \
511	  gzip -c >groff-$(version)$(revision).tar.gz
512	rm -fr groff-$(version)$(revision)
513
514# $(PROGDIRS): libgroff
515# grops grotty grodvi: libdriver
516# refer lookbib indxbib lkbib: libbib
517# $(LIBDIRS) $(PROGDIRS): include
518
519.PHONY: $(ALLDIRS) dot $(TARGETS) FORCE
520
521subdir_Makefile: Makefile.cfg
522	$(MAKE) do=Makefile $(subdir)
523
524Makefile.cfg: Makefile
525	>Makefile.cfg
526	for var in $(MDEFINES); do \
527	  echo "$$var" >>Makefile.cfg; \
528	done
529
530Makefile: Makefile.in
531	$(SHELL) config.status
532
533.PHONY: uninstall
534uninstall: uninstall_sub uninstall_dirs
535
536.PHONY: uninstall_dirs
537uninstall_dirs:
538# Use rmdir here so that the directories are only removed if they're empty
539	-rmdir $(man1dir) $(man5dir) $(man7dir) $(manroot) \
540	  $(tmacdir) $(systemtmacdir) $(localtmacdir) $(fontdir) $(bindir) \
541	  $(datasubdir) $(dataprogramdir) $(datadir) \
542	  $(libprogramdir) $(libdir)
543
544
545.PHONY: check
546check:
547
548FORCE:
549
550.NOEXPORT:
551