# $Id: Makefile.in,v 1.13 2000/07/21 13:26:55 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@
sbindir		= @sbindir@
transform	= @program_transform_name@
EXECSUFFIX	= @EXECSUFFIX@

APPL_BIN	= sked
PROGS		= $(APPL_BIN)

DEFS		= @DEFS@

SHELL		= /bin/sh

CFLAGS		= @CFLAGS@

ETAGS		= etags
INCLUDES	= -I$(srcdir)/../../fs \
		  -I$(srcdir)/../../../include \
		  -I$(srcdir)/../../include \
		  -I$(srcdir)/../../lib/mlog \
		  -I$(srcdir)/../../lib/voldb \
		  -I$(srcdir)/../../lib/dpart \
		  -I$(srcdir)/../../lib/vld \
		  -I$(srcdir)/../../lib/vstatus \
		  -I$(srcdir)/../../../lib/bufdir \
		  -I$(srcdir)/../../lib/mdir \
		  -I$(srcdir)/../../lib/vstatus \
		  -I../../lib/vstatus \
		  -I../../../include \
		  -I../../../rxdef \
		  -I$(srcdir) \
		  -I$(srcdir)/../../.. \
		  -I.

DEFINES		=
REALCFLAGS	= $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) $(X_CFLAGS)
RXKAD_LIBS	= @RXKAD_LIBS@
LIB_tgetent     = @LIB_tgetent@
LIBS		= -L../../../lib/sl -lsl \
		  @LIB_readline@ \
		  -L../../lib/dpart -ldpart \
		  -L../../lib/vld -lvld \
		  -L../../lib/voldb -lvoldb \
		  -L../../lib/vstatus -lvstatus \
		  -L../../lib/mlog -lmlog \
		  -L../../../lib/bufdir -lbufdir \
		  -L../../../rx -lrx \
		  -L../../../lwp -llwp @PLWP_LIB_FLAGS@ \
		  -L../../../rxdef -lrxvolserver \
		  -L../../../util -lutil \
		  -L../../../lib/ko -lko \
		  -L../../../lib/roken \
		  -lroken @LIBS@

LIBDEPENDS	= ../../../util/libutil.a ../../../lib/sl/libsl.a \
		  ../../../lib/roken/libroken.a ../../lib/voldb/libvoldb.a \
		  ../../lib/dpart/libdpart.a ../../lib/vld/libvld.a \
		  ../../lib/mlog/libmlog.a

SKED_SRCS	= sked.c
SRCS		= $(SKED_SRCS)
SKED_OBJS	= sked.o
HDRS		= sked.h

all:		$(PROGS)

.PHONY: all install uninstall depend tags clean

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

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

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

sked:		$(SKED_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(SKED_OBJS) $(LIBS)

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

mostlyclean:	clean

distclean:	clean
		rm -f Makefile config.status

realclean:	distclean
		rm -f TAGS
