# $Id: Makefile.in,v 1.5 1998/02/13 02:10:45 assar Exp $

#
# System stuff using SunOS modload(8)
#

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@

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

prefix 		= @prefix@
libexecdir 	= @libexecdir@


# Use "lorder *.o | tsort" to get hints on link order.
SRC = \
xfs_wrap.c \
xfs_syscalls.c \
xfs_vfsops.c \
xfs_vnodeops.c \
xfs_dev.c \
xfs_message.c \
xfs_node.c \
xdeb.c \
xfs_common.c

OBJ = $(SRC:.c=.o)
SYS = $(shell uname -m)
MOD = libxfs.o

GCCWFLAGS = -Wall -W -Wunused -Wreturn-type -Wcast-qual -Wpointer-arith \
            -Wwrite-strings -Wcomment -Wswitch -Wshadow -Waggregate-return \
            -Wformat -Wuninitialized -Wconversion -Wmissing-prototypes \
            -Winline #-Wcast-align
GCCWFLAGS = -Wall

CC = cc -sparc
CC = gcc -g -D__$(SYS)__ $(GCCWFLAGS)
ARCH = -D$(SYS)

INCLUDES = . $(srcdir) ../../include $(srcdir)/../include @KRB_INC_DIR@
CFLAGS = $(ARCH) -DKERNEL -DDEBUG -O2 $(INCLUDES:%=-I%)

SUBDIRS = bin

all:	$(MOD) all-subdirs

install: all install-subdirs
	$(MKINSTALLDIRS) $(libexecdir)
	$(INSTALL_DATA) $(MOD) -m 444 $(libexecdir)

$(MOD): $(OBJ)
	ld -r $(OBJ) -o $@

tags:	$(SRC)
	etags $(SRC)

#
# Generic cleanup
#

clean:	clean-subdirs
	rm -rf core *~ *.o $(MOD)

realclean: clean

all-subdirs:
	SUBDIRS='$(SUBDIRS)'; \
	for i in $$SUBDIRS; \
	do (cd $$i && $(MAKE) $(MFLAGS) all); done

install-subdirs:
	SUBDIRS='$(SUBDIRS)'; \
	for i in $$SUBDIRS; \
	do (cd $$i && $(MAKE) $(MFLAGS) install); done

clean-subdirs:
	SUBDIRS='$(SUBDIRS)'; \
	for i in $$SUBDIRS; \
	do (cd $$i && $(MAKE) $(MFLAGS) clean); done
