#
# Imakefile for ss library
#
# Copyright 1987, 1988 by the MIT Student Information Processing Board
# For copyright info, see copyright.h.
#

SRCS	= invocation.c help.c \
	execute_cmd.c listen.c parse.c error.c prompt.c \
	request_tbl.c list_rqs.c pager.c requests.c \
	data.c mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.c \
	ss_err.h test.c 

OBJS=	ss_err.o \
	std_rqs.o \
	invocation.o help.o \
	execute_cmd.o listen.o parse.o error.o prompt.o \
	request_tbl.o list_rqs.o pager.o requests.o \
	data.o

MKCMDSOBJS=	mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.o

/* The -I.. is a hack so that <ss/ss_err.h> will be found */
INCLUDES= -I. -I..

AllTarget(mk_cmds)
AllTarget(libss.a)

NormalProgramTarget(mk_cmds, $(MKCMDSOBJS),,, -ll)
GeneralLibraryTarget(ss, $(OBJS))

InstallProgram(mk_cmds, $(MK_CMDS))
InstallNonExec(ss.h, $(UTILINCDIR)/ss)
InstallNonExec(ss_err.h, $(UTILINCDIR)/ss)
InstallNonExec(mit-sipb-copyright.h, $(UTILINCDIR)/ss)
InstallGeneralLibrary(ss, $(UTILLIBDIR))

GeneralLibraryObjectRule()

DependTarget()

CleanFiles(ss_err.c ss_err.h std_rqs.c std_rqs.o cmd_tbl.c ct.tab.c \
	ct.tab.h)

# Magic dependencies
std_rqs.c: mk_cmds std_rqs.ct
	./mk_cmds std_rqs.ct

ss_err.c: ss_err.et

ss_err.h: ss_err.et

# XXX Wouldn't renaming some files make this unnecessary?
ct.tab.c ct.tab.h: ct.y
	rm -f ct.tab.* y.*
	yacc -d ct.y
	mv -f y.tab.c ct.tab.c
	mv -f y.tab.h ct.tab.h
