# This file was generated automatically by configure.  Do not edit.
VPATH = .
links = 
host_alias = i386-coh
host_cpu = i386
host_vendor = unknown
host_os = coh
host_canonical = i386-unknown-coh
target_alias = i386-coh
target_cpu = i386
target_vendor = unknown
target_os = coh
target_canonical = i386-unknown-coh
package_makefile_frag = Make.pack
target_makefile_frag = ../target-mkfrag
###*#######################################################################
#
# Makefile to test the installation of g++ and libg++
# (by hgs@cygnus.com)
# 
# Usage: make foo_main test-90S test-90D PREFIX=prefix [other macros]

srcdir = .


#
# Compilation macros
#
PREFIX		= $(prefix)

CFLAGS		=
CXXFLAGS	=
CPP_FLAGS	= #-I$(srcdir)/../g++-include
OPTIMIZE_FLAGS	= -O
DEBUG_FLAGS	= -g -v #-Wall
COMPILE_FLAGS=$(NOSTDINC) -I.. -I$(srcdir) -I$(srcdir)/../src -I$(srcdir)/../$(IO_DIR) $(WRAP_C_INCLUDES) $(XTRAFLAGS) 


DEPEND_SOURCES = $(srcdir)/*.cc


T90  = $(T90S) $(T90D)
T90D =  # dex_bar

FLAGS_90 = \
 GXX="$(GXX)"\
 CPP_FLAGS="$(CPP_FLAGS)"\
 OPTIMIZE_FLAGS="$(OPTIMIZE_FLAGS)"\
 DEBUG_FLAGS="$(DEBUG_FLAGS)"\
 GXXLDFLAGS="$(GXXLDFLAGS)"

#### package, host, target, and site dependent Makefile fragments come in here.
# Start of package fragment generated by ./../config.shared.
# TOPDIR=$${rootme}../../ invsubdir= subdir=
srcdir = .
SUBDIRS = 
prefix = /u1/gnu
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
datadir = $(prefix)/lib
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
gxx_includedir = $(libdir)/g++-include
docdir = $(datadir)/doc

SHELL = /bin/sh

INSTALL = ${rootme}$(srcdir)/../../install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)

AR = `if [ -f $${rootme}../../binutils/ar ] ; \
	then echo $${rootme}../../binutils/ar ; \
	else echo ar ; fi`
AR_FLAGS = rc
RANLIB = `if [ -f $${rootme}../../binutils/ranlib ] ; \
	then echo $${rootme}../../binutils/ranlib ; \
	else echo ranlib ; fi`
NM = `if [ -f $${rootme}../../binutils/nm ] ; \
	then echo $${rootme}../../binutils/nm ; \
	else echo nm ; fi`

MAKEINFO = `if [ -f $${rootme}../../texinfo/C/makeinfo ] ; \
	then echo $${rootme}../../texinfo/C/makeinfo ; \
	else echo makeinfo ; fi`
TEXIDIR=${srcdir}/../..//texinfo
TEXI2DVI = TEXINPUTS=${TEXIDIR}:$$TEXINPUTS texi2dvi

CC = `if [ -f $${rootme}../../gcc/xgcc ] ; \
	then echo $${rootme}../../gcc/xgcc -B$${rootme}../../gcc/ ; \
	else echo cc ; fi`
CXX = `if [ -f $${rootme}../../gcc/xgcc ] ; \
	then echo $${rootme}../../gcc/xgcc -B$${rootme}../../gcc/ ; \
	else echo gcc ; fi`

XTRAFLAGS = `if [ -f $${rootme}../../gcc/xgcc ] ;\
	then echo -I$${rootme}../../gcc/include;\
	else echo ; fi`
WRAP_C_INCLUDES =
CFLAGS = -g
CXXFLAGS = -g -O
PROTODIR = $(srcdir)/../src/gen
LIBS = ../libg++.a
IO_DIR = ../libio
# IO_DIR = no-stream
.PHONY: all
all: $(NOTHING)


CXXINCLUDES = $(NOSTDINC) -I. -I../../libio -I$(srcdir) -I$(srcdir)/../$(IO_DIR) -I$(srcdir)/../src $(WRAP_C_INCLUDES) $(XTRAFLAGS)
CINCLUDES = $(XTRAFLAGS)
.SUFFIXES: .o .C .cc
.c.o:
	$(CC) -c $(CFLAGS) $(CINCLUDES) $<
.C.o:
	$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $<
.cc.o:
	$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $<


.PHONY: install
install:
.PHONY: check
check: $(NOTHING) 
.PHONY: info dvi install-info clean-info
info:
dvi:
install-info:
.PHONY: do-clean-info clean-info do-clean-dvi clean-dvi
do-clean-info:
do-clean-dvi:
clean-info: do-clean-info
clean-dvi: do-clean-dvi

.PHONY: boltcc
boltcc:
	rootme=`pwd`/ ; export rootme ; $(MAKE) $(FLAGS_TO_PASS)


# clean rules
.PHONY: mostlyclean clean distclean realclean
mostlyclean: clean-dvi
	rm -rf ${TEMP_FILES} dfoo_main da db core  
clean: clean-dvi
	rm -rf ${TEMP_FILES} dfoo_main da db core    
distclean: clean
	rm -rf config.status Makefile *~ Make.pack
realclean: clean clean-info
	rm -rf config.status Makefile *~ Make.pack depend *.info*

.PHONY: force
force:

# with the gnu make, this is done automatically.

Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
	$(SHELL) ./config.status

.NOEXPORT:
MAKEOVERRIDES=
# End of package fragment generated by ./../config.shared.
# Warning this fragment is automatically generated
# RANLIB = ranlib
# Use -nostdinc++ flag if your version of gcc understands it.
NOSTDINC = -nostdinc++

# If the C include files are C++-ready (with extern "C"), uncomment next line:
# WRAP_C_INCLUDES =

# Flags to pass to gen-params when building _G_config.h.
# For example: G_CONFIG_ARGS = size_t="unsigned long"
G_CONFIG_ARGS =
##


TEMP_FILES = *.o foo_main a b *foo_main.out *foo_main.diff *foo_main.run

help:
	@echo Usage: make foo_main test-40 test-90S test-90D PREFIX=prefix [other macros]


test-90S: foo_main a b

test-90S-then-clean: test-90S
	rm -f ${TEMP_FILES}

test-90D: dfoo_main da db

test-90D-then-clean: test-90D
	rm -f ${TEMP_FILES}

test: $(TEST)
	for P in $(TEST) ; do if [ $$P != foo_main ]; then eval ./$$P; fi; done

a : a.o
	$(CXX) -o a  a.o $(LIBS)
da : a.o
	$(CXX) -o da -dynamic  a.o $(LIBS)


b : bf.o bm.o
	$(CXX) -o b bm.o bf.o $(LIBS)

db : bf.o bm.o
	$(CXX) -o db -dynamic bm.o bf.o $(LIBS)


foo_main:   foo_main.diff
	@true

dfoo_main: dfoo_main.diff
	@true

foo_main.run: foo_main.o foo_func.o Foo.o expected.out
	$(CXX) $(DEBUG_FLAGS) -o $@  foo_main.o foo_func.o Foo.o

foo_main.out: foo_main.run
	./foo_main.run > foo_main.out

foo_main.diff: foo_main.out $(srcdir)/expected.out
	@echo "diff $(srcdir)/expected.out foo_main.out >foo_main.diff"
	@diff $(srcdir)/expected.out foo_main.out >foo_main.diff \
	  || (echo "Static constructor test failed - see libg++/README"; false)

dfoo_main.run: foo_main.o foo_func.o Foo.o
	$(CXX) $(DEBUG_FLAGS) -o $@ -dynamic foo_main.o foo_func.o Foo.o $(LIBS)

dfoo_main.out: dfoo_main.run
	./dfoo_main.run > dfoo_main.out

dfoo_main.diff: dfoo_main.out $(srcdir)/expected.out
	diff $(srcdir)/expected.out dfoo_main.out

ex_bar.o: ex_bar.cc
	$(CXX) -fhandle-exceptions ex_bar.cc

ex_bar: ex_bar.o
	$(CXX) $(DEBUG_FLAGS) -o $@ ex_bar.o

dex_bar: ex_bar.o
	$(CXX) $(DEBUG_FLAGS) -o $@ -dynamic ex_bar.o

# --- Generate depend rules ---

SRCDIR=$(srcdir)/..

# The sed script below attempts to make the depend output portable by
# making the output use the same macros used elsewhere in the Makefile:
# - It replaces double // by a single /.
# - It replaces include files that match part of the GXX_INCLUDE_DIRS
#   by names defined in terms of the macros used to define GXX_INCLUDE_DIRS.
# - It removes any absolute include file names that remain.
# - then remove lines, which contain only `\'
#
depend: depend.tmp
	if [ "x$(DEPEND_SOURCES)" != "x" ] ; then \
	sed < depend.tmp \
	  -e 's|//|/|g' \
	  -e 's|$(srcdir)|$$(srcdir)|g' \
	  -e 's| /[^ ]*[.]h||g' \
	  -e 's|: *\$$(srcdir)/\(.*\.[cC]*\)|: \1|' \
	  -e '/^[ 	]*\\$$/d' -e 's/^[ 	]*$$//' \
	| awk 'BEGIN   { prev = "" } \
	      /^( )*$$/ { if (prev ~ /\\$$/) \
			 { prev = substr(prev,1,length(prev)-1); next } \
		       } \
                       { print prev; prev = $$0 } \
	       END { if (prev !~ /^( )*$$/) print prev }' \
	> $(srcdir)/depend ;\
	fi

depend.tmp: $(DEPEND_SOURCES) 
	if [ "x$(DEPEND_SOURCES)" = "x" ] ; then \
	  echo "" > $(srcdir)/depend ;\
	else \
	echo "" >depend.tmp ; \
	$(SRCDIR)/utils/g++dep.sh -f depend.tmp $(GXX_INCLUDE_DIRS) \
	  $(DEPEND_SOURCES) ;\
	fi

do_depend: depend
	if [ "$(SUBDIRS)" != "" ] ; then \
	for D in $(SUBDIRS) x ; do     		   \
		if [ -d $$D ] ; then 		   \
		echo "cd $$D; $(MAKE) do_depend" ; \
		(cd $$D ; $(MAKE) do_depend );	   \
		fi ;				   \
	done ;\
	fi
	
# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

Foo.o : Foo.cc \
  $(srcdir)/Foo.h
a.o : a.cc 
bf.o : bf.cc 
bm.o : bm.cc 
ex_bar.o : ex_bar.cc \
  $(srcdir)/ex_bar.cc
foo_func.o : foo_func.cc \
  $(srcdir)/Foo.h
foo_main.o : foo_main.cc \
  $(srcdir)/Foo.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
