# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
# All rights reserved.  The file named COPYRIGHT specifies the terms 
# and conditions for redistribution.

#
# Makefile.in,v 1.4 1995/08/24 18:12:27 duane Exp
#
# Based on Library makefile template: *Revision: 1.15 *
#

# 
# Available entries:
#     lib         --> creates the library
#     install     --> installs the library (archive, man page(s), header(s))
#     uninstall   --> uninstall the library
#     clean       --> removes all .o and .a files
#     spotless    --> clean + uninstall
#     lint        --> lints a file (usage: make lint MODULE=foo.c)
#     tags        --> creates a tags file (from the SOURCES and HEADERS)
#     checkout    --> checkout all files
#     dist        --> distribution support
#

NAME           = str
VERSION        = 1.3.3

HEADERS        = str.h strparse.h \
                  ss_impl.h ss_rk.h ss_kmp.h ss_sbm.h ss_bmh.h
SOURCES        = strutil.c strprint.c strparse.c strs.c \
                  ss_rk.c ss_kmp.c ss_bf.c ss_sbm.c ss_bmh.c
OBJECTS        = strutil.o strprint.o strparse.o strs.o \
                  ss_rk.o ss_kmp.o ss_bf.o ss_sbm.o ss_bmh.o

MANFILES       = strparse.3 strprint.3 strutil.3 strs.3
INCLUDEFILES   = str.h

# The following variables are used by the 'install' entry and
# should be customized:
#     LIBDIR:     where the library will be placed
#     INCUDEDIR:  where the include files will be placed
#     MANDIR:     where the man pages will be placed
#
LIBDIR         = ../../lib
MANDIR         = ../../man
INCLUDEDIR     = ../../include

#
# Available flags
#  NBIC           : number of bits in a character variable (defaults to 8)
#  WIDE_INT       : widest integer supported by the CPU/compiler
#                   (defaults to 'long')
#  WIDE_INT_SIZE  : size of the WIDE_INT type in bits (defaults to 32);
#                   effective (and required) only when WIDE_INT is defined
#  NO_SIO         : if the SIO library is not available (results in turning
#                   all the string printing functions to no-ops)
#
DEFS           =     # for example, -DNO_SIO
VERSION_DEF    = -DVERSION=\"STR_Version_$(VERSION)\"

CPP_DEFS       = $(VERSION_DEF) $(DEFS)

#
# The following variables shouldn't need to be changed
#
CPP_FLAGS      = $(CPP_DEFS) -I$(INCLUDEDIR)
CC_FLAGS       = -O
CFLAGS         = $(CPP_FLAGS) $(CC_FLAGS)

INSTALL        = installbsd -c
FMODE          = -m 640       # used by install
RANLIB         = ranlib

PAGER          = less

prefix = @prefix@
INSTALL_BINDIR	= $(prefix)/bin
INSTALL_LIBDIR	= $(prefix)/lib
INSTALL_MANDIR 	= $(prefix)/man

CC		= @CC@
INSTALL		= @INSTALL@
INSTALL_BIN 	= @INSTALL_PROGRAM@
INSTALL_FILE 	= @INSTALL_DATA@
RANLIB		= @RANLIB@


LIBNAME        = $(LIBDIR)/lib$(NAME).a

all:	lib

lib: $(LIBNAME)

$(LIBNAME): $(OBJECTS)
	ar r $@ $?
	$(RANLIB) $@

clean:
	-rm -f $(OBJECTS) $(LIBNAME) core
