# Generated automatically from Makefile.in by configure.
SHELL = /bin/sh

prefix=/usr/athena
exec_prefix=${prefix}
datadir=${prefix}/share
confdir=/etc/athena/zephyr
sbindir=${exec_prefix}/sbin

includedir=$(prefix)/include
mandir=$(prefix)/man
libdir=$(exec_prefix)/lib
bindir=$(exec_prefix)/bin

srcdir=.
top_srcdir=../..
BUILDTOP=../..
CC=gcc
INSTALL=/mit/gnu/sgibin/ginstall -c
MK_CMDS=mk_cmds

DEBUG=-O
CFLAGS=$(DEBUG) -I$(top_srcdir)/h -I$(BUILDTOP)/h  -I/usr/athena/include
LDFLAGS=$(DEBUG) -L$(BUILDTOP)/lib/zephyr    -L/usr/athena/lib
LIBS=-lzephyr -lss -lkrb -ldes -lkrb -lhesiod -lhesiod -ldl -lw  -lcom_err

OBJS=	zctl.o zctl_cmds.o

all: zctl

zctl: $(OBJS) $(BUILDTOP)/lib/zephyr/libzephyr.a  
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

# The Athena mk_cmds insists on writing output to source directory.  Bleah.
# After the patch to fix it goes into an Athena release, replace it with:
#	$(MK_CMDS) $(srcdir)/zctl_cmds.ct
zctl_cmds.c: zctl_cmds.ct
	cp $(srcdir)/zctl_cmds.ct /tmp/zctl_cmds.$$$$.ct; \
	$(MK_CMDS) /tmp/zctl_cmds.$$$$.ct; \
	if [ -f /tmp/zctl_cmds.$$$$.c ]; then \
		mv /tmp/zctl_cmds.$$$$.c zctl_cmds.c; \
	else \
		mv zctl_cmds.$$$$.c zctl_cmds.c; \
	fi; \
	rm -f /tmp/zctl_cmds.$$$$.ct

check:

install: zctl
	$(INSTALL) -m 755 -s zctl $(bindir)
	$(INSTALL) -m 644 $(srcdir)/zctl.1 $(mandir)/man1

clean:
	rm -f $(OBJS) zctl_cmds.c zctl

$(OBJS): $(top_srcdir)/h/sysdep.h $(BUILDTOP)/h/config.h
$(OBJS): $(BUILDTOP)/h/zephyr/zephyr.h $(BUILDTOP)/h/zephyr/zephyr_err.h

.PHONY: all check install clean

