# $Id: Makefile.in,v 1.4 1998/01/19 02:08:49 map Exp $

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@
LD		= ld
MODLOAD		= insmod
MKDIR		= mkdir
RMDIR		= rmdir
LN_S		= @LN_S@
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@
EXECSUFFIX	= @EXECSUFFIX@

XFS_BIN		= $(MODULE)

DEFS		= @DEFS@ -DMODULE -D__KERNEL__ -DDEBUG
CFLAGS		= @CFLAGS@ -g -I. -I/usr/athena/include -I$(srcdir)/../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer

MODULE		= xfs.o

MODULE_SRCS	= xfs_load.c \
		  xfs_dev.c \
		  xfs_common.c \
		  xfs_vfsops.c \
		  xfs_node.c \
		  xfs_message.c \
		  xfs_inodeops.c \
		  xdeb.c \
		  xfs_cache.c \
		  xfs_syscalls.c

MODULE_OBJS	= $(MODULE_SRCS:.c=.o)

all:	$(MODULE)

$(MODULE):	$(MODULE_OBJS)
	$(LD) -r -o $(MODULE) $(MODULE_OBJS)

load:	$(MODULE)
	$(MODLOAD) xfs.o


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


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

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

mostlyclean: clean

distclean: clean

realclean: distclean

.PHONY: all load clean mostlyclean distclean realclean
