#
# $Id: Makefile.in,v 1.3 2000/01/23 02:54:03 lha Exp $
#

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
AR = ar
RANLIB = @RANLIB@
DEFS = @DEFS@
CFLAGS = @CFLAGS@

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

INCLUDE=-I../../include -I$(srcdir) \
	-I../../rxdef \
	-I$(srcdir)/../roken \
	@KRB4_INC_FLAGS@ \
	-I$(srcdir)/../.. 

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@

#PICFLAGS = @PICFLAGS@
 
LIBNAME = $(LIBPREFIX)bufdir
#LIBEXT = @LIBEXT@
LIBEXT = a
#SHLIBEXT = @SHLIBEXT@
#LIBPREFIX = @LIBPREFIX@
LIBPREFIX = lib
#LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)
PROGS =

LIB_SOURCES = fbuf.c fdir.c

SOURCES = $(LIB_SOURCES)

LIB_OBJECTS = fbuf.o fdir.o

OBJECTS = $(LIB_OBJECTS)

all: $(LIB) $(PROGS)

Wall:
	make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"

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

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)

uninstall:
	rm -f $(DESTDIR)$(libdir)/$(LIB)

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

clean:
	rm -f $(LIB) $(PROGS) *.o *.a

mostlyclean: clean

distclean: clean
	rm -f Makefile *~

realclean: distclean
	rm -f TAGS

Makefile: ../../config.status Makefile.in
	cd ../.. ; CONFIG_FILES=lib/bufdir/Makefile CONFIG_HEADERS= $(SHELL) config.status

$(LIBNAME).a: $(LIB_OBJECTS)
	rm -f $@
	$(AR) cr $@ $(LIB_OBJECTS)
	-$(RANLIB) $@

#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
#	rm -f $@
#	$(LDSHARED) -o $@ $(LIB_OBJECTS)

$(OBJECTS): ../../include/config.h

.PHONY: all install uninstall check clean mostlyclean distclean realclean
