# $Id: Makefile.in,v 1.21 1997/11/09 09:04:08 assar Exp $

SHELL	= /bin/sh

srcdir	= @srcdir@
VPATH	= @srcdir@

top_builddir	= ../..

CC	= @CC@
AR	= ar
RANLIB	= @RANLIB@
DEFS	= @DEFS@
CFLAGS	= @CFLAGS@
LD_FLAGS= @LD_FLAGS@
INSTALL	= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LIBROKEN = -L../../lib/roken -lroken
LIBS	= @KRB_KAFS_LIB@ -L../../lib/krb -lkrb -L../../lib/des -ldes $(LIBROKEN) @LIBS@ $(LIBROKEN)
MKINSTALLDIRS = @top_srcdir@/mkinstalldirs

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
libexecdir = @libexecdir@
bindir = @bindir@
transform=@program_transform_name@
EXECSUFFIX=@EXECSUFFIX@

PROG_BIN	= pagsh$(EXECSUFFIX) \
		  afslog$(EXECSUFFIX) \
		  kstring2key$(EXECSUFFIX)
PROG_LIBEXEC	= 
PROGS = $(PROG_BIN) $(PROG_LIBEXEC)

SOURCES = pagsh.c aklog.c kstring2key.c

OBJECTS = pagsh.o aklog.o kstring2key.o

all: $(PROGS)

Wall:
	make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I../../include -I$(srcdir) $(CFLAGS) $<

install: all
	$(MKINSTALLDIRS) $(bindir)
	for x in $(PROG_BIN); do \
	  $(INSTALL_PROGRAM) $$x $(bindir)/`echo $$x | sed '$(transform)'`; \
	done

uninstall:
	for x in $(PROG_BIN); do \
	  rm -f $(bindir)/`echo $$x | sed '$(transform)'`; \
	done

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

clean:
	rm -f *.a *.o $(PROGS)

mostlyclean: clean

distclean: clean
	rm -f Makefile *.tab.c *~

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	for file in $(DISTFILES); do \
	  ln $$file ../`cat ../.fname`/lib \
	    || cp -p $$file ../`cat ../.fname`/lib; \
	done

pagsh$(EXECSUFFIX): pagsh.o
	$(CC) $(LD_FLAGS) $(LDFLAGS) -o $@ pagsh.o $(LIBS)

afslog$(EXECSUFFIX): aklog.o
	$(CC) $(LD_FLAGS) $(LDFLAGS) -o $@ aklog.o $(LIBS)

kstring2key$(EXECSUFFIX): kstring2key.o
	$(CC) $(LD_FLAGS) $(LDFLAGS) -o $@ kstring2key.o $(LIBS)


$(OBJECTS): ../../include/config.h
