#	$Id: Makefile.in,v 1.9 2000/02/12 19:16:33 assar Exp $

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@
RM		= rm

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

prefix 		= @prefix@
exec_prefix	= @exec_prefix@
bindir		= @bindir@

DEFS		= @DEFS@ -DDEBUG
CFLAGS		= @CFLAGS@ \
		  -I$(srcdir)/../../../include \
		  -I../../../include \
		  @KRB4_INC_FLAGS@
LIBS		= -L../../../lib/roken -lroken @LIBS@
KAFS_LIBS	= @KAFS_LIBS@
KRB4_LIB_FLAGS	= @KRB4_LIB_FLAGS@

MOUNT_PROG	= mount_xfs
MOUNT_SRCS	= mount_xfs.c
MOUNT_OBJS	= $(MOUNT_SRCS:.c=.o)

TEST_FHOPEN_PROG = test-fhopen
TEST_FHOPEN_SRCS = test-fhopen.c
TEST_FHOPEN_OBJS = test-fhopen.o

bin_PROGS	 = $(MOUNT_PROG)
PROGS		 = $(bin_PROGS) $(TEST_FHOPEN_PROG)

all:	$(PROGS)

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<

$(MOUNT_PROG): $(MOUNT_OBJS)
	$(CC) -o $(MOUNT_PROG) $(MOUNT_OBJS) $(LIBS)

$(TEST_FHOPEN_PROG): $(TEST_FHOPEN_OBJS)
	$(CC) -o $(TEST_FHOPEN_PROG) $(TEST_FHOPEN_OBJS) $(KAFS_LIBS) $(KRB4_LIB_FLAGS) $(LIBS)

check:	$(TEST_FHOPEN_PROG)
	./$(TEST_FHOPEN_PROG) /etc/passwd > passwd2
	cmp /etc/passwd passwd2
	-rm -f passwd2

clean:
	$(RM) -f $(PROGS) *.o *~

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
	for i in $(bin_PROGS); do \
	  $(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/$$i; \
	done

uninstall:
	for i in $(bin_PROGS); do \
	  rm -f $(DESTDIR)$(bindir)/$$i; \
	done

TAGS: $(MOUNT_SRCS) $(TEST_FHOPEN_SRCS)
	etags $(MOUNT_SRCS) $(TEST_FHOPEN_SRCS)

Makefile: Makefile.in ../../../config.status
	cd ../../.. && CONFIG_FILES=xfs/solaris/bin/Makefile CONFIG_HEADERS= $(SHELL) config.status

.PHONY: all install uninstall clean check
