
#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
# This makefile is automatically generated by imake... do not modify
# or you may lose your changes when imake generates makefiles again.
# Ignore this message if you are not using imake.
#
#	$Source: /afs/athena.mit.edu/mit/zephyr/src/config/RCS/Imake.template,v $
#	$Author: jtkohl $
#	$Header: Imake.template,v 1.2 89/03/23 16:16:50 jtkohl Exp $
#

NEWTOP=../.
BUILDTOP=../.

INCLUDE= $(LINCLUDES) -I$(BUILDTOP)/include
CFLAGS=$(DBG) $(INCLUDE) $(DEFINES) $(GLOBAL_CDEFS)
LINTFLAGS= -bhz $(LLINTFLAGS) $(INCLUDE) $(DEFINES) $(GLOBAL_CDEFS)

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/config.Imakefile,v $
#	$Author: jtkohl $
#	$Header: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/config.Imakefile,v 1.17 89/08/29 17:03:56 jtkohl Exp $
#

SRCTOP=/afs/athena.mit.edu/astaff/project/zephyr/src

IMAKE=$(BUILDTOP)/imake/imake -I$(BUILDTOP)/config

GLOBALCDEFS=

DESTDIR=

CLIENTDIR= /usr/athena
ETCATHDIR= /etc/athena
USRETCDIR= /usr/etc
LIBDIR= /usr/athena/lib
LINTLIBDIR= /usr/lib/lint
MANDIR=/usr/man
ACLDIR=/usr/athena/lib/zephyr

LINTLIBFLAG=-C

X_CDEFS= -DX11

X11_LIB=-lX11
XAW_LIB=-lXaw
XT_LIB=-lXt
XMU_LIB=-lXmu

X11_LINTLIB=-lX11
XAW_LINTLIB=-lXaw
XT_LINTLIB=-lXt
XMU_LINTLIB=-lXmu

X3_CDEFS=-DX11R3

KRB_CDEFS=-DKERBEROS
KRB_LIB=-lkrb
KRB_LINTLIB=-lkrb
DES_LIB=-ldes
DES_LINTLIB=-ldes

HES_CDEFS=-DHESIOD
HES_LIB=-lhesiod
HES_LINTLIB=-lhesiod

GLOBAL_CDEFS = $(KRB_CDEFS) $(HES_CDEFS) $(X_CDEFS) $(X3_CDEFS) $(GLOBALCDEFS)

SS_LIB=-lss
SS_LINTLIB=-lss
COMERR_LIB=-lcom_err
COMERR_LINTLIB=-lcom_err
COMPILE_ET=compile_et
MAKE_COMMANDS=mk_cmds

DEPEND=makedepend

ARCHIVE= ar cru

RANLIB= ranlib

INSTALLFILE= install -c -m 444

INSTALLLIB= install -c -m 444

INSTALLPROG= install -c -s -m 555

INSTALLSCRIPT= install -c -m 555

INSTALLRAW= install

INSTALLSUID= install -c -m 4555 -o root

LD=ld

AS=as

LINT=lint

CC=cc

HCC=$(CC)

CPP=$(CC) -E

DBG=-O

HCFLAGS=$(CFLAGS)

TAGGER=etags

MAKE=make
RM=rm -f
MV=mv
CP=cp
LN=ln -s
LPR=lpr -p
CHMOD=chmod

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/Imake.rules,v $
#	$Author: jtkohl $
#	$Header: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/Imake.rules,v 1.17 89/07/25 13:39:18 jtkohl Exp Locker: jtkohl $
#

ZEPHYR_LIB=$(BUILDTOP)/libs/libzephyr.a
ZEPHYR_LINTLIB=$(BUILDTOP)/libs/llib-lzephyr.ln

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/mit/zephyr/src/lib/RCS/Imakefile,v $
#	$Author: jtkohl $
#	$Header: Imakefile,v 1.7 89/07/25 13:40:27 jtkohl Exp $
#

LINTLIBS= ${KRB_LINTLIB} ${DES_LINTLIB} ${COMERR_LINTLIB}

RSRCS= ${SRCS} ${HDRS} krb_err.et zephyr_err.et

HDRS= \
	../include/zephyr/zephyr.h \
	../include/zephyr/zephyr_conf.h \
	../include/zephyr/zephyr_internal.h

SRCS=	\
	ZCheckAuthentication.c \
	ZCheckIfNotice.c \
	ZClosePort.c \
	ZCompareUID.c \
	ZCompareUIDPred.c \
	ZFlushLocations.c \
	ZFlushSubscriptions.c \
	ZFormatAuthenticNotice.c \
	ZFormatNotice.c \
	ZFormatNoticeList.c \
	ZFormatRawNotice.c \
	ZFormatRawNoticeList.c \
	ZFormatSmallRawNotice.c \
	ZFormatSmallRawNoticeList.c \
	ZFreeNotice.c \
	ZGetLocations.c \
	ZGetSender.c \
	ZGetSubscriptions.c \
	ZGetWGPort.c \
	ZIfNotice.c \
	ZInitialize.c \
	ZLocateUser.c \
	ZLocations.c \
	ZMakeAscii.c \
	ZMakeAuthentication.c \
	ZOpenPort.c \
	ZParseNotice.c \
	ZPeekIfNotice.c \
	ZPeekNotice.c \
	ZPeekPacket.c \
	ZPending.c \
	ZReadAscii.c \
	ZReceiveNotice.c \
	ZReceivePacket.c \
	ZRetrieveSubscriptions.c \
	ZSendList.c \
	ZSendNotice.c \
	ZSendPacket.c \
	ZSendRawNotice.c \
	ZSendRawList.c \
	ZSetDestAddr.c \
	ZSetFD.c \
	ZSetServerState.c \
	ZSubscriptions.c \
	ZVariables.c \
	Zinternal.c \
	acl_files.c \
	strcasecmp.c

OLIST=	\
	krb_err.o \
	zephyr_err.o \
	ZCheckAuthentication.o \
	ZCheckIfNotice.o \
	ZClosePort.o \
	ZCompareUID.o \
	ZCompareUIDPred.o \
	ZFlushLocations.o \
	ZFlushSubscriptions.o \
	ZFormatAuthenticNotice.o \
	ZFormatNotice.o \
	ZFormatNoticeList.o \
	ZFormatRawNotice.o \
	ZFormatRawNoticeList.o \
	ZFormatSmallRawNotice.o \
	ZFormatSmallRawNoticeList.o \
	ZFreeNotice.o \
	ZGetLocations.o \
	ZGetSender.o \
	ZGetSubscriptions.o \
	ZGetWGPort.o \
	ZIfNotice.o \
	ZInitialize.o \
	ZLocateUser.o \
	ZLocations.o \
	ZMakeAscii.o \
	ZMakeAuthentication.o \
	ZOpenPort.o \
	ZParseNotice.o \
	ZPeekIfNotice.o \
	ZPeekNotice.o \
	ZPeekPacket.o \
	ZPending.o \
	ZReadAscii.o \
	ZReceiveNotice.o \
	ZReceivePacket.o \
	ZRetrieveSubscriptions.o \
	ZSendList.o \
	ZSendNotice.o \
	ZSendPacket.o \
	ZSendRawNotice.o \
	ZSendRawList.o \
	ZSetDestAddr.o \
	ZSetFD.o \
	ZSetServerState.o \
	ZSubscriptions.o \
	ZVariables.o \
	Zinternal.o \
	acl_files.o

#dummy target so that 'make' does a make all.
all:: libzephyr.a

KRB_OTHERSRCS= krb_err.et

OTHERSRCS= zephyr_err.et ${KRB_OTHERSRCS}
SRCDIR= ${SRCTOP}/lib
CODE= ${SRCS} ${OTHERSRCS} Imakefile

llib-lzephyr.ln:: ${HDRS}
	@echo "Don't worry about the complaints about"
	@echo "possible pointer alignment problems, these are a result"
	@echo "of casting the return value of malloc()"
	@echo

.c.o:
	$(CC) -pg -c $(CFLAGS) $*.c
	-$(LD) -X -r -o profiled/$*.o $*.o
	$(CC) -c $(CFLAGS) $*.c
	-$(LD) -x -r -o a.out $*.o
	$(MV) a.out $*.o

all:: libzephyr.a libzephyr_p.a
all:: llib-lzephyr.ln

libzephyr.a: ${OLIST}
	$(RM) $@
	$(ARCHIVE) $@ ${OLIST}
	$(RANLIB) $@

libzephyr_p.a: ${OLIST}
	$(RM) $@
	(cd profiled; $(ARCHIVE) ../$@ ${OLIST})
	$(RANLIB) $@

lint:: llib-lzephyr.ln

llib-lzephyr.ln:: ${SRCS}
	$(LINT) $(LINTLIBFLAG)zephyr $(LINTFLAGS) ${SRCS} ${LINTLIBS}

clean::
	$(RM) libzephyr.a libzephyr_p.a
	$(RM) llib-lzephyr.ln
	$(RM) ${OLIST}
	$(RM) profiled/?*.o

install::
	$(INSTALLRAW) -c -m 644 libzephyr.a $(DESTDIR)$(LIBDIR)/libzephyr.a
	$(RANLIB) $(DESTDIR)$(LIBDIR)/libzephyr.a
	$(CHMOD) 444 $(DESTDIR)$(LIBDIR)/libzephyr.a
	$(INSTALLRAW) -c -m 644 libzephyr_p.a $(DESTDIR)$(LIBDIR)/libzephyr_p.a
	$(RANLIB) $(DESTDIR)$(LIBDIR)/libzephyr_p.a
	$(CHMOD) 444 $(DESTDIR)$(LIBDIR)/libzephyr_p.a
	$(INSTALLFILE) llib-lzephyr.ln $(DESTDIR)$(LINTLIBDIR)/llib-lzephyr.ln

zephyr_err.h zephyr_err.o: zephyr_err.et
	$(RM) zephyr_err.c zephyr_err.h
	$(COMPILE_ET) zephyr_err.et
	$(CC) -c -pg $(CFLAGS) zephyr_err.c
	$(MV) zephyr_err.o profiled/zephyr_err.o
	$(CC) -c $(CFLAGS) zephyr_err.c
clean::
	$(RM) zephyr_err.o zephyr_err.h

krb_err.h krb_err.o: krb_err.et
	$(RM) krb_err.c krb_err.h
	$(COMPILE_ET) krb_err.et
	$(CC) -c -pg $(CFLAGS) krb_err.c
	$(MV) krb_err.o profiled/krb_err.o
	$(CC) -c $(CFLAGS) krb_err.c
clean::
	$(RM) krb_err.o krb_err.h

all::
	$(RM) ../libs/libzephyr.a ../libs/libzephyr_p.a
	$(CP) libzephyr.a ../libs/libzephyr.a
	$(RANLIB) ../libs/libzephyr.a

	$(CP) libzephyr_p.a ../libs/libzephyr_p.a
	$(RANLIB) ../libs/libzephyr_p.a

depend:: krb_err.h
	-if cmp krb_err.h ../include/zephyr/krb_err.h >/dev/null 2>&1; then \
		echo ; \
	else \
		$(RM) ../include/zephyr/krb_err.h ; \
		$(CP) krb_err.h ../include/zephyr/krb_err.h; \
	fi

depend:: zephyr_err.h
	-if cmp zephyr_err.h ../include/zephyr/zephyr_err.h >/dev/null 2>&1; then \
		echo ; \
	else \
		$(RM) ../include/zephyr/zephyr_err.h ; \
		$(CP) zephyr_err.h ../include/zephyr/zephyr_err.h; \
	fi

install::
	-mkdir ${DESTDIR}/usr/include/zephyr
	install -c -m 0644 ../include/zephyr/zephyr.h ${DESTDIR}/usr/include/zephyr/zephyr.h
	install -c -m 0644 ../include/zephyr/zephyr_conf.h ${DESTDIR}/usr/include/zephyr/zephyr_conf.h
	install -c -m 0644 ../include/zephyr/zephyr_internal.h ${DESTDIR}/usr/include/zephyr/zephyr_internal.h
	install -c -m 0644 zephyr_err.h ${DESTDIR}/usr/include/zephyr/zephyr_err.h

	install -c -m 0644 krb_err.h ${DESTDIR}/usr/include/zephyr/krb_err.h

	install -c -m 0644 ../include/zephyr/mit-copyright.h ${DESTDIR}/usr/include/zephyr/mit-copyright.h

depend:: $(CODE)
	@echo "### Now computing dependencies"
	@$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)

clean::
	$(RM) *~ \#* *.bak $(TAGSFILE)

tags::
	$(TAGGER) *.c *.h

Makefile::
	-$(RM) Makefile.bak; $(MV) Makefile Makefile.bak
	$(IMAKE) -DNEW_TOP=$(NEWTOP) -s Makefile

print:: $(CODE)
	$(LPR) $(CODE)

src:: ${CODE}
	touch src

${CODE}:
	 $(RM) $@
	-$(LN) ${SRCDIR}/$@ $@

install::

Makefiles::

# this is to install the lint lib  This must end
# up in the resulting Makefile AFTER the other lint lib stuff.
llib-lzephyr.ln::
	cp llib-lzephyr.ln ../libs/llib-lzephyr.ln

# DO NOT DELETE THIS LINE

