# $Id: Makefile.in,v 1.22 1998/02/23 03:57:00 assar Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@

INSTALL		= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS 	= @top_srcdir@/mkinstalldirs

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

APPL_BIN	= vos fs

DEFS		= @DEFS@

SHELL		= /bin/sh

CFLAGS		= -g @CFLAGS@

ETAGS		= etags
MAKEDEPEND	= makedepend
AFSWSROOT	= /usr/afsws
RXKADINC	= $(srcdir)/../rxkad @KRB_INC_DIR@
INCLUDES	= $(srcdir)/../util \
		  $(srcdir)/../lwp \
		  $(srcdir)/.. \
		  $(srcdir)/../include \
		  ../include \
		  ../rxdef \
		  $(srcdir)/../lib/sl \
		  $(srcdir)/../lib/ko \
		  $(srcdir)/../arlad \
		  $(srcdir)/../include \
		  . \
		  $(RXKADINC) 
DEFINES		=
REALCFLAGS	= $(INCLUDES:%=-I%) $(DEFINES) $(CFLAGS)
RXKAD_LIBS	= @RXKAD_LIBS@
KAFS_LIBS	= @KAFS_LIBS@
LIB_tgetent     = @LIB_tgetent@
LIBS		= -L../rxdef -lrxdefclient -L../rx -lrx -L../lwp -llwp \
		  -L../util -lutil -L../lib/sl -lsl \
		  @LIB_readline@ $(KAFS_LIBS) $(RXKAD_LIBS) \
		  -L../lib/roken -lroken @LIBS@ \
		  -L../lib/ko -lko
LIBDEPENDS	= ../rxdef/librxdefclient.a ../rx/librx.a ../lwp/liblwp.a \
		  ../util/libutil.a ../lib/sl/libsl.a ../lib/roken/libroken.a \
		  ../lib/ko/libko.a
PROGS		= fs vos
FS_SRCS		= fs.c
VOS_SRCS	= vos.c
COMMON_SRCS	= arlalib.c
SRCS		= $(FS_SRCS) $(VOS_SRCS) $(COMMON_SRCS)
FS_OBJS		= $(FS_SRCS:.c=.o) $(COMMON_SRCS:.c=.o) 
VOS_OBJS	= $(VOS_SRCS:.c=.o) $(COMMON_SRCS:.c=.o) 
HDRS		= arlalib.h fs_local.h

.PHONY: all install depend tags clean

all:		$(PROGS)

.c.o:
		$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<

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

fs:		$(FS_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(FS_OBJS) $(LIBS)

vos:		$(VOS_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(VOS_OBJS) $(LIBS)

Makefile:	Makefile.in ../config.status
		cd ..; CONFIG_FILES=appl/Makefile CONFIG_HEADERS= $(SHELL) config.status

depend:		$(CFILES)
		$(MAKEDEPEND) -- $(REALCFLAGS) -- $^

tags:		TAGS

TAGS:		$(SRCS) $(HDRS)
		$(ETAGS) -t $(SRCS) $(HDRS)

clean		:
		rm -f $(PROGS) $(OBJS) *~ *.o core

mostlyclean:	clean

distclean:	clean
		rm -f Makefile config.status

realclean:	distclean
		rm -f TAGS
