#
#  Main makefile for Objective-C collection library
#  Copyright (C) 1993 Free Software Foundation, Inc.
#
#  Written by:	R. Andrew McCallum <mccallum@cs.rochester.edu>
#  Dept. of Computer Science, U. of Rochester, Rochester, NY  14627
#
#  This file is part of the GNU Objective-C Collection library.
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the Free
#  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = @srcdir@
VPATH = @srcdir@

CC = gcc
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
AR = ar
ARFLAGS = rc
     
DEFS = @DEFS@
     
CFLAGS = -g
CPPFLAGS = 
     
prefix = /usr/local
     
includedir = $(prefix)/include/coll
libdir = $(prefix)/lib
infodir = $(prefix)/info

#### End of system configuration section. ####

LIBCOLL_VERSION = 931026
GCC_VERSION = 2.5.0

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

SRCS = \
Array.m \
Bag.m \
BinaryTree.m \
BinaryTreeEltNode.m \
BinaryTreeNode.m \
CircularArray.m \
Collection.m \
DelegateList.m \
Dictionary.m \
EltNodeCollector.m \
GapArray.m \
HashTable.m \
Heap.m \
IndexedCollection.m \
KeyedCollection.m \
LinkedList.m \
LinkedListEltNode.m \
LinkedListNode.m \
List.m \
Magnitude.m \
MappedCollector.m \
Queue.m \
RBTree.m \
RBTreeEltNode.m \
RBTreeNode.m \
Set.m \
SplayTree.m \
Stack.m \
Storage.m \
String.m \
Time.m \
collhash.c \
collstd.m \
eltfuncs.m \
version.c

OBJS = \
@LIBOBJS@ \
Array.o \
Bag.o \
BinaryTree.o \
BinaryTreeEltNode.o \
BinaryTreeNode.o \
CircularArray.o \
Collection.o \
DelegateList.o \
Dictionary.o \
EltNodeCollector.o \
GapArray.o \
HashTable.o \
Heap.o \
IndexedCollection.o \
KeyedCollection.o \
LinkedList.o \
LinkedListEltNode.o \
LinkedListNode.o \
List.o \
Magnitude.o \
MappedCollector.o \
Queue.o \
RBTree.o \
RBTreeEltNode.o \
RBTreeNode.o \
Set.o \
SplayTree.o \
Stack.o \
Storage.o \
String.o \
Time.o \
collhash.o \
collstd.o \
eltfuncs.o \
version.o 


HDRS = \
coll/Array.h \
coll/ArrayPrivate.h \
coll/Bag.h \
coll/BinaryTree.h \
coll/BinaryTreeEltNode.h \
coll/BinaryTreeNode.h \
coll/CircularArray.h \
coll/CircularArrayPrivate.h \
coll/Collecting.h \
coll/Collection.h \
coll/CollectionPrivate.h \
coll/DelegateList.h \
coll/Dictionary.h \
coll/EltNode-h \
coll/EltNode-m \
coll/EltNodeCollector.h \
coll/GapArray.h \
coll/GapArrayPrivate.h \
coll/HashTable.h \
coll/Heap.h \
coll/IndexedCollecting.h \
coll/IndexedCollection.h \
coll/IndexedCollectionPrivate.h \
coll/KeyedCollecting.h \
coll/KeyedCollection.h \
coll/LinkedList.h \
coll/LinkedListEltNode.h \
coll/LinkedListNode.h \
coll/List.h \
coll/Magnitude.h \
coll/MappedCollector.h \
coll/Ordering.h \
coll/Queue.h \
coll/RBTree.h \
coll/RBTreeEltNode.h \
coll/RBTreeNode.h \
coll/ReferenceCounting.h \
coll/Set.h \
coll/SplayTree.h \
coll/Stack.h \
coll/Storage.h \
coll/String.h \
coll/Time.h \
coll/ValueHolding.h \
coll/coll.h \
coll/collhash.h \
coll/collstd.h \
coll/elt.h \
coll/eltfuncs.h 

DISTFILES = \
$(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in \
README INSTALL DISCUSSION configure configure.in mkinstalldirs \
version.texi todo.texi TODO libcoll.texi libcoll.info

all: libcoll.a

libcoll.a: $(OBJS)
	$(AR) $(ARFLAGS) libcoll.a $(OBJS)
	$(RANLIB) libcoll.a

install: installdirs all
	$(INSTALL_DATA) libcoll.a $(libdir)/libcoll.a
	$(RANLIB) $(libdir)/libcoll.a
	$(INSTALL_DATA) $(HDRS) $(includedir)
	$(INSTALL_DATA) libcoll.info $(infodir)

installdirs:
	$(srcdir)/mkinstalldirs $(includedir) $(libdir) $(infodir)

uninstall:
	rm -f $(libdir)/libcoll.a
	rm -rf $(includedir)
	rm -f $(infodir)/libcoll.info

check:
	@echo This makefile cannot run the tests.

version.c: Makefile.in
	rm -f $(srcdir)/version.c
	echo 'char *libcoll_version_string = "'$(LIBCOLL_VERSION)'";' \
	> $(srcdir)/version.c
version.texi: Makefile.in
	rm -f $(srcdir)/version.texi
	echo '@set LIBCOLL_VERSION' $(LIBCOLL_VERSION) > $(srcdir)/version.texi
	echo '@set GCC_VERSION' $(GCC_VERSION) >> $(srcdir)/version.texi
libcoll.info: libcoll.texi todo.texi version.texi
	makeinfo libcoll.texi
TODO: todo.texi version.texi
	makeinfo -o TODO -D TODO_ONLY --no-header --no-split todo.texi
Makefile: Makefile.in config.status
	$(SHELL) config.status
config.status: configure
	$(SHELL) $(srcdir)/configure --no-create
configure: configure.in
	cd $(srcdir); autoconf

TAGS: $(SRCS)
	etags $(SRCS)

clean:
	rm -f libcoll.a *.o core *~ coll/*~

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status 

realclean: distclean
	rm -f TAGS libcoll.info version.c version.texi

dist: $(DISTFILES)
	echo libcoll-$(LIBCOLL_VERSION) > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	mkdir `cat .fname`/coll
	# previously did this: -ln (DISTFILES) `cat .fname`
	for file in $(DISTFILES); do \
	  ln $$file `cat .fname`/$$file ; \
	done
	# do something like this eventually: cd tests; $(MAKE) dist
	# fix this treatment of tests dir later
	mkdir `cat .fname`/tests
	for file in tests/*.m tests/Makefile; do \
	  ln $$file `cat .fname`/$$file ; \
	done
	tar chvf `cat .fname`.tar `cat .fname`
	gzip `cat .fname`.tar
	rm -rf `cat .fname` .fname

