# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $

SHELL=/bin/sh
MAKESHELL=/bin/sh

TOP = .
DESTDIR=
CONFIGSRC = ${TOP}/config

IRULESRC = $(CONFIGSRC)

IMAKE= $(TOP)/util/imake/imake
IFLAGS= -I$(IRULESRC)

ICONFIGFILE = ${IRULESRC}/Imake.tmpl ${IRULESRC}/Imake.rules \
	${IRULESRC}/site.def Imakefile
MKDIRHIER= sh $(IRULESRC)/mkdirhier.sh
ATHLIBDIR=/usr/local/lib
ATHBINDIR=/usr/athena
ATHINCDIR=/usr/include
LINTCFLAG=-o
LINTFLAGS=
INSTALL=install -c
RANLIB=ranlib
CC=cc
LD=cc
AS=as
RM=rm -f
CFLAGS=-O  $(DEFINES) -I$(ATHINCDIR)
LDFLAGS= $(CFLAGS) -L$(ATHLIBDIR)
LDLIBS=

all::
install:: install_dirs
install_dirs::

clean::
depend::

FRC::

###########################################################################
# start of Imakefile

#
# 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/Makefile,v 1.1 1992/02/12 18:19:20 wdc R6tape $
#	$Locker:  $
#

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

.c.o:
	$(RM) $@ profiled/$@
	$(CC) -p -c $(CFLAGS) $*.c
	mv $*.o profiled/$*.o
	$(CC) -c $(CFLAGS) $*.c
all:: profiled all_profiled
install:: install_profiled
profiled:
	@if [ ! -d profiled ]; then mkdir profiled; else exit 0; fi
all_profiled install_profiled::

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...
#

all::	compile_et
compile_et::	 compile_et.o error_table.o
	$(LD)  $(LDFLAGS) -o compile_et  compile_et.o error_table.o  -ll $(LDLIBS)
clean::
	$(RM) compile_et

install::
	$(INSTALL) -s  compile_et $(DESTDIR)$(ATHBINDIR)

install_dirs:: $(DESTDIR)$(DOCDIR)
$(DESTDIR)$(DOCDIR):
	sh ${TOP}/config/mkdirhier.sh $(DESTDIR)$(DOCDIR)

install::
	$(INSTALL) -m 0444 com_err.h $(DESTDIR)$(ATHINCDIR)

install::
	$(INSTALL) -m 0444 mit-sipb-copyright.h $(DESTDIR)$(ATHINCDIR)

install::
	base=`expr com_err.3 \: '\(.*\)\.'`; \
	ext=`expr com_err.3 \: '.*\.\(.*\)'`; \
	sdir=$(DESTDIR)/usr/man/man`expr com_err.3 \: '.*\.\(.\)'`; \
	$(INSTALL) -m 0444 com_err.3 $${sdir}/`basename com_err.3`

install::
	base=`expr compile_et.1 \: '\(.*\)\.'`; \
	ext=`expr compile_et.1 \: '.*\.\(.*\)'`; \
	sdir=$(DESTDIR)/usr/man/man`expr compile_et.1 \: '.*\.\(.\)'`; \
	$(INSTALL) -m 0444 compile_et.1 $${sdir}/`basename compile_et.1`

install::
	$(INSTALL) -m 0444 com_err.texinfo $(DESTDIR)${DOCDIR}/com_err.texinfo

all::	libcom_err.a
libcom_err.a::	$(LIBOBJS)
	ar cru libcom_err.a $(LIBOBJS)
	$(RANLIB) libcom_err.a
all_profiled::	libcom_err_p.a
libcom_err_p.a:	$(LIBOBJS)
	cd profiled; ar cru ../libcom_err_p.a $(LIBOBJS)
	$(RANLIB) libcom_err_p.a
install::
	$(RM) $(DESTDIR)$(ATHLIBDIR)/libcom_err.a
	$(INSTALL) -m 0644 libcom_err.a $(DESTDIR)$(ATHLIBDIR)
	$(RANLIB) $(DESTDIR)$(ATHLIBDIR)/libcom_err.a
install_profiled::
	$(RM) $(DESTDIR)$(ATHLIBDIR)/libcom_err_p.a
	$(INSTALL) -m 0644 libcom_err_p.a $(DESTDIR)$(ATHLIBDIR)
	$(RANLIB) $(DESTDIR)$(ATHLIBDIR)/libcom_err_p.a

#all::	llib-lcom_err.ln
llib-lcom_err.ln:: $(LINTFILES)
	lint $(LINTCFLAG)com_err $(DEFINES) -I$(ATHINCDIR) $(LINTFLAGS) $(LINTFILES)
install::
	$(INSTALL) llib-lcom_err.ln $(DESTDIR)/usr/lib/lint/
clean::
	$(RM) llib-lcom_err.ln

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}

Makefile:: $(ICONFIGFILE)
	-@if [ -f Makefile ]; then \
        	echo "  $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
		$(RM) Makefile.bak; mv Makefile Makefile.bak; \
        else exit 0; fi
	$(IMAKE) $(IFLAGS) -DNEWTOP=$(TOP)

clean::
	rm -f *~ *.o *.a core a.out

###########################################################################
# empty rules for directories that do not have SUBDIRS - do not edit

Makefiles::

###########################################################################
# dependencies generated by makedepend

