# $Id: Makefile.in,v 1.13 2000/01/23 09:42:36 lha 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@
exec_prefix	= @exec_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 \
xfs_deb.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 = -I. \
	   -I$(srcdir) \
	   -I../../include \
	   -I$(srcdir)/../../include \
	   -I$(srcdir)/../include

CFLAGS = $(ARCH) -DKERNEL -DDEBUG -O2 $(INCLUDES) @KRB4_INC_FLAGS@

SUBDIRS = bin

all:	$(MOD) all-subdirs

install: all install-subdirs
	$(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
	$(INSTALL_DATA) $(MOD) $(DESTDIR)$(libexecdir)/$(MOD)

uninstall:
	rm -f $(DESTDIR)$(libexecdir)/$(MOD)

$(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

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

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

.PHONY: all install uninstall clean realclean all-subdirs install-subdirs clean-subdirs uninstall-subdirs
