VPATH = ../../../src/gcc/objc
#  GNU Objective C frontend Makefile
#  Copyright (C) 1993, 1995, 1996, 1997, 1998 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, 59 Temple Place - Suite 330,
#  Boston, MA 02111-1307, USA.

#  The Makefile built from this file lives in the objc language subdirectory.
#  Its purpose is to provide support for:
#
#  1. recursion where necessary, and only then (building .o's), and
#  2. building and debugging cc1objc from the language subdirectory.
#
#  The parent Makefile handles all other chores, with help from the language
#  Makefile fragment.
#
#  The targets for external use are `all' and `mostlyclean'.

SHELL=/bin/sh

OPTIMIZE= -O

srcdir = ../../../src/gcc/objc
VPATH = $(srcdir)

AR = ar
AR_FLAGS = rc

# Define this as & to perform parallel make on a Sequent.
# Note that this has some bugs, and it seems currently necessary 
# to compile all the gen* files first by hand to avoid erroneous results.
P =

# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
all: all.indirect

# sed inserts variable overrides after the following line.
####target overrides
# Makefile fragment for Storm target.

# Each compilation environment (GCC, SAS/C, StormC, etc) provides its
# own equivalent of the UNIX /usr/include tree.  For gcc, the standard headers
# are in /gg/include and system specific headers are in /gg/os-include.
# Use these paths for fixincludes.

SYSTEM_HEADER_DIR = /gg/include

# Extra object file linked to the cc1* executables.
storm.o: $(srcdir)/config/m68k/storm.c $(CONFIG_H)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

stormsupport.o: $(srcdir)/config/stormsupport.c $(CONFIG_H)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

# We don't need a libgcc1, it's all in our own H&P-libs.

LIBGCC1 =
CROSS_LIBGCC1 =

### end-GG-local
# Handle cpp installation.
INSTALL_CPP=install-cpp
UNINSTALL_CPP=uninstall-cpp
####host overrides
# Makefile fragment for AmigaOS host

# Uncomment the following macro to get a resident GCC. We don't do it
# by default, since we want to support users with mc68000.

RESIDENT = -m68020 -resident32

# The standard additional host flags for the compiler. Since we have
# to build with gcc anyway, we want a well optimized code.

X_CFLAGS = -O2 -fomit-frame-pointer

# Additional host flags that are not used when compiling with GCC_FOR_TARGET,
# such as when compiling the libgcc* runtime archives. GCC uses stack
# a lot, and since AmigaOS provides processes with a small, fixed size
# stack, we have to generate code that will extend it whenever necessary.

XCFLAGS = -mstackextend $(RESIDENT)

# AmigaOS supports "AmigaGuide(R)" hypertext files. For GCC, these are
# build with a custom "makeinfo".

### begin-GG-local: gcc-amigaos
EXTRA_DOC_TARGETS = guide gcc-amigaos-doc
### end-GG-local

# Arrange for guides to be build with GCC, in the build directory.

ALL = all.internal doc

# Actually build guides

guide: cpp.guide gcc.guide

cpp.guide: cpp.texi
	$(MAKEINFO) -I$(srcdir) $(srcdir)/cpp.texi --output=$@ --amiga

gcc.guide: gcc.texi extend.texi install.texi invoke.texi \
		md.texi rtl.texi tm.texi
	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc.texi --output=$@ --amiga

# Arrange for guides to be installed with GCC.

### begin-GG-local: gcc-amigaos
INSTALL_TARGET=install-normal install-guide install-gcc-amigaos-doc
### end-GG-local

# Where the guide files go

guidedir = $(prefix)/guide

# Actually install guides.

install-guide: doc installdirs
	-if [ -d $(guidedir) ] ; then true ; else mkdir $(guidedir) ; chmod a+rx $(guidedir) ; fi
	-rm -f $(guidedir)/cpp.guide $(guidedir)/gcc.guide
	for f in cpp.guide gcc.guide; \
	do $(INSTALL_DATA) $$f $(guidedir)/$$f; done
	-chmod a-x $(guidedir)/cpp.guide $(guidedir)/gcc.guide

### begin-GG-local: gcc-amigaos
# Build and install gcc-amigaos.guide - documentation specific to the
# AmigaOS port of GCC.

gcc-amigaos-doc: gcc-amigaos.info gcc-amigaos.guide

gcc-amigaos.info: gcc-amigaos.texi
	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc-amigaos.texi --output=$@

gcc-amigaos.guide: gcc-amigaos.texi
	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc-amigaos.texi --output=$@ --amiga

install-gcc-amigaos-doc: doc installdirs
	-if [ -d $(guidedir) ] ; then true ; else mkdir $(guidedir) ; chmod a+rx $(guidedir) ; fi
	-rm -f $(infodir)/gcc-amigaos.info* $(guidedir)/gcc-amigaos.guide
	for f in gcc-amigaos.info*; \
	do $(INSTALL_DATA) $$f $(infodir)/$$f; done
	$(INSTALL_DATA) gcc-amigaos.guide $(guidedir)
	-chmod a-x $(infodir)/gcc-amigaos.info* $(guidedir)/gcc-amigaos.guide
### end-GG-local
####cross overrides
####build overrides
#

# Now figure out from those variables how to compile and link.
all.indirect: Makefile frontend

frontend:
	cd ..; $(MAKE) cc1obj$(exeext)

Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
	cd ..; $(SHELL) config.status

mostlyclean:
	-rm -f *.o xforward fflags
clean: mostlyclean
distclean: mostlyclean
extraclean: mostlyclean

# For Sun VPATH.

