#	$Id: Makefile.in,v 1.11 2000/01/22 07:45:21 lha Exp $

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@
RM		= rm

INSTALL		= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT	= @INSTALL_SCRIPT@
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@

PROGRAMS	= $(MOUNT_PROG) $(UMOUNT_PROG)
SCRIPTS		= @OSF1_FALSE@ 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)

all:	$(PROGRAMS) $(SCRIPTS)

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -I../../../include -I$(srcdir)/../../../include $<

$(MOUNT_PROG): $(MOUNT_OBJS)
	$(CC) -o $(MOUNT_PROG) $(MOUNT_OBJS) -L../../../lib/roken -lroken

$(UMOUNT_PROG): $(UMOUNT_OBJS)
	$(CC) -o $(UMOUNT_PROG) $(UMOUNT_OBJS) -L../../../lib/roken -lroken

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

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

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


install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
	PROG_BIN='$(PROGRAMS)'; for x in $$PROG_BIN; do \
	  f=`echo $$x | sed '$(transform)'`; \
	  $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
	done
	SOURCES_BIN='$(srcdir)/xfs_makedev $(SCRIPTS)'; \
	for x in $$SOURCES_BIN; do \
	  f=`basename $$x | sed '$(transform)'`; \
	  $(INSTALL_SCRIPT) $$x $(DESTDIR)$(bindir)/$$f; \
	done

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

.PHONY: all install uninstall clean
