# Makefile for g++ library version 1.34.0

# Copyright (C) 1988 Free Software Foundation
#   written by Doug Lea (dl@rocky.oswego.edu)

# This file is part of GNU CC.

# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY.  No author or distributor
# accepts responsibility to anyone for the consequences of using it
# or for whether it serves any particular purpose or works at all,
# unless he says so in writing.  Refer to the GNU CC General Public
# License for full details.

# Everyone is granted permission to copy, modify and redistribute
# GNU CC, but only under the conditions described in the
# GNU CC General Public License.   A copy of this license is
# supposed to have been given to you along with GNU CC so you
# can know your rights and responsibilities.  It should be in a
# file named COPYING.  Among other things, the copyright notice
# and this notice must be preserved on all copies.

# GNU C++ compiler name
GXX = g++

# GNU CC compiler name (needed for some .c files in libg++.a)
CC = gcc

###########################################################################
# 
# declarations from here on should not normally need to be changed 
# in order to compile libg++.a
#

I= ../g++-include

# g++ compilation flags:
# the fchar-charconst flag is mandatory for some stream ops to work sensibly
GFLAGS= -g -O -fchar-charconst -I$I -I.. -fstrength-reduce -fsave-memoized -fno-defer-pop
#GFLAGS= -g -O -fchar-charconst -I$I -I.. -fstrength-reduce -fsave-memoized -mgnu

# gcc flags for c files
CFLAGS= -g -O -I$I

# g++ files should have extension .cc
.SUFFIXES: .cc
.cc.o:
	$(GXX) $(GFLAGS) -c  $<


# library sources 
SRCS = builtin.cc  File.cc stream.cc streambuf.cc PlotFile.cc SFile.cc \
 Obstack.cc regex.c String.cc Integer.cc Rational.cc Complex.cc \
 BitSet.cc BitString.cc Random.cc RNG.cc ACG.cc MLCG.cc Sample.cc \
 Fix.cc Fix16.cc Fix24.cc CursesWindow.cc

OBJS = builtin.o File.o  stream.o streambuf.o PlotFile.o  SFile.o \
 Obstack.o  regex.o String.o  Integer.o Rational.o Complex.o \
 BitSet.o BitString.o Random.o  RNG.o ACG.o MLCG.o Sample.o \
 Fix.o Fix16.o Fix24.o CursesWindow.o

###########################################################################
#
# compilation actions
#
# compilation notes:
#
# No g++ warnings or error messages are expected to appear.
#
# A possible exception is a warning about `shadowing' the declaration
# of `timezone', since it may appear in both a system and a g++-include .h
#
# A similar message may appear about `flock', for the same reasons
#
# Expect some warnings from gcc on regex.c about `char*' vs `unsigned char*'


all: libg++.a

libg++.a: $(OBJS)
	ar r libg++.a $(OBJS)

clean:
	rm -f *.o core libg++.a C++.hack*


###########################################################################
#
#  dependencies
#

File.o:    $I/File.h $I/std.h $I/stddef.h $I/stdio.h $I/builtin.h
stream.o: $I/stream.h $I/File.h $I/stdio.h $I/builtin.h $I/streambuf.h
streambuf.o:  $I/File.h $I/stdio.h $I/builtin.h $I/streambuf.h
PlotFile.o: $I/PlotFile.h $I/File.h $I/stdio.h $I/builtin.h
SFile.o: $I/SFile.h $I/File.h $I/std.h $I/stddef.h $I/stdio.h $I/builtin.h
Obstack.o: $I/Obstack.h $I/builtin.h
String.o: $I/String.h $I/stream.h $I/regex.h $I/std.h $I/builtin.h $I/File.h
Integer.o: $I/Integer.h $I/stream.h $I/File.h $I/builtin.h
Rational.o: $I/Rational.h $I/Integer.h $I/stream.h $I/File.h $I/builtin.h
Complex.o: $I/Complex.h $I/stream.h $I/File.h $I/builtin.h
BitSet.o: $I/BitSet.h $I/stream.h $I/builtin.h $I/File.h
BitString.o: $I/BitString.h $I/stream.h $I/builtin.h $I/File.h
regex.o: $I/regex.h
builtin.o: $I/builtin.h $I/math.h
RNG.o: $I/assert.h $I/RNG.h
MLCG.o: $I/RNG.h $I/MLCG.h
ACG.o: $I/assert.h $I/RNG.h $I/ACG.h
Random.o: $I/Random.h $I/RNG.h \
 $I/Binomial.h  $I/Erlang.h $I/Geometric.h \
 $I/HyperGeometric.h $I/NegativeExpntl.h  $I/Normal.h \
 $I/LogNormal.h $I/Poisson.h $I/DiscreteUniform.h \
 $I/Uniform.h  $I/Weibull.h 
Sample.o: $I/SampleStatistic.h  $I/SampleHistogram.h $I/File.h
Fix.cc: $I/Fix.h $I/File.h 
Fix16.cc: $I/Fix16.h $I/File.h 
Fix24.cc: $I/Fix24.h $I/File.h 
CursesWindow.o: $I/curses.h $I/CursesWindow.h
