# $Id: Makefile.in,v 1.58 1999/08/08 13:00:31 assar Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@
LN_S		= @LN_S@

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	= klog tokens unlog vos fs pts udebug @MAKE_X_PROGS_BIN@

DEFS		= @DEFS@

SHELL		= /bin/sh

CFLAGS		= @CFLAGS@
X_CFLAGS	= @X_CFLAGS@

ETAGS		= etags
MAKEDEPEND	= makedepend
AFSWSROOT	= /usr/afsws
RXKADINC	= -I$(srcdir)/../rxkad
INCLUDES	= -I$(srcdir)/.. \
		  -I$(srcdir)/../include \
		  -I../include \
		  -I../rxdef \
		  -I. \
		  $(KERNEL_INCLUDE) \
		  -I$(srcdir)/../xfs/include \
		  -I$(srcdir)/../arlad \
		  $(RXKADINC) 

DEFINES		=
REALCFLAGS	= $(INCLUDES) @KRB_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
		  $(X_CFLAGS) @PLWP_INC_FLAGS@
RXKAD_LIBS	= @RXKAD_LIBS@
KERNEL_INCLUDE  = @KERNEL_INCLUDE@
KAFS_LIBS	= @AIX_EXTRA_KAFS@ @KAFS_LIBS@
LIB_tgetent     = @LIB_tgetent@
LIBS		= -L../rxdef -lrxdefclient \
		  -L../rx -lrx \
		  -L../lwp -llwp @PLWP_LIB_FLAGS@ \
		  -L../lib/ko -lko -L../util -lutil \
		  -L../lib/sl -lsl \
		  @LIB_readline@ \
		  -L../lib/roken \
		  $(RXKAD_LIBS) \
		  $(KAFS_LIBS) \
		  $(RXKAD_LIBS) \
		  -lroken @LIBS@

AMON_LIBS	= @X_LIBS@ @X_PRE_LIBS@ @X_EXTRA_LIBS@ \
		  -lXaw -lXt -lXmu -lXext -lX11

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

X_PROGS_BIN	= amon
PROGS		= klog tokens unlog fs vos pts udebug @MAKE_X_PROGS_BIN@
KLOG_SRCS	= klog.c
TOKENS_SRCS	= tokens.c
UNLOG_SRCS	= unlog.c
FS_SRCS		= fs.c arladeb.c
VOS_SRCS	= vos.c vos_common.c vos_examine.c vos_listvol.c \
		  vos_partinfo.c vos_status.c vos_createentry.c \
		  vos_listpart.c vos_syncsite.c vos_listvldb.c vos_dump.c \
		  vos_createvolume.c vos_endtrans.c vos_vldbexamine.c \
		  vos_lock.c vos_unlock.c
PTS_SRCS	= pts.c
UDEBUG_SRCS	= udebug.c
AMON_SRCS	= amon.c
COMMON_SRCS	= arlalib.c fs_lib.c
SRCS		= $(KLOG_SRCS)			\
		  $(TOKENS_SRCS)		\
		  $(UNLOG_SRCS)			\
		  $(FS_SRCS)			\
		  $(VOS_SRCS)			\
		  $(PTS_SRCS)			\
		  $(UDEBUG_SRCS)		\
		  $(AMON_SRCS)		\
		  $(COMMON_SRCS)
COMMON_OBJS	= arlalib.o fs_lib.o
KLOG_OBJS	= klog.o $(COMMON_OBJS)
TOKENS_OBJS	= tokens.o
UNLOG_OBJS	= unlog.o
FS_OBJS		= fs.o arladeb.o $(COMMON_OBJS)
VOS_OBJS	= vos.o vos_common.o vos_examine.o vos_listvol.o \
		  vos_partinfo.o vos_status.o vos_createentry.o \
		  vos_listpart.o vos_syncsite.o vos_listvldb.o vos_dump.o \
		  vos_createvolume.o vos_endtrans.o vos_vldbexamine.o \
		  vos_lock.o vos_unlock.o \
		  $(COMMON_OBJS)
PTS_OBJS	= pts.o $(COMMON_OBJS)
UDEBUG_OBJS	= udebug.o $(COMMON_OBJS)
AMON_OBJS	= amon.o $(COMMON_OBJS)
HDRS		= arlalib.h fs_local.h vos_local.h

all:		$(PROGS)

.PHONY: all install uninstall depend tags clean

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

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

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

klog:		$(KLOG_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(KLOG_OBJS) $(LIBS)

tokens:		$(TOKENS_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(TOKENS_OBJS) $(LIBS)

unlog:		$(UNLOG_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(UNLOG_OBJS) $(LIBS)

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

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

pts:		$(PTS_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(PTS_OBJS) $(LIBS)

udebug:		$(UDEBUG_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(UDEBUG_OBJS) $(LIBS)

arladeb.c:
		$(LN_S) $(srcdir)/../arlad/arladeb.c .

amon:		$(AMON_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(AMON_OBJS) $(LIBS) $(AMON_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 arladeb.c

mostlyclean:	clean

distclean:	clean
		rm -f Makefile config.status

realclean:	distclean
		rm -f TAGS
