xref: /original-bsd/games/phantasia/Makefile (revision 2bd07fe6)
1#
2# Copyright (c) 1989 The Regents of the University of California.
3# All rights reserved.
4#
5# This code is derived from software contributed to Berkeley by
6# Edward Estes.
7#
8# Redistribution and use in source and binary forms are permitted
9# provided that the above copyright notice and this paragraph are
10# duplicated in all such forms and that any documentation,
11# advertising materials, and other materials related to such
12# distribution and use acknowledge that the software was developed
13# by the University of California, Berkeley.  The name of the
14# University may not be used to endorse or promote products derived
15# from this software without specific prior written permission.
16# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19#
20#	@(#)Makefile	5.8 (Berkeley) 03/05/90
21#
22# PLOTDEVICE is used for plotting the map.
23# Change as appropriate.
24PLOTDEVICE =	> /dev/tty
25
26# The following are program constants which are implementation dependent.
27#
28# WIZARD is the login of the one who will clean up things.
29# UID is the uid of game wizard.
30# define OK_TO_PLAY to restrict playing access at certain times.
31#	Also see function ok_to_play() in main.c, and tailor to your own needs.
32# define ENEMY to include code for checking of a 'hit list' of resricted
33#	accounts.  The list of logins goes in the file 'enemy'.
34# SHELL is the default shell for shell escapes.  If SHELL is not defined,
35#	shell escapes are not enabled.
36
37CFLAGS=	-O -DWIZARD=\"root\" -DUID=0 -DENEMY -DBSD42
38LIBC=	/lib/libc.a
39SRCS=	main.c fight.c io.c interplayer.c gamesupport.c misc.c phantglobs.c
40OBJS=	main.o fight.o io.o interplayer.o gamesupport.o misc.o phantglobs.o
41MAN=	phantasia.0
42
43# Make documentation.
44# The flags below on tbl and nroff are to make a line printable version.
45.6.0:
46	tbl -TX phantasia.6 | /usr/man/manroff > phantasia.0
47
48all: phantasia setup
49
50phantasia: ${OBJS} ${LIBC}
51	${CC} ${OBJS} -o $@ -lm -lcurses -ltermlib -lcompat
52
53# Make the initialization program.
54setup: phantglobs.o setup.o monsters.asc ${LIBC}
55	${CC} phantglobs.o setup.o -o $@ -lm -lcurses -ltermlib
56
57install: ${MAN}
58	-[ -d ${DESTDIR}/usr/games/lib/phantasia ] || mkdir ${DESTDIR}/usr/games/lib/phantasia
59	chmod 700 /usr/games/lib/phantasia
60	chown games.bin /usr/games/lib/phantasia
61	install -s -o games -g bin -m 4700 phantasia ${DESTDIR}/usr/games/hide
62	(cd ${DESTDIR}/usr/games; rm -f phantasia; ln -s dm phantasia; chown games.bin phantasia)
63	install -c -o games -g bin -m 400 phantasia.0 ${DESTDIR}/usr/games/lib/phantasia/phant.help
64	install -c -o bin -g bin -m 444 phantasia.0 ${DESTDIR}/usr/man/cat6
65	./setup
66	chown games.bin /usr/games/lib/phantasia/*
67
68# Make Phantasia map.
69# Change the map commands reflect your installation.
70# Pre-System III installations may use 'plot' instead of 'tplot'.
71map: map.c
72	${CC} -O map.c -lplot -o $@
73	map | tplot ${PLOTDEVICE}
74
75# Convert old character file to new format.
76# 'convert' is meant to be run only once.
77# PLUS = PHANTPLUS for conversion from 3.3.1+.
78convert: convert.c oldplayer.h phantstruct.h
79	${CC} ${CFLAGS} ${PLUS} convert.c ${LDFLAGS} -o convert
80	convert
81	@echo "New data is in newcharacs."
82
83clean:
84	rm -f *.o core phantasia phant.help phantasia.0 setup
85
86cleandir: clean
87	rm -f ${MAN} tags .depend
88
89depend: ${SRCS}
90	mkdep ${CFLAGS} ${SRCS}
91
92lint: ${SRCS}
93	lint ${CFLAGS} ${SRCS}
94
95tags: ${SRCS}
96	ctags ${SRCS}
97