#========================================================================
#
# Goo library Makefile
#
# Copyright 1996 Derek B. Noonburg
#
#========================================================================

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CFLAGS = @CFLAGS@ @DEFS@ @OPTIONS@ -I$(srcdir)
CXXFLAGS = @CXXFLAGS@ @DEFS@ @OPTIONS@ -I$(srcdir)

CC = @CC@
CXX = @CXX@
AR = @AR@
RANLIB = @RANLIB@

LIBPREFIX = @LIBPREFIX@

#------------------------------------------------------------------------

.SUFFIXES: .cc

.cc.o:
	$(CXX) $(CXXFLAGS) -c $<

#------------------------------------------------------------------------

CXX_SRC = \
	$(srcdir)/GString.cc \
	$(srcdir)/gmempp.cc \
	$(srcdir)/gfile.cc

C_SRC = \
	$(srcdir)/gmem.c \
	$(srcdir)/parseargs.c

#------------------------------------------------------------------------

GOO_CXX_OBJS = GString.o gmempp.o gfile.o
GOO_C_OBJS = gmem.o parseargs.o
GOO_OBJS = $(GOO_CXX_OBJS) $(GOO_C_OBJS)

$(LIBPREFIX)Goo.a: $(GOO_OBJS)
	rm -f $(LIBPREFIX)Goo.a
	$(AR) $(LIBPREFIX)Goo.a $(GOO_OBJS)
	$(RANLIB) $(LIBPREFIX)Goo.a

#------------------------------------------------------------------------

clean:
	rm -f $(GOO_OBJS) $(LIBPREFIX)Goo.a

#------------------------------------------------------------------------

distdepend:
	cp Makefile.in Makefile.in.bak
	sed '/^#----- dependences -----/q' Makefile.in.bak >Makefile.in
	$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >>Makefile.in
	$(CC) $(CFLAGS) -MM $(C_SRC) >>Makefile.in

#----- dependences -----
GString.o: ./GString.cc GString.h
gmempp.o: ./gmempp.cc gmem.h
gfile.o: ./gfile.cc GString.h gfile.h gtypes.h
gmem.o: ./gmem.c gmem.h
parseargs.o: ./parseargs.c parseargs.h gtypes.h
