#
# Copyright (c) 1987 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@(#)Makefile	5.1	(Berkeley)	12/12/87
#

SHELL=/bin/sh
GAMESDIR=$(ROOT)/usr/games
STRIP=strip
CFLAGS=	-O -DSYSV -DDEST=\"${GAMESDIR}/lib/atc/\"
YFLAGS=	-d
LIBC=	$(ROOT)/lib/libc.a
LIBS=	-ll -lm -lcurses
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: atc

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

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

depend: lex.c grammar.c FRC
	mkdep ${CFLAGS} ${SRCS}

install: FRC
	-[ -d ${GAMESDIR}/lib/atc ] || ( mkdir ${GAMESDIR}/lib/atc      ;\
					 chmod 755 ${GAMESDIR}/lib/atc  ;\
					 chown games ${GAMESDIR}/lib/atc;\
					 chgrp games ${GAMESDIR}/lib/atc \
				       )
	cpset atc $(GAMESDIR)/atc 755 games games
	$(STRIP) $(GAMESDIR)/atc
	for i in games/* ; do \
			cpset $$i $(GAMESDIR)/lib/atc 644 games games ;\
	done

lint: lex.c grammar.c FRC
	lint ${CFLAGS} ${SRCS}

tags: lex.c grammar.c FRC
	ctags ${SRCS}

FRC:

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

extern.o: extern.c include.h def.h struct.h extern.h tunable.h
grammar.o: grammar.c include.h
graphics.o: graphics.c include.h def.h struct.h extern.h tunable.h
input.o: input.c include.h def.h struct.h extern.h tunable.h
lex.o: lex.c y.tab.h
list.o: list.c include.h struct.h extern.h tunable.h
log.o: log.c include.h struct.h extern.h tunable.h
main.o: main.c include.h struct.h extern.h tunable.h
tunable.o: tunable.c
update.o: update.c include.h struct.h extern.h tunable.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
