# $Id: Makefile.in,v 1.4.6.1 2000/10/11 19:00:00 lha 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	= @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)/../lib \
		  -I$(srcdir)/../.. \
		  -I$(srcdir)/../../include \
		  -I../../include \
		  -I../../rxdef \
		  $(KERNEL_INCLUDE) \
		  -I$(srcdir)/../../xfs/include \
		  -I$(srcdir)/../../arlad \
		  $(RXKADINC) 

DEFINES		=
REALCFLAGS	= $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
		  $(X_CFLAGS) @PLWP_INC_FLAGS@
RXKAD_LIBS	= @MILKO_RXKAD_LIBS@
KERNEL_INCLUDE  = @KERNEL_INCLUDE@
KAFS_LIBS	= @AIX_EXTRA_KAFS@ @KAFS_LIBS@
LIB_tgetent     = @LIB_tgetent@
LIBS		= -L../lib -larlalib \
		  -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 -lroken \
		  $(RXKAD_LIBS) \
		  $(KAFS_LIBS) \
		  $(RXKAD_LIBS) \
		  @LIBS@

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

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		= @MAKE_X_PROGS_BIN@
AMON_SRCS	= amon.c
SRCS		= $(AMON_SRCS)
AMON_OBJS	= amon.o

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

amon:		$(AMON_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(AMON_OBJS) $(LIBS) $(AMON_LIBS)

Makefile:	Makefile.in ../../config.status
		cd ../..; CONFIG_FILES=appl/amon/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
