diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-03-28 14:39:02 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-03-28 14:39:02 -0400 |
commit | 23454acb66be2a88647262d98d50e0f115519ea0 (patch) | |
tree | c593751ce3649be2e502fac3e080d6c0045b9fa0 | |
parent | 08eca96e71d96ad1f8e9b888875ab5570f208d19 (diff) | |
download | bsdgames-darwin-23454acb66be2a88647262d98d50e0f115519ea0.tar.gz bsdgames-darwin-23454acb66be2a88647262d98d50e0f115519ea0.tar.zst bsdgames-darwin-23454acb66be2a88647262d98d50e0f115519ea0.zip |
Use PREFIX now
87 files changed, 281 insertions, 222 deletions
@@ -11,9 +11,24 @@ SUBDIR= adventure arithmetic atc \ wargames warp worm worms wtf wump TOPTARGETS= all clean install +PREFIX ?= /usr +LOCALSTATEDIR ?= /var +SYSCONFDIR ?= /etc +ROOT := $(shell pwd) + +export ROOT PREFIX LOCALSTATEDIR SYSCONFDIR + $(TOPTARGETS): $(SUBDIR) -$(SUBDIR): - $(MAKE) -C $@ $(MAKECMDGOALS) +$(SUBDIR): config.h + +$(MAKE) -C $@ $(MAKECMDGOALS) + +config.h: + @echo "#define PREFIX \"$(PREFIX)\"" > config.h + @echo "#define LOCALSTATEDIR \"$(LOCALSTATEDIR)\"" >> config.h + @echo "#define SYSCONFDIR \"$(SYSCONFDIR)\"" >> config.h + +clean: + rm -f config.h .PHONY: $(TOPTARGETS) $(SUBDIR) diff --git a/adventure/Makefile b/adventure/Makefile index 83bc8dd7..b656970b 100644 --- a/adventure/Makefile +++ b/adventure/Makefile @@ -19,8 +19,8 @@ mkdata: setup.c clang -o mkdata setup.c install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/arithmetic/Makefile b/arithmetic/Makefile index 133c1850..0dfaea85 100644 --- a/arithmetic/Makefile +++ b/arithmetic/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/atc/Makefile b/atc/Makefile index 22216a34..437fdc54 100644 --- a/atc/Makefile +++ b/atc/Makefile @@ -6,7 +6,7 @@ SRCS= extern.c graphics.c input.c list.c log.c \ main.c tunable.c update.c MAN= atc.6 FILES=${GAMES:S@^@${.CURDIR}/games/@g} -FILESDIR=/usr/share/games/atc +FILESDIR=$(PREFIX)/share/games/atc FILESMODE=644 all: $(PROG) @@ -14,16 +14,16 @@ all: $(PROG) $(PROG): $(SRCS) grammar.y lex.l yacc -d grammar.y -o grammar.c lex lex.l - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) grammar.c lex.yy.c -lncursesw $(LIBFLA) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) grammar.c lex.yy.c -lncursesw $(LIBFLA) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - mkdir -p $(DESTDIR)/usr/share/games - cp -r games $(DESTDIR)/usr/share/games/atc - chmod -R 644 $(DESTDIR)/usr/share/games/atc/* - mkdir -p $(DESTDIR)/var/games/ + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + mkdir -p $(DESTDIR)/$(PREFIX)/share/games + cp -r games $(DESTDIR)/$(PREFIX)/share/games/atc + chmod -R 644 $(DESTDIR)/$(PREFIX)/share/games/atc/* + mkdir -p $(DESTDIR)/$(LOCALSTATEDIR)/games/ clean: diff --git a/atc/pathnames.h b/atc/pathnames.h index 742b8fd7..d73f6ff6 100644 --- a/atc/pathnames.h +++ b/atc/pathnames.h @@ -33,5 +33,7 @@ #include <paths.h> -#define _PATH_GAMES "/usr/share/games/atc/" -#define _PATH_SCORE "/var/games/atc_score" +#include "config.h" + +#define _PATH_GAMES PREFIX"/share/games/atc/" +#define _PATH_SCORE LOCALSTATEDIR"/games/atc_score" diff --git a/backgammon/backgammon/Makefile b/backgammon/backgammon/Makefile index 7e0336f7..b9a4c10f 100644 --- a/backgammon/backgammon/Makefile +++ b/backgammon/backgammon/Makefile @@ -22,8 +22,8 @@ $(PROG): $(SRCS) $(COMMONOBJS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/backgammon/teachgammon/Makefile b/backgammon/teachgammon/Makefile index c8666a1d..69c23965 100644 --- a/backgammon/teachgammon/Makefile +++ b/backgammon/teachgammon/Makefile @@ -21,7 +21,7 @@ $(PROG): $(SRCS) $(COMMONOBJS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/banner/Makefile b/banner/Makefile index 14d4c8b3..fb16d3ab 100644 --- a/banner/Makefile +++ b/banner/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/battlestar/Makefile b/battlestar/Makefile index 639f21a2..ebd76187 100644 --- a/battlestar/Makefile +++ b/battlestar/Makefile @@ -11,12 +11,12 @@ MAN= battlestar.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/battlestar/pathnames.h b/battlestar/pathnames.h index 0b2ed225..a099711a 100644 --- a/battlestar/pathnames.h +++ b/battlestar/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/battlestar.log" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/battlestar.log" diff --git a/bcd/Makefile b/bcd/Makefile index 8fe6400c..768a9b02 100644 --- a/bcd/Makefile +++ b/bcd/Makefile @@ -13,10 +13,10 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/morse.6 - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/ppt.6 + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/morse.6 + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/ppt.6 clean: rm -f $(CLEANFILES) $(PROG) diff --git a/boggle/Makefile b/boggle/Makefile index 4d5b869a..fba54e28 100644 --- a/boggle/Makefile +++ b/boggle/Makefile @@ -22,8 +22,8 @@ dictindex: mkindex dictionary ./mkindex/mkindex < dictionary > dictindex install: dictindex dictionary boggle - $(GINSTALL) -Dm644 dictionary $(DESTDIR)/usr/share/games/boggle/dictionary - $(GINSTALL) -Dm644 dictindex $(DESTDIR)/usr/share/games/boggle/dictindex + $(GINSTALL) -Dm644 dictionary $(DESTDIR)/$(PREFIX)/share/games/boggle/dictionary + $(GINSTALL) -Dm644 dictindex $(DESTDIR)/$(PREFIX)/share/games/boggle/dictindex $(MAKE) -C boggle install .PHONY: all clean install mkdict mkindex boggle diff --git a/boggle/boggle/Makefile b/boggle/boggle/Makefile index 770ef171..b00489ba 100644 --- a/boggle/boggle/Makefile +++ b/boggle/boggle/Makefile @@ -5,14 +5,14 @@ MAN= boggle.6 all: boggle $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(PROG) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(PROG) -lncursesw -I$(ROOT) $(STRIP) boggle clean: rm -f boggle install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all clean install diff --git a/boggle/boggle/bog.h b/boggle/boggle/bog.h index 7a0ae060..44cf1b7d 100644 --- a/boggle/boggle/bog.h +++ b/boggle/boggle/bog.h @@ -34,15 +34,17 @@ * @(#)bog.h 8.1 (Berkeley) 6/11/93 */ +#include "config.h" + #define LOADDICT 1 /* Load the dictionary for speed */ /* * Locations for the dictionary (generated by mkdict), * index (generated by mkindex), and helpfile */ -#define DICT "/usr/share/games/boggle/dictionary" -#define DICTINDEX "/usr/share/games/boggle/dictindex" -#define HELPFILE "/usr/share/games/boggle/helpfile" +#define DICT PREFIX"/share/games/boggle/dictionary" +#define DICTINDEX PREFIX"/share/games/boggle/dictindex" +#define HELPFILE PREFIX"/share/games/boggle/helpfile" /* * The theoretical maximum for MAXWORDLEN is ('a' - 1) == 96 diff --git a/boggle/mkdict/Makefile b/boggle/mkdict/Makefile index 5370f497..065c8e29 100644 --- a/boggle/mkdict/Makefile +++ b/boggle/mkdict/Makefile @@ -1,5 +1,5 @@ mkdict: mkdict.c - clang -o mkdict mkdict.c -I../boggle + clang -o mkdict mkdict.c -I../boggle -I$(ROOT) clean: rm -f mkdict diff --git a/boggle/mkindex/Makefile b/boggle/mkindex/Makefile index a28736f4..03a4e637 100644 --- a/boggle/mkindex/Makefile +++ b/boggle/mkindex/Makefile @@ -1,5 +1,5 @@ mkindex: mkindex.c - clang -o mkindex mkindex.c -I../boggle + clang -o mkindex mkindex.c -I../boggle -I$(ROOT) clean: rm -f mkindex diff --git a/caesar/Makefile b/caesar/Makefile index 236d2633..98651c4a 100644 --- a/caesar/Makefile +++ b/caesar/Makefile @@ -13,10 +13,10 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/rot13.6 + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/rot13.6 clean: rm -f $(CLEANFILES) $(PROG) diff --git a/canfield/canfield/Makefile b/canfield/canfield/Makefile index 847dc040..212710a4 100644 --- a/canfield/canfield/Makefile +++ b/canfield/canfield/Makefile @@ -8,12 +8,12 @@ SRCS= canfield.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/canfield/canfield/pathnames.h b/canfield/canfield/pathnames.h index 88c1bb36..eecae026 100644 --- a/canfield/canfield/pathnames.h +++ b/canfield/canfield/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/cfscores" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/cfscores" diff --git a/canfield/cfscores/Makefile b/canfield/cfscores/Makefile index f8c9518e..4e32a5d2 100644 --- a/canfield/cfscores/Makefile +++ b/canfield/cfscores/Makefile @@ -7,11 +7,11 @@ SRCS= cfscores.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../canfield + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../canfield -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cgram/Makefile b/cgram/Makefile index e99ceed2..7992ad40 100644 --- a/cgram/Makefile +++ b/cgram/Makefile @@ -7,12 +7,12 @@ MAN=cgram.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cgram/pathnames.h b/cgram/pathnames.h index 51da95c9..e93a72df 100644 --- a/cgram/pathnames.h +++ b/cgram/pathnames.h @@ -27,4 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define _PATH_FORTUNE "/usr/games/fortune" +#include "config.h" + +#define _PATH_FORTUNE PREFIX"/games/fortune" diff --git a/ching/castching/Makefile b/ching/castching/Makefile index 905a9e32..6bdfcf94 100644 --- a/ching/castching/Makefile +++ b/ching/castching/Makefile @@ -2,7 +2,7 @@ PROG= castching SRCS= castching.c -BINDIR= /usr/libexec/ching +BINDIR= $(PREFIX)/libexec/ching all: $(PROG) @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/libexec/ching/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(BINDIR)/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ching/ching/Makefile b/ching/ching/Makefile index cd5d7eff..e5d4d263 100644 --- a/ching/ching/Makefile +++ b/ching/ching/Makefile @@ -4,13 +4,13 @@ SCRIPTS=ching.sh MAN= ching.6 FILES= hexagrams macros -FILESDIR=/usr/share/games/ching +FILESDIR=$(PREFIX)/share/games/ching all: install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/ching/printching/Makefile b/ching/printching/Makefile index 4adbc181..e8e6634f 100644 --- a/ching/printching/Makefile +++ b/ching/printching/Makefile @@ -6,11 +6,11 @@ SRCS= printching.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../include + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../include -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/libexec/ching/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/libexec/ching/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ching/printching/pathnames.h b/ching/printching/pathnames.h index d9962663..93cbb95e 100644 --- a/ching/printching/pathnames.h +++ b/ching/printching/pathnames.h @@ -35,4 +35,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_HEX "/usr/share/games/ching/hexagrams" +#include "config.h" + +#define _PATH_HEX PREFIX"/share/games/ching/hexagrams" diff --git a/colorbars/Makefile b/colorbars/Makefile index dcc271cc..86e6e073 100644 --- a/colorbars/Makefile +++ b/colorbars/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/countmail/Makefile b/countmail/Makefile index 80a9d9b9..e418eac1 100644 --- a/countmail/Makefile +++ b/countmail/Makefile @@ -1,13 +1,12 @@ # $NetBSD: Makefile,v 1.3 1999/02/13 23:53:57 lukem Exp $ SCRIPTS= countmail -SCRIPTSDIR= /usr/games MAN= countmail.6 all: install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(SCRIPTS) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(SCRIPTS) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/cribbage/Makefile b/cribbage/Makefile index 19c2a387..45f9c718 100644 --- a/cribbage/Makefile +++ b/cribbage/Makefile @@ -10,13 +10,13 @@ FILESNAME=cribbage.instr all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/$(FILESNAME) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/$(FILESNAME) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cribbage/pathnames.h b/cribbage/pathnames.h index e16ecda9..eaf9d1bd 100644 --- a/cribbage/pathnames.h +++ b/cribbage/pathnames.h @@ -31,6 +31,8 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_INSTR "/usr/share/games/cribbage.instr" -#define _PATH_LOG "/var/games/criblog" -#define _PATH_MORE "/usr/bin/more" +#include "config.h" + +#define _PATH_INSTR PREFIX"/share/games/cribbage.instr" +#define _PATH_LOG LOCALSTATEDIR"/games/criblog" +#define _PATH_MORE PREFIX"/bin/more" diff --git a/dab/Makefile b/dab/Makefile index b3e940ad..8525f907 100644 --- a/dab/Makefile +++ b/dab/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/dm/Makefile b/dm/Makefile index 2b77c370..ea7c949e 100644 --- a/dm/Makefile +++ b/dm/Makefile @@ -9,13 +9,13 @@ MAN5= dm.conf.5 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -DSUPPORT_UTMPX + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -DSUPPORT_UTMPX -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN8) $(DESTDIR)/usr/share/man/man8/$(MAN8) - $(GINSTALL) -Dm644 $(MAN5) $(DESTDIR)/usr/share/man/man5/$(MAN5) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN8) $(DESTDIR)/$(PREFIX)/share/man/man8/$(MAN8) + $(GINSTALL) -Dm644 $(MAN5) $(DESTDIR)/$(PREFIX)/share/man/man5/$(MAN5) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/dm/pathnames.h b/dm/pathnames.h index 9acdc5cd..3c768c36 100644 --- a/dm/pathnames.h +++ b/dm/pathnames.h @@ -31,7 +31,9 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_CONFIG "/etc/dm.conf" -#define _PATH_HIDE "/usr/games/hide/" -#define _PATH_LOG "/var/log/games.log" -#define _PATH_NOGAMES "/etc/nogames" +#include "config.h" + +#define _PATH_CONFIG SYSCONFDIR"/dm.conf" +#define _PATH_HIDE PREFIX"/games/hide/" +#define _PATH_LOG LOCALSTATEDIR"/log/games.log" +#define _PATH_NOGAMES SYSCONFDIR"/nogames" diff --git a/factor/Makefile b/factor/Makefile index b84802d3..1fea0f68 100644 --- a/factor/Makefile +++ b/factor/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/fish/Makefile b/fish/Makefile index b6d2ac36..392b744f 100644 --- a/fish/Makefile +++ b/fish/Makefile @@ -9,13 +9,13 @@ FILES=fish.instr all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/bsd-$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/bsd-$(MAN) - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/bsd-$(FILES) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/bsd-$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/bsd-$(MAN) + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/bsd-$(FILES) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/fish/pathnames.h b/fish/pathnames.h index 3dced4a8..9b40d1f4 100644 --- a/fish/pathnames.h +++ b/fish/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_INSTR "/usr/share/games/fish.instr" -#define _PATH_MORE "/usr/bin/more" +#include "config.h" + +#define _PATH_INSTR PREFIX"/share/games/fish.instr" +#define _PATH_MORE PREFIX"/bin/more" diff --git a/gomoku/Makefile b/gomoku/Makefile index 50895f7f..7c1479f6 100644 --- a/gomoku/Makefile +++ b/gomoku/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hack/Makefile b/hack/Makefile index 318f3034..c4aed9cb 100644 --- a/hack/Makefile +++ b/hack/Makefile @@ -16,7 +16,7 @@ SRCS+= alloc.c hack.Decl.c hack.apply.c hack.bones.c hack.c hack.cmd.c \ MAN= hack.6 CLEANFILES+=makedefs FILES=help hh data -FILESDIR=/var/games/hackdir +FILESDIR=$(LOCALSTATEDIR)/games/hackdir CLEANFILES+=hack.onames.h all: $(PROG) @@ -30,12 +30,12 @@ makedefs: makedefs.c hack.h: hack.onames.h $(PROG): $(SRCS) hack.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) mkdir -p $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm660 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/hack/def.objects.h b/hack/def.objects.h index e9b34d17..3bed8c35 100644 --- a/hack/def.objects.h +++ b/hack/def.objects.h @@ -64,7 +64,7 @@ #ifndef _DEF_OBJECTS_H_ #define _DEF_OBJECTS_H_ /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */ -#include "config.h" +#include "hack-config.h" #include "def.objclass.h" struct objclass objects[] = { diff --git a/hack/config.h b/hack/hack-config.h index 7f51a842..7f51a842 100644 --- a/hack/config.h +++ b/hack/hack-config.h diff --git a/hack/hack.h b/hack/hack.h index 575b00ef..4579fae6 100644 --- a/hack/hack.h +++ b/hack/hack.h @@ -64,7 +64,7 @@ #ifndef _HACK_H_ #define _HACK_H_ -#include "config.h" +#include "hack-config.h" #include <stdlib.h> #include <string.h> #include <sys/time.h> diff --git a/hack/pathnames.h b/hack/pathnames.h index 3af190e9..bbd2fa71 100644 --- a/hack/pathnames.h +++ b/hack/pathnames.h @@ -31,7 +31,9 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_MAIL "/usr/bin/mail" -#define _PATH_QUEST "/var/games/questdir" -#define _PATH_HACK "/var/games/hackdir" +#include "config.h" + +#define _PATH_MAIL PREFIX"/bin/mail" +#define _PATH_QUEST LOCALSTATEDIR"/games/questdir" +#define _PATH_HACK LOCALSTATEDIR"/games/hackdir" diff --git a/hals_end/Makefile b/hals_end/Makefile index 89b10b30..4aff7ab3 100644 --- a/hals_end/Makefile +++ b/hals_end/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hangman/Makefile b/hangman/Makefile index 0205e266..c6876220 100644 --- a/hangman/Makefile +++ b/hangman/Makefile @@ -9,12 +9,12 @@ MAN= hangman.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hangman/pathnames.h b/hangman/pathnames.h index 74c7b7b6..e11964e1 100644 --- a/hangman/pathnames.h +++ b/hangman/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_DICT "/usr/share/dict/words" +#include "config.h" + +#define _PATH_DICT PREFIX"/share/dict/words" diff --git a/hunt/hunt/Makefile b/hunt/hunt/Makefile index 211b9619..8f898974 100644 --- a/hunt/hunt/Makefile +++ b/hunt/hunt/Makefile @@ -7,12 +7,12 @@ MAN= hunt.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hunt/huntd/Makefile b/hunt/huntd/Makefile index c90d71db..385bb5b2 100644 --- a/hunt/huntd/Makefile +++ b/hunt/huntd/Makefile @@ -8,12 +8,12 @@ MAN= huntd.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hunt/include/pathnames.h b/hunt/include/pathnames.h index 2595c9a0..e8cdf276 100644 --- a/hunt/include/pathnames.h +++ b/hunt/include/pathnames.h @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define PATH_HUNTD "/usr/games/huntd" +#include "config.h" + +#define PATH_HUNTD PREFIX"/games/huntd" #define PATH_HUNTSOCKET "/tmp/hunt" #define PATH_STATSOCKET "/tmp/hunt.stats" diff --git a/larn/Makefile b/larn/Makefile index 643e1913..47b0ae1b 100644 --- a/larn/Makefile +++ b/larn/Makefile @@ -66,14 +66,14 @@ FILES= datfiles/larn.help datfiles/larnmaze datfiles/larnopts all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/usr/share/games/larn - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/larn/ + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(PREFIX)/share/games/larn + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/larn/ clean: rm -f $(CLEANFILES) $(PROG) diff --git a/larn/pathnames.h b/larn/pathnames.h index 0790dfc4..8f7ba236 100644 --- a/larn/pathnames.h +++ b/larn/pathnames.h @@ -31,8 +31,10 @@ * @(#)pathnames.h 5.2 (Berkeley) 4/27/95 */ -#define _PATH_LOG "/var/games/larn/llog12.0" -#define _PATH_SCORE "/var/games/larn/lscore12.0" -#define _PATH_HELP "/usr/share/games/larn/larn.help" -#define _PATH_LEVELS "/usr/share/games/larn/larnmaze" -#define _PATH_PLAYERIDS "/var/games/larn/playerids" +#include "config.h" + +#define _PATH_LOG LOCALSTATEDIR"/games/larn/llog12.0" +#define _PATH_SCORE LOCALSTATEDIR"/games/larn/lscore12.0" +#define _PATH_HELP PREFIX"/share/games/larn/larn.help" +#define _PATH_LEVELS PREFIX"/share/games/larn/larnmaze" +#define _PATH_PLAYERIDS LOCALSTATEDIR"/games/larn/playerids" diff --git a/mille/Makefile b/mille/Makefile index a03c79f1..090a3e2f 100644 --- a/mille/Makefile +++ b/mille/Makefile @@ -13,8 +13,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/monop/Makefile b/monop/Makefile index a41871f8..7105af18 100644 --- a/monop/Makefile +++ b/monop/Makefile @@ -13,8 +13,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/morse/Makefile b/morse/Makefile index 70eba999..7cc3b053 100644 --- a/morse/Makefile +++ b/morse/Makefile @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/number/Makefile b/number/Makefile index 22ccf93b..eb50d2f3 100644 --- a/number/Makefile +++ b/number/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/phantasia/Makefile b/phantasia/Makefile index 3792164c..c0a4484a 100644 --- a/phantasia/Makefile +++ b/phantasia/Makefile @@ -5,7 +5,7 @@ PROG= phantasia SRCS= fight.c gamesupport.c interplayer.c io.c main.c misc.c phantglobs.c MAN= phantasia.6 -FILESDIR=/var/games/phantasia +FILESDIR=$(LOCALSTATEDIR)/games/phantasia FILESMODE=0660 ALLFILES=gold lastdead mess monsters void motd characs scoreboard FILES=gold lastdead mess monsters void motd @@ -21,7 +21,7 @@ files.stamp: mkdata monsters.asc touch files.stamp mkdata: phantglobs.c setup.c - clang -o mkdata phantglobs.c setup.c + clang -o mkdata phantglobs.c setup.c -I$(ROOT) # Make Phantasia map. Change the map commands reflect your installation. # PLOTDEVICE is used for plotting the map. Change as appropriate. @@ -31,14 +31,14 @@ map: map.c ./map | plot > /dev/tty $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) $(ALLFILES): $(FILES) install: $(PROG) $(MAN) $(ALLFILES) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm$(FILESMODE) $(ALLFILES) $(DESTDIR)$(FILESDIR) diff --git a/phantasia/pathnames.h b/phantasia/pathnames.h index af287785..5bfc3bc0 100644 --- a/phantasia/pathnames.h +++ b/phantasia/pathnames.h @@ -31,12 +31,14 @@ * @(#)pathnames.h 8.2 (Berkeley) 4/2/94 */ -#define _PATH_GAMEPROG "/usr/games/phantasia" -#define _PATH_GOLD "/var/games/phantasia/gold" -#define _PATH_LASTDEAD "/var/games/phantasia/lastdead" -#define _PATH_MESS "/var/games/phantasia/mess" -#define _PATH_MONST "/var/games/phantasia/monsters" -#define _PATH_MOTD "/var/games/phantasia/motd" -#define _PATH_PEOPLE "/var/games/phantasia/characs" -#define _PATH_SCORE "/var/games/phantasia/scoreboard" -#define _PATH_VOID "/var/games/phantasia/void" +#include "config.h" + +#define _PATH_GAMEPROG PREFIX"/games/phantasia" +#define _PATH_GOLD LOCALSTATEDIR"/games/phantasia/gold" +#define _PATH_LASTDEAD LOCALSTATEDIR"/games/phantasia/lastdead" +#define _PATH_MESS LOCALSTATEDIR"/games/phantasia/mess" +#define _PATH_MONST LOCALSTATEDIR"/games/phantasia/monsters" +#define _PATH_MOTD LOCALSTATEDIR"/games/phantasia/motd" +#define _PATH_PEOPLE LOCALSTATEDIR"/games/phantasia/characs" +#define _PATH_SCORE LOCALSTATEDIR"/games/phantasia/scoreboard" +#define _PATH_VOID LOCALSTATEDIR"/games/phantasia/void" diff --git a/pig/Makefile b/pig/Makefile index 497efad9..a9f85f23 100644 --- a/pig/Makefile +++ b/pig/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/pom/Makefile b/pom/Makefile index 686f4655..f436cc2e 100644 --- a/pom/Makefile +++ b/pom/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ppt/Makefile b/ppt/Makefile index 0b58797d..55002893 100644 --- a/ppt/Makefile +++ b/ppt/Makefile @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/primes/Makefile b/primes/Makefile index e0f0dad6..b20aad42 100644 --- a/primes/Makefile +++ b/primes/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/quiz/Makefile b/quiz/Makefile index 54afe386..54e1547d 100644 --- a/quiz/Makefile +++ b/quiz/Makefile @@ -9,17 +9,17 @@ CATS= africa america areas arith asia babies bard chinese collectives \ midearth morse mult murders poetry posneg pres province seq-easy \ seq-hard sexes sov spell state trek ucc FILES= $(addprefix datfiles/,$(CATS)) -FILESDIR=/usr/share/games/quiz.db +FILESDIR=$(PREFIX)/share/games/quiz.db all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/quiz/pathnames.h b/quiz/pathnames.h index 821cc29c..01acdc25 100644 --- a/quiz/pathnames.h +++ b/quiz/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_PAGER "/usr/bin/more" -#define _PATH_QUIZIDX "/usr/share/games/quiz.db/index" +#include "config.h" + +#define _PATH_PAGER PREFIX"/bin/more" +#define _PATH_QUIZIDX PREFIX"/share/games/quiz.db/index" diff --git a/rain/Makefile b/rain/Makefile index 0f8a9224..db13b233 100644 --- a/rain/Makefile +++ b/rain/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/random/Makefile b/random/Makefile index cad8a5de..2cd339be 100644 --- a/random/Makefile +++ b/random/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/robots/Makefile b/robots/Makefile index 293ea7d8..eb71c00a 100644 --- a/robots/Makefile +++ b/robots/Makefile @@ -10,13 +10,13 @@ MAN= robots.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/robots/pathnames.h b/robots/pathnames.h index 152810e6..fe3500ba 100644 --- a/robots/pathnames.h +++ b/robots/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/robots_roll" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/robots_roll" diff --git a/rogue/Makefile b/rogue/Makefile index 07b115de..a1c8d834 100644 --- a/rogue/Makefile +++ b/rogue/Makefile @@ -11,13 +11,13 @@ MAN= rogue.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/rogue/pathnames.h b/rogue/pathnames.h index d6e91a57..e27f6d09 100644 --- a/rogue/pathnames.h +++ b/rogue/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCOREFILE "/var/games/rogue.scores" +#include "config.h" + +#define _PATH_SCOREFILE LOCALSTATEDIR"/games/rogue.scores" #define _PATH_SCREENDUMP "rogue.screen" diff --git a/sail/Makefile b/sail/Makefile index 6d50ae19..4eac58be 100644 --- a/sail/Makefile +++ b/sail/Makefile @@ -10,13 +10,13 @@ MAN= sail.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/sail/pathnames.h b/sail/pathnames.h index 65bc3641..46a657ec 100644 --- a/sail/pathnames.h +++ b/sail/pathnames.h @@ -31,8 +31,10 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_LOGFILE "/var/games/saillog" -#define _PATH_SAILDIR "/var/games/sail" +#include "config.h" + +#define _PATH_LOGFILE LOCALSTATEDIR"/games/saillog" +#define _PATH_SAILDIR LOCALSTATEDIR"/games/sail" /* in _PATH_SAILDIR */ #define _FILE_SYNC "#sailsink.%d" diff --git a/snake/snake/Makefile b/snake/snake/Makefile index 131ba12d..5ff9c430 100644 --- a/snake/snake/Makefile +++ b/snake/snake/Makefile @@ -8,13 +8,13 @@ MAN= snake.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/snake/snake/pathnames.h b/snake/snake/pathnames.h index dcd8b0b6..faf7f269 100644 --- a/snake/snake/pathnames.h +++ b/snake/snake/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_RAWSCORES "/var/games/snakerawscores" -#define _PATH_LOGFILE "/var/games/snake.log" +#include "config.h" + +#define _PATH_RAWSCORES LOCALSTATEDIR"/games/snakerawscores" +#define _PATH_LOGFILE LOCALSTATEDIR"/games/snake.log" diff --git a/snake/snscore/Makefile b/snake/snscore/Makefile index 945b34d5..0a71046a 100644 --- a/snake/snscore/Makefile +++ b/snake/snscore/Makefile @@ -7,11 +7,11 @@ SRCS= snscore.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../snake + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../snake -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/testpat/Makefile b/testpat/Makefile index 40a1d702..abc82d12 100644 --- a/testpat/Makefile +++ b/testpat/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/tetris/Makefile b/tetris/Makefile index aeda79a9..ebec48b6 100644 --- a/tetris/Makefile +++ b/tetris/Makefile @@ -8,13 +8,13 @@ MAN= tetris.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/tetris/pathnames.h b/tetris/pathnames.h index f96e3cc5..5a9ccc04 100644 --- a/tetris/pathnames.h +++ b/tetris/pathnames.h @@ -34,4 +34,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCOREFILE "/var/games/tetris.scores" +#include "config.h" + +#define _PATH_SCOREFILE LOCALSTATEDIR"/games/tetris.scores" diff --git a/trek/Makefile b/trek/Makefile index 1b702605..acdf7d2b 100644 --- a/trek/Makefile +++ b/trek/Makefile @@ -19,8 +19,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/wargames/Makefile b/wargames/Makefile index df1a97d6..32aae0af 100644 --- a/wargames/Makefile +++ b/wargames/Makefile @@ -7,7 +7,7 @@ MAN= wargames.6 all: install: $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/warp/Makefile b/warp/Makefile index 0e674c14..855b68af 100644 --- a/warp/Makefile +++ b/warp/Makefile @@ -11,17 +11,17 @@ CLEANFILES+=warp.6 MAN= warp.6 FILES=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7 -FILESDIR=/usr/share/games/warp +FILESDIR=$(PREFIX)/share/games/warp all: $(PROG) $(MAN) $(FILES) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) $(FILES) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) @@ -56,6 +56,6 @@ smap.7: smp.7 sm ./sm < smp.7 > $@ sm: sm.c - clang -o $@ sm.c + clang -o $@ sm.c -I$(ROOT) .PHONY: all clean install @@ -9,7 +9,7 @@ #include <stdio.h> #include <ctype.h> #include <stdlib.h> -#include "config.h" +#include "warp-config.h" int main(void) diff --git a/warp/config.h b/warp/warp-config.h index 8f4d28a4..825991a3 100644 --- a/warp/config.h +++ b/warp/warp-config.h @@ -1,3 +1,5 @@ +#include "config.h" + /* RDCHK: * This symbol, if defined, indicates that the rdchk routine is available * to find out if there is input pending on an IO channel. Generally @@ -83,7 +85,7 @@ * This symbol contains the full name of the preferred user shell on this * system. Usual values are /bin/csh, /bin/ksh, /bin/sh. */ -#define PREFSHELL "/bin/csh" /**/ +#define PREFSHELL "/bin/sh" /**/ /* ROOTID: * This symbol contains the uid of root, normally 0. @@ -113,4 +115,4 @@ #endif /* warp private library, may use ~ expansion, %x and %l */ -#define PRIVLIB "/usr/share/games/warp" /**/ +#define PRIVLIB PREFIX"/share/games/warp" /**/ diff --git a/warp/warp.h b/warp/warp.h index 24abfdc3..4dabe7be 100644 --- a/warp/warp.h +++ b/warp/warp.h @@ -15,7 +15,8 @@ #ifndef WARP_H #define WARP_H -#include "config.h" /* generated by Configure script */ +#include "config.h" +#include "warp-config.h" /* generated by Configure script */ #include <sys/types.h> #include <sys/stat.h> @@ -43,7 +44,7 @@ * access.) */ -#define SAVEDIR "/var/games/warp" +#define SAVEDIR LOCALSTATEDIR"/games/warp" #define NEWSFILE "warp.news" #define HELPFILE "warp.doc" #define LOCKFILE ".warp.lock" @@ -59,7 +60,7 @@ # ifdef PRIVLIB # define WARPLIB PRIVLIB # else -# define WARPLIB "/usr/games/warp" +# define WARPLIB PREFIX"/games/warp" # endif #endif @@ -267,7 +268,7 @@ EXT char amb[YSIZE][XSIZE]; /* preferred shell for use in doshell routine */ /* ksh or sh would be okay here */ #ifndef PREFSHELL -# define PREFSHELL "/bin/csh" +# define PREFSHELL "/bin/sh" #endif /* path to fastest starting shell */ diff --git a/worm/Makefile b/worm/Makefile index 99985b11..b57264ee 100644 --- a/worm/Makefile +++ b/worm/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/worms/Makefile b/worms/Makefile index f96a8bbd..d1fda31c 100644 --- a/worms/Makefile +++ b/worms/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/wtf/Makefile b/wtf/Makefile index b5c694e8..9a6ff806 100644 --- a/wtf/Makefile +++ b/wtf/Makefile @@ -6,7 +6,7 @@ MAN= wtf.6 all: install: $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/wump/Makefile b/wump/Makefile index 49ca6588..43bdc1da 100644 --- a/wump/Makefile +++ b/wump/Makefile @@ -5,17 +5,17 @@ PROG= wump MAN= wump.6 SRCS= wump.c FILES=wump.info -FILESDIR=/usr/share/games +FILESDIR=$(PREFIX)/share/games all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) clean: diff --git a/wump/pathnames.h b/wump/pathnames.h index d3984f12..c1e99eb4 100644 --- a/wump/pathnames.h +++ b/wump/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_PAGER "/usr/bin/more" -#define _PATH_WUMPINFO "/usr/share/games/wump.info" +#include "config.h" + +#define _PATH_PAGER PREFIX"/bin/more" +#define _PATH_WUMPINFO PREFIX"/share/games/wump.info" |