Browse Source

Guidebook make sequencing

Be able to run 'make Guidebook{|.txt|.ps}' in the doc subdirectory
without requring a full install first.

makedefs is no longer one of the first things built when building
nethack, and even if it was, nobody should have to rebuild all of
nethack after 'make spotless' when they just want to create one
or more of the formatted Guidebooks.  The 'roff versions (.ps and
also .txt) use makedefs as a filter by default, so wouldn't build
if it wasn't there.

Have Makefile.doc build makedefs when needed.

Clean up some dependencies in Makefile.utl.

Add a couple of comments to Makefile.src.
PatR 4 weeks ago
  1. 20
  2. 6
  3. 19


@ -39,10 +39,13 @@ ONEPAGECMD = $(ONEPAGE_PREFORMAT) | nroff -c -Tascii | $(COLCMD) \
# Only generate output for the current configuration:
NHGREP = $(MAKEDEFS) --grep --input - --output -
# Generate output for all configurations:
#NHGREP = $(MAKEDEFS) --grep --input - --output - --grep-define ALLDOCS
# Fallback:
#NHGREP = cat
GUIDE_PREFORMAT = cat | $(NHGREP) | tbl tmac.n -
# for Guidebook.dat, unpaginated version of Guidebook.txt
@ -50,21 +53,27 @@ ONEPAGE_PREFORMAT = cat \
| $(NHGREP) | tbl tmac.n -
# the basic guidebook
Guidebook: tmac.n tmac.nh
Guidebook : tmac.n tmac.nh $(NEEDMAKEDEFS)
$(GUIDECMD) > Guidebook
# Fancier output for those with ditroff, psdit and a PostScript printer. tmac.n tmac.nh : tmac.n tmac.nh $(NEEDMAKEDEFS)
# Guidebook.tex is the same as but formatted with LaTeX.
# - The invocation command for LaTeX may vary in different installations.
# - To print Guidebook.dvi you need to use a suitable dvi-driver.
# - LaTeX needs to be run twice; second pass uses Guidebook.aux made by first.
Guidebook.dvi: Guidebook.tex
Guidebook.dvi : Guidebook.tex
latex Guidebook.tex
latex Guidebook.tex
# makedefs has more dependencies than these; this is mainly to cope with the
# case where it hasn't been built yet since it is usually needed for $(NHGREP)
# (note: 'make makedefs', not 'make $(MAKEDEFS)')
$(MAKEDEFS) : ../util/makedefs.c ../include/config.h ../src/mdlib.c \
( cd ../util ; make makedefs )
GAME = nethack
MANDIR = /usr/man/man6
@ -94,9 +103,10 @@ DISTRIB = Guidebook.txt nethack.txt recover.txt \
distrib: $(DISTRIB)
@echo "Plain text documentation is up to date."
Guidebook.txt : tmac.n tmac.nh
Guidebook.txt : tmac.n tmac.nh $(NEEDMAKEDEFS)
$(GUIDECMD) > Guidebook.txt
Guidebook.dat : tmac.n tmac.nh
Guidebook.dat : tmac.n tmac.nh \
$(ONEPAGECMD) > Guidebook.dat
MAN2TXT = $(NHGREP) | nroff -man - | $(COLCMD)


@ -710,7 +710,8 @@ $(MAKEDEFS): $(FIRSTOBJ) \
@( cd ../util ; $(MAKE) makedefs )
# Source files created by 'makedefs' at build time.
# Source files formerly created by 'makedefs' at build time
# but no longer used.
# Each is given an artificial dependency upon the one before
# so that parallel makes will have to build them sequentially.
# (More for documentation than effect; 'make' should know not
@ -771,7 +772,8 @@ clean:
spotless: clean
-rm -f a.out core $(GAMEBIN) Sys*
-rm -f ../include/nhlua.h
-rm -f ../include/date.h ../include/onames.h ../include/pm.h
-rm -f ../include/date.h #created but no longer used, at least by core
-rm -f ../include/onames.h ../include/pm.h #obsolete generated files
-rm -f tile.c *.moc
-rm -f ../win/gnome/gn_rip.h


@ -3,6 +3,11 @@
# Copyright (c) 2018 by Robert Patrick Rankin
# NetHack may be freely redistributed. See license for details.
# Note: as of nethack 3.7, 'lev_comp' and 'dgn_comp' are no longer present
# so use of yacc and lex to build them is no longer required.
# Root of source tree:
@ -206,12 +211,18 @@ TARGET_CXXFLAGS = $(CXXFLAGS)
makedefs: $(MAKEOBJS) mdgrep.h
$(CLINK) $(LFLAGS) -o makedefs $(MAKEOBJS)
makedefs.o: makedefs.c ../src/mdlib.c $(CONFIG_H) ../include/permonst.h \
../include/objclass.h ../include/sym.h ../include/defsym.h \
# note: the headers listed here are maintained manually rather than via
# 'make depend'; only the ones which are directly included by
# makedefs.c are listed, without various nested ones that they include;
# for makedefs (but not for nethack's core), mdlib.c gets included
# rather than be compiled separately
makedefs.o: makedefs.c ../src/mdlib.c $(CONFIG_H) \
../include/permonst.h ../include/objclass.h \
../include/artilist.h ../include/dungeon.h ../include/obj.h \
../include/monst.h ../include/monsters.h ../include/objects.h \
../include/you.h ../include/flag.h ../include/dlb.h \
../include/you.h ../include/context.h ../include/flag.h \
../include/dlb.h ../include/patchlevel.h mdgrep.h
$(CC) $(CFLAGS) -c makedefs.c -o $@
# Don't require perl to build; that is why mdgrep.h is spelled wrong below.