1#	NetHack Makefile.
2#	SCCS Id: @(#)Makefile.doc	3.4	1996/03/23
3
4# for Atari
5# SHELL=E:/GEMINI2/MUPFEL.TTP
6
7GUIDEBOOK = Guidebook		# regular ASCII file
8#GUIDEBOOK = Guidebook.ps	# PostScript file
9#GUIDEBOOK = Guidebook.dvi	# TeX device-independent file
10
11# Some versions of col need -x to keep them from converting spaces to tabs;
12# some versions of col don't do the conversion by default and don't
13# recognize the option.  Sigh.
14COLCMD = col -bx
15#COLCMD = col -b
16
17# The command to use to generate a PostScript file
18# PSCMD = ditroff | psdit
19PSCMD = groff
20
21# Use the "cat" GUIDECMD if nroff and/or tbl and/or col are not installed
22# Not appropriate for creating Guidebook.txt.
23# GUIDECMD = cat Guidebook.txt
24# The following works better with groff-1.18, eg on Linux
25# GUIDECMD = tbl tmac.n Guidebook.mn | nroff -c -Tascii | $(COLCMD)
26GUIDECMD = tbl tmac.n Guidebook.mn | nroff | $(COLCMD)
27
28# the basic guidebook
29Guidebook:	Guidebook.mn
30	$(GUIDECMD) > Guidebook
31
32# Fancier output for those with ditroff, psdit and a PostScript printer.
33Guidebook.ps:	Guidebook.mn
34	tbl tmac.n Guidebook.mn | $(PSCMD) > Guidebook.ps
35
36# Guidebook.tex is the same as Guidebook.mn but formatted with LaTeX.
37# - The invocation command for LaTeX may vary in different installations.
38# - To print Guidebook.dvi you need to use a suitable dvi-driver.
39Guidebook.dvi:	Guidebook.tex
40	latex Guidebook.tex
41
42
43GAME	= nethack
44MANDIR	= /usr/man/man6
45MANEXT	= 6
46
47# manual installation for most BSD-style systems
48GAMEMANCREATE = cp nethack.6
49LEVMANCREATE = cp lev_comp.6
50DGNMANCREATE = cp dgn_comp.6
51RCVRMANCREATE = cp recover.6
52DLBMANCREATE = cp dlb.6
53# manual installation for most SYSV-style systems
54# GAMEMANCREATE = nroff -man nethack.6 >
55# LEVMANCREATE = nroff -man lev_comp.6 >
56# DGNMANCREATE = nroff -man dgn_comp.6 >
57# RCVRMANCREATE = nroff -man recover.6 >
58# DLBMANCREATE = nroff -man dlb.6 >
59
60manpages:
61	-$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
62	-$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
63	-$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
64	-$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
65	-$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
66
67# manual creation for distribution
68DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt dlb.txt
69
70distrib: $(DISTRIB)
71	@echo "Plain text documentation is up to date."
72
73Guidebook.txt	: Guidebook.mn tmac.n
74	$(GUIDECMD) > Guidebook.txt
75nethack.txt	: nethack.6
76	nroff -man nethack.6 | $(COLCMD) > nethack.txt
77lev_comp.txt	: lev_comp.6
78	nroff -man lev_comp.6 | $(COLCMD) > lev_comp.txt
79dgn_comp.txt	: dgn_comp.6
80	nroff -man dgn_comp.6 | $(COLCMD) > dgn_comp.txt
81recover.txt	: recover.6
82	nroff -man recover.6 | $(COLCMD) > recover.txt
83dlb.txt		: dlb.6
84	nroff -man dlb.6 | $(COLCMD) > dlb.txt
85
86
87clean:
88	-rm -f Guidebook.aux Guidebook.log
89
90spotless: clean
91	-rm -f Guidebook Guidebook.ps Guidebook.dvi
92
93maintainer-clean: spotless
94	-rm -f $(DISTRIB)
95#	-rm -f Makefile
96