# /usr/src/games/atc/Makefile for MacMach

include /usr/src/COPYRIGHTS

CFLAGS=	-O -DBSD -DDEST=\"${DESTDIR}/usr/games/lib/atc/\"
YFLAGS=	-d
LIBC=	/lib/libc.a
LIBS=	-ll -lm -lcurses -ltermcap
SRCS=	extern.c grammar.c graphics.c input.c lex.c list.c log.c \
	main.c tunable.c update.c
OBJS=	extern.o grammar.o input.o lex.o list.o log.o main.o tunable.o \
	graphics.o update.o

all:	.depend atc

atc:	${OBJS} ${LIBC}
	${CC} ${CFLAGS} ${OBJS} ${LIBS} -o $@

install: FRC
	-[ -d ${DESTDIR}/usr/games/lib/atc ] || mkdir ${DESTDIR}/usr/games/lib/atc
	chmod 700 ${DESTDIR}/usr/games/lib/atc
	chown games.bin ${DESTDIR}/usr/games/lib/atc
	(cd games; install -c -o games -g bin -m 600 * ${DESTDIR}/usr/games/lib/atc)
	install -c -s -o games -g bin -m 4700 atc ${DESTDIR}/usr/games/hide/atc
	(cd ${DESTDIR}/usr/games; rm -f atc; ln -s dm atc; chown games.bin atc)

clean:	FRC
	rm -f .depend ${OBJS} core atc grammar.c y.tab.h y.tab.c lex.yy.c lex.c

compress: clean
	find . -type f ! -name Makefile ! -name '*.Z' -exec compress {} \;

uncompress: FRC
	find . -type f ! -name Makefile -name '*.Z' -exec uncompress {} \;

.depend: lex.c grammar.c ${SRCS}
	@echo "#`date`" >.depend
	mkdep -f .depend ${CFLAGS} lex.c grammar.c ${SRCS}

-include .depend

FRC:
