#	$Id: Makefile.in,v 1.5 1998/03/01 15:28:25 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@
libdir 		= @libdir@
libexecdir 	= @libexecdir@
bindir 		= @bindir@
transform	= @program_transform_name@
ARLACACHEDIR	= @ARLACACHEDIR@

XFS_BIN		= $(MOUNT_PROG) $(UMOUNT_PROG) startarla

DEFS		= @DEFS@ -DDEBUG
CFLAGS		= @CFLAGS@

MOUNT_PROG	= mount_xfs
UMOUNT_PROG 	= umount_xfs

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

UMOUNT_SRCS	= umount_xfs.c
UMOUNT_OBJS	= $(UMOUNT_SRCS:.c=.o)

PROGS		= $(MOUNT_PROG) $(UMOUNT_PROG)

all:	$(PROGS) startarla

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

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

$(UMOUNT_PROG): $(UMOUNT_OBJS)
	$(CC) -o $(UMOUNT_PROG) $(UMOUNT_OBJS)

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

startarla: startarla.in
	sed -e ' s!%bindir%!$(bindir)! ; s!%ARLACACHEDIR%!$(ARLACACHEDIR)!'  $(srcdir)/startarla.in > $@
	chmod +x $@


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


