xref: /386bsd/usr/src/usr.bin/groff/man/Makefile (revision a2142627)
1#Copyright (C) 1990 Free Software Foundation, Inc.
2#     Written by James Clark (jjc@jclark.uucp)
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 1, 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 LICENSE.  If not, write to the Free Software
18#Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20MANROOT=/usr/local/man
21# MAN1EXT is the man section for user commands
22MAN1EXT=1
23MAN1DIR=$(MANROOT)/man$(MAN1EXT)
24# MAN5EXT is the man section for file formats
25MAN5EXT=5
26MAN5DIR=$(MANROOT)/man$(MAN5EXT)
27# MAN7EXT is the man section for macros
28MAN7EXT=7
29MAN7DIR=$(MANROOT)/man$(MAN7EXT)
30# FONTDIR says where to install dev*/*
31FONTDIR=/usr/local/lib/groff/font
32# FONTPATH says where to look for dev*/*
33FONTPATH=.:$(FONTDIR):/usr/lib/font
34MACRODIR=/usr/local/lib/groff/tmac
35# MACROPATH says where to look for tmac.* macro files
36MACROPATH=.:$(MACRODIR):/usr/lib/tmac
37# DEVICE is the default device
38DEVICE=ps
39# HYPHENFILE is the file containing the hyphenation patterns
40HYPHENFILE=/usr/local/lib/groff/hyphen
41TMAC_S=gs
42SHELL=/bin/sh
43MAN1PAGES=gtroff.n gpic.n grops.n groff.n geqn.n gtbl.n psbb.n gsoelim.n \
44	addftinfo.n grodvi.n grotty.n tfmtodit.n afmtodit.n grog.n
45MAN5PAGES=groff_font.n groff_out.n
46MAN7PAGES=groff_me.n groff_ms.n
47MANPAGES= $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES)
48
49.SUFFIXES: .man .n
50
51.man.n:
52	@echo Making $@ from $<
53	@-rm -f $@
54	@sed -e "s;@HYPHENFILE@;$(HYPHENFILE);" \
55	-e "s;@FONTDIR@;$(FONTDIR);" \
56	-e "s;@FONTPATH@;$(FONTPATH);" \
57	-e "s;@MACRODIR@;$(MACRODIR);" \
58	-e "s;@MACROPATH@;$(MACROPATH);" \
59	-e "s;@DEVICE@;$(DEVICE);" \
60	-e "s;@MAN1EXT@;$(MAN1EXT);" \
61	-e "s;@MAN5EXT@;$(MAN5EXT);" \
62	-e "s;@MAN7EXT@;$(MAN7EXT);" \
63	-e "s;@TMAC_S@;$(TMAC_S);" \
64	-e "s;@VERSION@;`cat ../VERSION`;" \
65	$< >$@
66	@chmod 444 $@
67
68all: $(MANPAGES)
69
70install.nobin: $(MANPAGES)
71	-[ -d $(MAN1DIR) ] || mkdir $(MAN1DIR)
72	-[ -d $(MAN5DIR) ] || mkdir $(MAN5DIR)
73	-[ -d $(MAN7DIR) ] || mkdir $(MAN7DIR)
74	@for page in $(MAN1PAGES) ; do \
75	target=$(MAN1DIR)/`basename $$page .n`.$(MAN1EXT); \
76	rm -f $$target ; \
77	echo cp $$page $$target ; \
78	cp $$page $$target ; \
79	done
80	@for page in $(MAN5PAGES) ; do \
81	target=$(MAN5DIR)/`basename $$page .n`.$(MAN5EXT); \
82	rm -f $$target ; \
83	echo cp $$page $$target ; \
84	cp $$page $$target ; \
85	done
86	@for page in $(MAN7PAGES) ; do \
87	target=$(MAN7DIR)/`basename $$page .n`.$(MAN7EXT); \
88	rm -f $$target ; \
89	echo cp $$page $$target ; \
90	cp $$page $$target ; \
91	done
92
93$(MANPAGES): ../VERSION
94
95install.bin:
96
97install: install.bin install.nobin
98
99clean:
100	-rm -f $(MANPAGES)
101
102distclean: clean
103
104realclean: clean
105
106TAGS:
107