

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/
#
# Makefile for error-table routines
#
# Copyright 1987, 1989 MIT Student Information Processing Board
# For copyright info, see mit-sipb-copyright.h.
#
#	$Header: /afs/cs.cmu.edu/project/atk-dist/auis-6.3/contrib/mit/com_err/RCS/Imakefile,v 1.5 1993/08/25 20:43:53 susan Exp $
#	$Locker:  $
#

#ifdef ULTRIX40
DEFINES=-DULTRIX_40
#endif

#ifdef error_table
#undef error_table
#endif

LINTFLAGS=-uhvb 
LINTFILES= error_message.c et_name.c init_et.c com_err.c # perror.c
LIBOBJS= error_message.o et_name.o init_et.o com_err.o # perror.o

DOCDIR=/usr/doc/athena

FILES=	Makefile et_name.c error_message.c compile_et.c \
		et_lex.lex.l error_table.y init_et.c \
		com_err.c com_err.h \
		error_table.h mit-sipb-copyright.h \
		test.c test1.et test2.et \
		compiler.h internal.h \
		com_err.texinfo texinfo.tex
CFILES=	compile_et.c error_table.c error_message.c et_name.c \
	init_et.c com_err.c

#
# what to build...
#

#
# rules
#
.SUFFIXES: .h .c .et .ps .x9700 .mss .dvi .texinfo

ProfiledObjectRule()

error_table.o: et_lex.lex.c

.et.c:
	./compile_et $*.et

.et.h:
	./compile_et $*.et

.texinfo.dvi:
	tex $<

.dvi.ps:
	rm -f $@.new
	dvi2ps -r $< > $@.new
	mv $@.new $@

#
# real entries...
#
SimpleProgram(compile_et, compile_et.o error_table.o, -ll,$(ATHBINDIR))

create_dir($(DOCDIR))

install_file(com_err.h,$(ATHINCDIR))
install_file(mit-sipb-copyright.h,$(ATHINCDIR))
install_man(com_err.3,com_err.3)
install_man(compile_et.1,compile_et.1)
install_file(com_err.texinfo,${DOCDIR}/com_err.texinfo)


SimpleLibrary(com_err,$(LIBOBJS),$(ATHLIBDIR))


SimpleLint(com_err,$(LINTFILES))

clean::
	rm -f *~ \#* *.bak \
		*.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
		*.cp *.fn *.ky *.log *.pg *.tp *.vr \
		*.o profiled/?*.o libcom_err.a libcom_err_p.a \
		com_err.o compile_et \
		et.ar TAGS y.tab.c lex.yy.c error_table.c \
		et_lex.lex.c \
		test1.h test1.c test2.h test2.c test \
		eddep makedep *.ln

# for testing
test:	test.o test1.o test2.o libcom_err.a
	cc ${CFLAGS} -o test test.o test1.o test2.o libcom_err.a
test.o:	test1.h test2.h
test1.o : test1.c
test1.c : test1.et
test2.o : test2.c
test2.c : test2.et

et.tar:	${FILES}
	rm -f et.tar
	tar cfrlv et.tar ${FILES}

tags:	TAGS

doc:	com_err.dvi


com_err.ps : com_err.dvi
com_err.dvi: com_err.texinfo

libcom_err.o:	$(LIBOBJS)
	ld -r -s -o libcom_err.o $(LIBOBJS)
	chmod -x libcom_err.o


archive:	et.tar

TAGS:	et_name.c error_message.c compile_et.c error_table.c \
		lex.yy.c perror.c init_et.c
	etags et_name.c error_message.c compile_et.c \
		error_table.c perror.c init_et.c

# make depend code
depend:: ${CFILES} et_lex.lex.c
	makedepend ${CFLAGS} ${CFILES}

