##############################################################################
#                                                                            #
# @FILE@: put_a_description_here
#                                                                            #
# Library makefile for @PROJECTNAME@
#                                                                            #
# Adjust at will                                                             #
#                                                                            #
##############################################################################
#                                                                            #
# (C)Copyright 1995-1997 Ripley Software Development                         #
# All Rights Reserved                                                        #
#                                                                            #
# @PROJECT@
#                                                                            #
# This @APPTYPE@ is free software; you can redistribute it and/or              #
# modify it under the terms of the GNU @LICTYPE@ General Public                #
# License as published by the Free Software Foundation; either               #
# version 2 of the License, or (at your option) any later version.           #
#                                                                            #
# This @APPTYPE@ 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          #
# @LICTYPE@ General Public License for more details.                           #
#                                                                            #
# You should have received a copy of the GNU @LICTYPE@ General Public          #
# License along with this @APPTYPE@; if not, write to the Free                 #
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         #
##############################################################################
#

LIBRARY=lib@PROJECTNAME@.a

# List of source, object and header files 
BASESRCS=

BASEOBJS=

# Generated source files
GENSRCS=
GENOBJS=

# Comment these out if you don't want to include the debug routines.
# or define NDEBUG in the toplevel Makefile.
DEBSRCS= debug.c
DEBOBJS= debug.o

SRCS = $(BASESRCS) $(GENSRCS) $(DEBSRCS)
OBJS = $(BASEOBJS) $(GENOBJS) $(DEBOBJS)

# Public header files
BASEHDRS = 

# Private header files. Need not be installed
PUBHDRS  = 

# Generated header files
GENHDRS  =

# List of all header files
HEADERS  = $(BASEHDRS) $(GENHDRS) $(PUBHDRS)
 
# Target to make
TARGET=$(LIBRARY)

# Subdirectories to visit
SUBDIRS=

# rule to create .o files from .c files 
.c.o:
	$(RM) $@
	$(CC) $(CFLAGS) -DVERSION=$(VERSION) $(CPPFLAGS) $(INCLUDES) -c $<

all: $(TARGET)

# targets to build

$(TARGET):: $(OBJS)  
	$(RM) $@ \ 
	$(AR) $@ $(OBJS)  
	$(RANLIB) $@

# string table parser
mkStrings:: mkStrings.c
	$(RM) $@
	$(CC) -o $@ $(CFLAGS) mkStrings.c 

stamp-includes: mkStrings
	$() ./mkStrings @PROJECTNAME@ c < strings.lst > strings.c
	$() ./mkStrings @PROJECTNAME@ h < strings.lst > @PROJECTNAME@Strings.h
	$() ./mkStrings @PROJECTNAME@ c w < warnings.lst > warnings.c
	$() ./mkStrings @PROJECTNAME@ h w < warnings.lst > @PROJECTNAME@Warnings.h
	@(set -x; cd ../include/@PROJECTNAME@; for i in $(HEADERS); do \
		$(RM) $$i; \
		$(LN) ../../src/$$i .; \
	done)
	touch $@

includes:: stamp-includes strings.lst warnings.lst

lint:: includes
	@( set -x; for f in $(SRCS) ; do \
		echo "linting $$f" ; \
		$(RM) $$f.lint ; \
		$(LINT) $(LINTFLAGS) $(LINTINCS) $(LINTDEFS) $$f >& $$f.lint ; \
	done)

depend:: includes $(SRCS) 
	$(MAKEDEPEND) $(INCLUDES) $(CPPFLAGS) $(SRCS)

clean::
	$(RM) $(OBJS)
	$(RM) $(TARGET)

distclean:: clean 
	$(RM) mkStrings $(GENSRCS) $(GENHDRS)
	$(RM) core *.out *.log make.world *.bak *.last *.auto *.rej *.orig
	$(RM) *.lh *.lcs *.lint stamp-includes
	$(CP) Makefile.org Makefile

stringclean::
	$(RM) strings.c strings.h

realclean:: stringclean distclean

#--------------------------------------------------------------------------
# don't delete anything below this line, makedepend depends on it
#--------------------------------------------------------------------------
