#
# Makefile for the Adventure interpreter.
# 	(c) Ken Wellsch 1985
#
CFLAGS = -g -O 
KLIB = ../kio/klib.a
ALIB = alib.a

MAIN =	adv.c

SRC =	error.c advglob.c cache.c command.c condition.c \
	exec.c process.c savgm.c say.c showop.c symtab.c \
	util.c values.c webster.c

HEADER = adefs.h

adv: $(ALIB) $(MAIN) $(KLIB)
	$(CC) $(CFLAGS) $(MAIN) alib.a $(KLIB) -o adv
	size adv

$(SRC) $(MAIN): $(HEADER)
	touch $@

$(ALIB): $(SRC)
	$(CC) $(CFLAGS) -c $?
	$(AR) $(ARFLAGS) $(ALIB) ${?:.c=.o}
	rm -f ${?:.c=.o}
	ranlib $(ALIB)

clean:
	rm -f *.o adv ${ALIB}

backup:
	cp Makefile $(HEADER) $(SRC) $(MAIN) bkup

lint:
	lint $(SRC) $(MAIN)

print:
	lpr -Phw -p -J "ADV" Makefile $(HEADER) $(MAIN) $(SRC)
