# Makefile for gperf/src

# Copyright (C) 1989, 1992, 1993, 1998, 2000 Free Software Foundation, Inc.
# written by Douglas C. Schmidt (schmidt@ics.uci.edu)
#
# This file is part of GNU GPERF.
#
# GNU GPERF 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 1, or (at your option)
# any later version.
#
# GNU GPERF 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 GNU GPERF; see the file COPYING.  If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA.

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

# Directories used by "make":
srcdir = @srcdir@

# Directories used by "make install":
prefix = @prefix@
local_prefix = /usr/local
exec_prefix = @exec_prefix@
bindir = @bindir@

# Programs used by "make":
# C compiler
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
# C++ compiler
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CXXCPP = @CXXCPP@
# Both C and C++ compiler
LDFLAGS = @LDFLAGS@
# Other
MV = mv
LN = ln
RM = rm -f
@SET_MAKE@

# Programs used by "make install":
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS = $(SHELL) $(srcdir)/../mkinstalldirs

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

SHELL = /bin/sh

VPATH = $(srcdir)

OBJECTS  = new.o options.o iterator.o main.o gen-perf.o key-list.o list-node.o \
           hash-table.o bool-array.o read-line.o trace.o vectors.o version.o
LIBS     = ../lib/libgp.a -lm
CPPFLAGS = -I. -I$(srcdir)/../lib

TARGETPROG = gperf

all : $(TARGETPROG)

$(TARGETPROG): $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)

# Don't use implicit rules, since AIX "make" and OSF/1 "make" don't always
# expand $< correctly in this context.
#
#%.o : %.c
#	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
#
#%.o : %.cc
#	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<

# Dependencies.
CONFIG_H = config.h
VERSION_H = version.h
VECTORS_H = vectors.h
TRACE_H = trace.h
READ_LINE_H = read-line.h read-line.icc $(TRACE_H)
OPTIONS_H = options.h options.icc $(TRACE_H)
LIST_NODE_H = list-node.h $(VECTORS_H)
KEY_LIST_H = key-list.h $(LIST_NODE_H) $(VECTORS_H) $(READ_LINE_H)
ITERATOR_H = iterator.h
HASH_TABLE_H = hash-table.h $(LIST_NODE_H)
BOOL_ARRAY_H = bool-array.h bool-array.icc $(TRACE_H) $(OPTIONS_H)
GEN_PERF_H = gen-perf.h $(KEY_LIST_H) $(BOOL_ARRAY_H)

bool-array.o : bool-array.cc $(BOOL_ARRAY_H) $(OPTIONS_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/bool-array.cc
gen-perf.o : gen-perf.cc $(GEN_PERF_H) $(OPTIONS_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/gen-perf.cc
hash-table.o : hash-table.cc $(HASH_TABLE_H) $(OPTIONS_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/hash-table.cc
iterator.o : iterator.cc $(ITERATOR_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/iterator.cc
key-list.o : key-list.cc $(KEY_LIST_H) $(OPTIONS_H) $(READ_LINE_H) $(HASH_TABLE_H) $(TRACE_H) $(VERSION_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/key-list.cc
list-node.o : list-node.cc $(LIST_NODE_H) $(OPTIONS_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/list-node.cc
main.o : main.cc $(OPTIONS_H) $(GEN_PERF_H) $(TRACE_H) $(CONFIG_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/main.cc
new.o : new.cc $(TRACE_H) $(CONFIG_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/new.cc
options.o : options.cc $(OPTIONS_H) $(ITERATOR_H) $(TRACE_H) $(VECTORS_H) $(VERSION_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/options.cc
read-line.o : read-line.cc $(READ_LINE_H) $(OPTIONS_H) $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/read-line.cc
trace.o : trace.cc $(TRACE_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/trace.cc
vectors.o : vectors.cc $(VECTORS_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/vectors.cc
version.o : version.cc $(VERSION_H)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/version.cc

install : all force
	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
	$(INSTALL_PROGRAM) $(TARGETPROG) $(DESTDIR)$(bindir)/$(TARGETPROG)

installdirs : force
	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)

uninstall : force
	$(RM) $(DESTDIR)$(bindir)/$(TARGETPROG)

check : all

mostlyclean : clean

clean : force
	$(RM) *~ *.s *.o *.a $(TARGETPROG) core

distclean : clean
	$(RM) config.status config.log config.cache Makefile config.h

maintainer-clean : distclean

force :
