CROSS=-DCROSS_COMPILE
# Makefile for GNU C compiler.
#   Copyright (C) 1987, 1988, 1990, 1991, 1992 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC 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, or (at your option)
#any later version.

#GNU CC 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 CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

# The targets for external use include:
# all, doc, proto, install, install-cross, install-cross-rest,
# uninstall, TAGS, mostlyclean, clean, distclean, realclean,
# stage1, stage2, stage3, stage4.

# Variables that exist for you to override.
# See below for how to change them for certain systems.

# Selection of languages to be made.
LANGUAGES = c c++ objective-c

# Various ways of specifying flags for compilations:  
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.

# The GCC to use for compiling libgcc2.a, enquire, and cross-test.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
GCC_FOR_TARGET = ./xgcc -B./

# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.

TARGET_TOOLPREFIX = $(tooldir)/bin/
AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
AR_FOR_TARGET_FLAGS = rc
CROSS_TOOLS =

# Dir to search for system headers.  Overridden by cross-make.
SYSTEM_HEADER_DIR = /usr/include

target=m6811-local

# Directory where sources are, from where we are.
srcdir = .
# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
prefix = c:
# Directory in which to put host dependent programs and libraries
exec_prefix = $(prefix)
# Directory in which to put the executable for the command `gcc'
bindir = $(exec_prefix)/bin
# Directory in which to put the directories used by the compiler.
libdir = $(exec_prefix)/lib
# Directory in which the compiler finds executables, libraries, etc.
libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
# Directory for header file assert.h.
includedir = $(prefix)/include
# assertdir is overridden in cross-make.
assertdir = $(includedir)
# Extension (if any) to put in installed man-page filename.
manext = .1
# Directory in which to put man pages.
mandir = $(prefix)/man/man1
# Directory in which to find other cross-compilation tools and headers.
# Used in install-cross.
tooldir = $(prefix)/$(target)
# Dir for temp files.
tmpdir = /tmp

# Additional system libraries to link with.
CLIB=

# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o

# List of things which should already be built whenever we try to use xgcc
# to compile anything (without linking).
GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)

# List of things which should already be built whenever we try to use xgcc
# to link anything.
GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)

# Directory to link to, when using the target `maketest'.
DIR = ../gcc

HOST_CC=$(CC)
HOST_CFLAGS=$(ALL_CFLAGS)
HOST_CLIB=$(CLIB)
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_MALLOC=$(MALLOC)
HOST_OBSTACK=$(OBSTACK)

# Choose the real default target.
ALL=all.internal

# Choose the real install target.
INSTALL_TARGET=install-native

# End of variables for you to override.

# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
# The real definition is under `all.internal' (for native compilers)
# or `all.cross' (for cross compilers).
all: all.indirect

CC=gcc
OLDCC=gcc

# This variable gets added to GCC_CFLAGS.
CROSS_GCC_CFLAGS = -B$(tooldir)/bin/

# Cause installation of the cross-compilation tools
# before we try to build libgcc.a.
CROSS_TOOLS = install-cross-tools

# Dir to search for system headers.  Normally /usr/include.
SYSTEM_HEADER_DIR = $(libsubdir)/sys-include

# Cause installation using install-cross.
INSTALL_TARGET = install-cross

# Don't try to compile the things we can't compile.
ALL = all.cross

# Don't install assert.h in /usr/local/include.
assertdir = $(tooldir)/include
####build overrides

# Now figure out from those variables how to compile and link.

all.indirect: $(ALL)

# IN_GCC tells obstack.h to use gstddef.h.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC

# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS) $(XCFLAGS)

# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)

# Dependency on obstack, malloc or whatever library facilities
# are not installed in the system libraries.
LIBDEPS= $(OBSTACK) $(MALLOC)

# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(OBSTACK) $(ALLOCA) $(MALLOC) $(CLIB)

# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
HOST_LIBS = $(HOST_OBSTACK) $(HOST_ALLOCA) $(HOST_MALLOC)  \
	    $(HOST_CLIB)

HOST_RTL = $(HOST_PREFIX)rtl.o
HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
HOST_PRINT = $(HOST_PREFIX)print-rt.o

# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I.

# Always use -I$(srcdir)/config when compiling.
.c.o:
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

# A list of all the language-specific executables.
COMPILERS = cc1 cc1plus cc1obj

# Language-specific object files for C.
C_OBJS = c-parse.o c-lang.o c-lex.o \
   c-decl.o c-typeck.o c-conver.o c-aux-in.o c-common.o c-pragma.o

# Language-specific object files for Objectionable C.
OBJC_OBJS = objc-par.o objc-act.o \
   c-lex.o c-decl.o c-typeck.o c-conver.o c-aux-in.o c-common.o c-pragma.o

# Language-specific object files for C++.
CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
   cp-typec.o cp-type2.o cp-tree.o cp-ptree.o \
   cp-cvt.o cp-searc.o cp-lex.o cp-gc.o cp-call.o \
   cp-class.o cp-init.o cp-metho.o cp-excep.o \
   cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
   $(CPLUS_INPUT) cp-spew.o c-common.o

# Language-independent object files.
OBJS = toplev.o version.o tree.o print-tr.o stor-lay.o fold-con.o \
 function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
 rtl.o print-rt.o rtlanal.o emit-rtl.o \
 dbxout.o sdbout.o dwarfout.o xcoffout.o \
 integrat.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
 regclass.o local-al.o global.o reload.o reload1.o caller-s.o \
 insn-pee.o reorg.o sched.o final.o recog.o reg-stac.o \
 insn-rec.o insn-ext.o insn-out.o insn-emi.o \
 insn-att.o aux-outp.o getpwd.o $(EXTRA_OBJS)

# GEN files are listed separately, so they can be built before doing parallel
#  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
#  them before rtl.o is compiled.
GEN= genemit genoutpu genrecog genextra genflags gencodes genconfi genpeep

# The files that "belong" in CONFIG_H are deliberately omitted
# because having them there would not be useful in actual practice.
# All they would do is cause complete recompilation every time
# one of the machine description files is edited.
# That may or may not be what one wants to do.
# If it is, rm *.o is an easy way to do it.
# CONFIG_H = config.h tm.h
CONFIG_H =
MACHMODE_H = machmode.h machmode.def
RTL_H = rtl.h rtl.def
TREE_H = tree.h real.h tree.def
CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def

all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler.
all.cross: native $(EXTRA_PARTS)
# This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc $(EXTRA_PARTS)
# This is what must be made before installing GCC and converting libraries.
start.encap: native xgcc specs $(LIBGCC1) xlimits.h
# Use this to make a GCC that will be used only to recompile GCC.
for-bootstrap: start.encap libgcc.a
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)

# Define the names for selecting languages in LANGUAGES.
C c: cc1
C++ c++: cc1plus
OBJC objc: cc1obj 
OBJECTIVE-C objective-c: cc1obj 
PROTO: proto

cc1: $(C_OBJS) $(OBJS) $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 @link.cc1

cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus @link.ccp

cc1obj: $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj @link.cob

# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# Dependencies on gvarargs.h are not written
# because all that file does, when not compiling with GCC,
# is include the system varargs.h.

# C language specific files.

c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) c-lex.h c-parse.h \
    c-tree.h input.h flags.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c

c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) c-tree.h c-lex.h flags.h
c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) c-tree.h flags.h
c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) 
c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) c-lex.h c-tree.h c-parse.h \
    input.h flags.h
c-aux-in.o : c-aux-in.c  $(CONFIG_H) $(TREE_H) $(MACHMODE_H) c-tree.h flags.h
c-conver.o : c-conver.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) flags.h
c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) 

# C++ language specific files.

cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H) flags.h
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) cp-parse.c

cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  \
   $(srcdir)/cp-parse.h flags.h
cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  \
   $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h \
  cp-lex.h cp-decl.h stack.h
cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h \
  cp-lex.h cp-decl.h
cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-typec.o : cp-typec.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  stack.h \
    cp-class.h flags.h
cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  stack.h cp-class.h \
    flags.h
cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-metho.o : cp-metho.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H) 
cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H) 
cp-searc.o : cp-searc.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  stack.h flags.h
cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H) 
cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-excep.o : cp-excep.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  flags.h
cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) $(MACHMODE_H) flags.h \
  expr.h insn-cod.h
cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  stack.h flags.h
cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H) 
cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) $(MACHMODE_H)  cp-decl.h cp-parse.h

# Objectionable C language specific files.

objc-par.o : $(srcdir)/objc-par.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  c-lex.h \
   c-tree.h input.h flags.h objc-act.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-par.c

objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  c-tree.h c-lex.h \
   flags.h objc-act.h

# A file used by all variants of C.

c-common.o : c-common.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  c-tree.h c-lex.h flags.h

# Language-independent files.

gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  -DTOOLDIR=\"$(tooldir)/\" \
  -c gcc.c

dumpvers: dumpvers.c

version.o: version.c
obstack.o: obstack.c

tree.o : tree.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  gvarargs.h flags.h function.h
print-tr.o : print-tr.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H) 
stor-lay.o : stor-lay.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  function.h
fold-con.o : fold-con.c $(CONFIG_H) $(TREE_H) $(MACHMODE_H)  flags.h 
toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) flags.h input.h \
   insn-att.h xcoffout.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	  $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \
	  -c toplev.c

rtl.o : rtl.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) 

print-rt.o : print-rt.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) 
rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) 

varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) flags.h function.h \
   defaults.h insn-cod.h expr.h hard-reg.h regs.h xcoffout.h
function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h function.h  \
   insn-fla.h insn-cod.h expr.h regs.h hard-reg.h insn-con.h \
   recog.h output.h
stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h function.h  \
   insn-fla.h insn-con.h insn-cod.h hard-reg.h expr.h loop.h recog.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) gvarargs.h flags.h function.h  \
   insn-fla.h insn-cod.h expr.h insn-con.h recog.h output.h typeclas.h
calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h expr.h insn-cod.h \
   insn-fla.h
expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h  \
   insn-fla.h insn-con.h insn-cod.h expr.h recog.h
explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h hard-reg.h \
   insn-con.h expr.h recog.h insn-fla.h insn-cod.h
optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h  \
   insn-fla.h insn-con.h insn-cod.h expr.h recog.h
dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) flags.h regs.h \
   insn-con.h reload.h gstab.h xcoffout.h defaults.h output.h
sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) gsyms.h flags.h \
   insn-con.h reload.h
dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) dwarf.h flags.h \
   insn-con.h reload.h output.h defaults.h
xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(MACHMODE_H) xcoffout.h flags.h
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h gvarargs.h function.h  \
   regs.h insn-con.h insn-cod.h real.h expr.h
getpwd.o : getpwd.c $(CONFIG_H)

integrat.o : integrat.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) flags.h integrat.h \
   insn-fla.h insn-con.h insn-cod.h expr.h function.h

jump.o : jump.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h hard-reg.h regs.h \
   insn-con.h insn-fla.h insn-cod.h expr.h real.h
stupid.o : stupid.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) regs.h hard-reg.h flags.h

cse.o : cse.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) regs.h hard-reg.h flags.h real.h \
   insn-con.h recog.h
loop.o : loop.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h loop.h insn-con.h \
   insn-fla.h insn-cod.h regs.h hard-reg.h recog.h expr.h real.h
unroll.o : unroll.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) insn-con.h insn-cod.h \
   integrat.h regs.h flags.h expr.h loop.h
flow.o : flow.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h insn-con.h \
   basic-bl.h regs.h hard-reg.h output.h
combine.o : combine.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) gvarargs.h flags.h  \
   insn-con.h insn-fla.h insn-cod.h insn-att.h regs.h expr.h \
   basic-bl.h recog.h real.h
regclass.o : regclass.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) hard-reg.h flags.h \
   basic-bl.h regs.h insn-con.h recog.h reload.h real.h
local-al.o : local-al.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h basic-bl.h \
   regs.h hard-reg.h insn-con.h recog.h output.h
global.o : global.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h  \
   basic-bl.h regs.h hard-reg.h insn-con.h output.h

reload.o : reload.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h \
   reload.h recog.h hard-reg.h insn-con.h insn-cod.h regs.h real.h
reload1.o : reload1.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h expr.h \
   reload.h regs.h hard-reg.h insn-con.h insn-fla.h insn-cod.h \
   basic-bl.h recog.h output.h
caller-s.o : caller-s.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) flags.h \
   regs.h hard-reg.h insn-con.h basic-bl.h recog.h reload.h expr.h
reorg.o : reorg.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) conditio.h hard-reg.h \
   basic-bl.h regs.h insn-con.h insn-att.h insn-fla.h recog.h \
   flags.h output.h
sched.o : sched.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) basic-bl.h regs.h hard-reg.h \
   flags.h insn-con.h insn-att.h
final.o : final.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) gvarargs.h flags.h regs.h \
   recog.h conditio.h insn-con.h insn-att.h real.h output.h \
   hard-reg.h insn-fla.h insn-cod.h gstab.h xcoffout.h defaults.h
recog.o : recog.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H)  \
   regs.h recog.h hard-reg.h flags.h insn-con.h insn-att.h \
   insn-fla.h insn-cod.h real.h
reg-stac.o : reg-stac.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(MACHMODE_H) \
   regs.h hard-reg.h flags.h insn-con.h

aux-outp.o : aux-outp.c $(CONFIG_H) \
   $(RTL_H) $(MACHMODE_H) regs.h hard-reg.h real.h insn-con.h conditio.h \
   insn-fla.h output.h insn-att.h insn-cod.h

# Generate header and source files from the machine description, 
# and compile them.

.PRECIOUS: insn-con.h insn-fla.h insn-cod.h \
  insn-emi.c insn-rec.c insn-ext.c insn-out.c insn-pee.c \
  insn-att.h insn-att.c

# The following pair of rules has this effect:
# genconfi is run only if the md has changed since genconfi was last run;
# but the file insn-con.h is touched only when its contents actually change.

# Each of the other insn-* files is handled by a similar pair of rules.

# This causes an anomaly in the results of make -n
# because insn-* is older than stamp-*
# and thus make -n thinks that insn-* will be updated
# and force recompilation of things that depend on it.
# We use move-if-changed precisely to avoid such recompilation.
# But there is no way to teach make -n that it will be avoided.

# Each of the insn-*.[ch] rules has a semicolon at the end,
# for otherwise the system Make on SunOS 4.1 never tries
# to recompile insn-*.o.

insn-con.h: _stconf
_stconf : md genconfi
	go32 genconfi md > insn-con.h
	echo > _stconf

insn-fla.h: _stflags
_stflags : md genflags 
	go32 genflags md > insn-fla.h
	echo > _stflags

insn-cod.h: _stcodes
_stcodes : md gencodes 
	go32 gencodes md > insn-cod.h
	echo > _stcodes

insn-emi.o : insn-emi.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) expr.h real.h output.h \
  insn-con.h insn-fla.h insn-cod.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emi.c

insn-emi.c: _stemit
_stemit : md genemit 
	go32 genemit md > insn-emi.c
	echo > _stemit

insn-rec.o : insn-rec.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) insn-con.h recog.h \
  real.h output.h flags.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-rec.c

insn-rec.c: _strecog
_strecog : md genrecog
	go32 genrecog md > insn-rec.c
	echo > _strecog

insn-ext.o : insn-ext.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) 
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-ext.c

insn-ext.c: _stextr
_stextr : md genextra
	go32 genextra md > insn-ext.c
	echo > _stextr

insn-pee.o : insn-pee.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) regs.h output.h real.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-pee.c

insn-pee.c: _stpeep
_stpeep : md genpeep
	go32 genpeep md > insn-pee.c
	echo > _stpeep

insn-att.o : insn-att.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) regs.h real.h output.h \
     insn-att.h insn-con.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-att.c

insn-att.h: _stattr
_stattr : md genattr
	go32 genattr md > insn-att.h
	echo > _stattr

insn-att.c: _statab
_statab : md genattrt
	go32 genattrt md > insn-att.c
	echo > _statab

insn-out.o : insn-out.c $(CONFIG_H) $(RTL_H) $(MACHMODE_H) regs.h real.h conditio.h \
    hard-reg.h insn-con.h insn-fla.h insn-att.h output.h recog.h \
    insn-cod.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-out.c

insn-out.c: _stout
_stout : md genoutpu
	go32 genoutpu md > insn-out.c
	echo > _stout

# Compile the programs that generate insn-* from the machine description.
# They are compiled with $(HOST_CC), and associated libraries,
# since they need to run on this machine
# even if GCC is being compiled to run on some other machine.

# $(CONFIG_H) is omitted from the deps of the gen*.o
# because these programs don't really depend on anything 
# about the target machine.  They do depend on config.h itself,
# since that describes the host machine.

genconfi : genconfi.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfi \
	  genconfi.o $(HOST_RTL) $(HOST_LIBS)

genconfi.o : genconfi.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfi.c

genflags : genflags.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
	 genflags.o $(HOST_RTL) $(HOST_LIBS)

genflags.o : genflags.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c

gencodes : gencodes.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
	 gencodes.o $(HOST_RTL) $(HOST_LIBS)

gencodes.o : gencodes.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c

genemit : genemit.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
	 genemit.o $(HOST_RTL) $(HOST_LIBS)

genemit.o : genemit.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c

genrecog : genrecog.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
	 genrecog.o $(HOST_RTL) $(HOST_LIBS)

genrecog.o : genrecog.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c

genextra : genextra.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextra \
	 genextra.o $(HOST_RTL) $(HOST_LIBS)

genextra.o : genextra.c $(RTL_H) $(MACHMODE_H) hconfig.h insn-con.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextra.c

genpeep : genpeep.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
	 genpeep.o $(HOST_RTL) $(HOST_LIBS)

genpeep.o : genpeep.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c

genattr : genattr.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
	 genattr.o $(HOST_RTL) $(HOST_LIBS)

genattr.o : genattr.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c

genattrt : genattrt.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrt \
	 genattrt.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)

genattrt.o : genattrt.c $(RTL_H) $(MACHMODE_H) hconfig.h insn-con.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrt.c

genoutpu : genoutpu.o $(HOST_RTL)
	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutpu \
	 genoutpu.o $(HOST_RTL) $(HOST_LIBS)

genoutpu.o : genoutpu.c $(RTL_H) $(MACHMODE_H) hconfig.h
	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutpu.c

# Remake cpp and protoize.

# Making the preprocessor
cpp: cccp.o cexp.o version.o $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cpp cccp.o cexp.o version.o $(LIBS)
cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
cccp.o: cccp.c $(CONFIG_H) pcp.h version.c
	$(CC) -g $(INCLUDES) \
	-DGPLUSPLUS_INCLUDE_DIR=\"\" -DGCC_INCLUDE_DIR=\"\" \
	-c cccp.c

getopt.o: $(srcdir)/getopt.c getopt.h
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
getopt1.o: $(srcdir)/getopt1.c getopt.h
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c

clean:
	rm -f *.o $(GEN) cpp cc1 cc1plus cc1obj

#In GNU Make, ignore whether `stage*' exists.
.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4

force:
