Files
nethack/sys/unix/hints/bsd.500
T
nhmall 8d0cfb05fa rename netbsd.500 to bsd.500
In past releases of NetHack, there was a myriad of different hints
files for different operating systems, and even different versions
of operating systems.

It made maintenance a chore, because all the variable hints files
had to be updated for a wanted change, or (as typically was the
case), some lesser-used hints files were left behind and became
outdated.

Instead of going down that road again, this renames
    sys/unix/hints/netbsd.500
to
    sys/unix/hints/bsd.500

Where things need to differ for a different bsd flavour,
the differences can be shrouded in things like

    .if ${WHICHBSD} == "NETBSD"
    .else
    .endif

This change is being done to make maintenance easier, at the
cost of making the resulting Makefiles a little more complex,
but there won't be as many separate Makefile hints to maintain.

This commit is being done instead of merging pull request #1531
which would add a new sys/unix/hints/openbsd.500 file.

Only tested on NetBSD so far. Please let us know if there's
an issue on other bsd's, and we will attempt to fix thos issues.

Closes #1531

Close
2026-05-15 12:11:34 -04:00

88 lines
2.4 KiB
Plaintext

#
# NetHack 5.0 unix $NHDT-Date: 1778708083 2026/05/13 21:34:43 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.0 $
# Copyright 2026 by Anthony C Howe.
# NetHack may be freely redistributed. See license for details.
#
# This is a contributed file. The NetHack Development Team makes this
# file available so that others may benefit, but may not be able to
# support or maintain it. Use at your own risk.
#
#-PRE
# unix hints file
# This hints file provides the legacy configuration that NetHack has shipped
# with historically - this means you will most likely need to hand edit .h
# and Makefiles.
#
# note: '#-INCLUDE' is not just a comment. setup.sh inserts the contents of
# a file found in sys/unix/hints/include
#-INCLUDE whichbsd.500
PREFIX=/usr/local
# Binaries and supporting data.
HACKDIR=$(PREFIX)/libexec/nethackdir
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Careful, this directory is deleted on install.
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INSTDIR=$(HACKDIR)
# Save games
VARDIR=/var/games/nethackdir
# Home for nethask.sh wrapper. If undefined, no wrapper installed.
# Suggest leaving /usr/games as-is from bsdgames.tgz.
SHELLDIR=$(PREFIX)/bin
CFLAGS=-O -I../include -USYSV -DBSD -DHACKDIR='"$(HACKDIR)"' -DVAR_PLAYGROUND='"$(VARDIR)"'
LINK=$(CC)
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-ltermcap
CHOWN=chown
CHGRP=chgrp
GAMEUID = games
GAMEGRP = games
GAMEPERM = 04755
VARFILEPERM = 0644
VARDIRPERM = 0755
.ifdef MAKEFILE_DOC
MAKEDEFS = ../util/makedefs
NEEDMAKEDEFS = $(MAKEDEFS)
.if ${WHICHBSD} == "NETBSD"
.if exists (/usr/pkg/bin/groff)
NROFF = /usr/pkg/bin/groff
.else
NROFF = groff
.endif # ? Is NROFF groff or /usr/pkg/bin/groff
.else # WHICHBSD is not NETBSD
NROFF = groff
.endif # WHICHBSD
# NROFF_FLAGS comes from a hints file
GUIDEBOOK = Guidebook # regular ASCII file
COLCMD = col -bx
PSCMD = $(NROFF)
NHGREP = $(MAKEDEFS) --grep --input - --output -
GUIDEBOOK_MN_SRC = Guidebook.mn
GUIDEBOOK_MN = $(GUIDEBOOK_MN_SRC)
GUIDE_PREFORMAT = cat $(GUIDEBOOK_MN) | $(NHGREP) | tbl tmac.n -
ONEPAGE_PREFORMAT = cat Gbk-1pg-pfx.mn $(GUIDEBOOK_MN) Gbk-1pg-sfx.mn \
| $(NHGREP) | tbl tmac.n -
ONEPAGECMD = $(ONEPAGE_PREFORMAT) | $(NROFF) -c -Tascii $(NROFF_FLAGS) \
| $(COLCMD)
GUIDECMD = export GROFF_NO_SGR=1; \
$(GUIDE_PREFORMAT) | $(NROFF) -c -Tascii $(NROFF_FLAGS) \
| $(COLCMD)
GUIDEBOOK_TEX_SRC = Guidebook.tex
GUIDEBOOK_TEX = $(GUIDEBOOK_TEX_SRC)
.endif # MAKEFILE_DOC