# concordance - a program to make concordances for text files
# Copyright (c) 1996 Ralph L. Meyer, 39 Nelson Ave. Spotswood, NJ 08884
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program 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 General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# 

.SUFFIXES: .o .cc .h

#The compiler used in compiling this program:
CC = g++

#Compiler flags:
#debugging flags: (-g used when debugging information is to be included)
#CFLAGS = -m486 -Wall -g 

#distribution flags:
#compile with optimization on:
#CFLAGS = -m486 -Wall -O
#compile without optimization:
#CFLAGS = -m486 -Wall
CFLAGS = -Wall

PROGRAMNAME = concordance
OBJS = concordance.o word.o alphalst.o concutils.o
MANPAGENAME = $(PROGRAMNAME).1

#Installation directories:  Change these if installing to different directories,
# or if your are not root and cannot access these directories:
INSTALLDIR = /usr/local/bin
LOCALMANPAGEDIR = /usr/local/man/man1

$(PROGRAMNAME): $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS)

concordance.o: concordance.cc
	$(CC) $(CFLAGS) -c concordance.cc

word.o: word.cc
	$(CC) $(CFLAGS) -c word.cc

alphalst.o: alphalst.cc
	$(CC) $(CFLAGS) -c alphalst.cc

concutils.o: concutils.cc
	$(CC) $(CFLAGS) -c concutils.cc

clean:
	/bin/rm -f *.o
	/bin/rm -f $(PROGRAMNAME)

#Install the program in INSTALLDIR:
install:
	install $(PROGRAMNAME) $(INSTALLDIR)
	install $(MANPAGENAME) $(LOCALMANPAGEDIR)
#Uninstall the program:
uninstall:
	/bin/rm -f $(INSTALLDIR)/$(PROGRAMNAME)
	/bin/rm -f $(LOCALMANPAGEDIR)/$(MANPAGENAME)
