blob: 76aa268013ddec83956fa7d46f997549449dc9ab [file] [log] [blame]
# Makefile for GNU CHILL compiler.
# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1998,
# 1999, 2000, 2001 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 language subdirectory.
# It's purpose is to provide support for:
#
# 1) recursion where necessary, and only then (building .o's), and
# 2) building and debugging cc1 from the language subdirectory, and
# 3) nothing else.
#
# The parent makefile handles all other chores, with help from the
# language makefile fragment, of course.
#
# The targets for external use are:
# all, TAGS, ???mostlyclean, ???clean.
# Suppress smart makes who think they know how to automake Yacc files
.y.c:
# Variables that exist for you to override.
# See below for how to change them for certain systems.
# 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.
X_CFLAGS =
T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
CC = @CC@
AR = ar
AR_FLAGS = rc
SHELL = /bin/sh
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
# 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 =
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
# We don't use cross-make. Instead we use the tools
# from the build tree, if they are available.
# program_transform_name and objdir are set by configure.in.
program_transform_name =
objdir = .
target=@target@
xmake_file=@dep_host_xmake_file@
tmake_file=@dep_tmake_file@
#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@
# Directory where texinfo.tex lives
# texidir = $(srcdir)/../../texinfo
# Top build directory, relative to here.
top_builddir = ..
# Internationalization library.
INTLLIBS = @INTLLIBS@
# Additional system libraries to link with.
CLIB=
# 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.
all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:
# sed inserts variable overrides after the following line.
####target overrides
@target_overrides@
####host overrides
@host_overrides@
#
# Now figure out from those variables how to compile and link.
all.indirect: Makefile ../chill ../cc1chill$(exeext)
# IN_GCC distinguishes between code compiled into GCC itself and other
# programs built during a bootstrap.
# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
# This is where we get libiberty.a from.
LIBIBERTY = ../../libiberty/libiberty.a
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(LIBIBERTY) $(CLIB) $(INTLLIBS)
LIBDEPS = $(INTLLIBS) $(LIBIBERTY)
# 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. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
# Flags to pass to recursive makes.
# ??? $(CC) may need some work to handle stage[123].
# ??? The choices here will need some experimenting with.
FLAGS_TO_PASS = \
"AR_FLAGS=$(AR_FLAGS)" \
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
"GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
"LDFLAGS=$(LDFLAGS)" \
"LEX=$(LEX)" \
"LEXFLAGS=$(LEXFLAGS)" \
"MAKEINFO=$(MAKEINFO)" \
"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"bindir=$(bindir)" \
"libsubdir=$(libsubdir)"
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:
#
# Lists of files for various purposes.
# Language-specific object files for CHILL
CHILL_OBJS = parse.o actions.o except.o grant.o lang.o \
tree.o lex.o decl.o typeck.o convert.o expr.o loop.o \
tasking.o timing.o inout.o satisfy.o ch-version.o \
../ggc-callbacks.o
BACKEND = ../toplev.o ../libbackend.a
../cc1chill$(exeext): $(P) $(CHILL_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CHILL_OBJS) \
$(BACKEND) $(LIBS)
# This executable is used in the CHILL regression
# test script
utils/printf : $(srcdir)/utils/printf.c
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $<
#
# This is the top-level trigger for a CHILL regression test.
# It also builds those tools needed for CHILL regression testing.
#
check: ../cc1chill$(exeext) utils/printf
cd ..; $(MAKE) $(FLAGS_TO_PASS) xgcc gcov cpp cc1 ld
$(srcdir)/regression.sh -d -p
clean-tests:
cd testsuite/execute; $(MAKE) clean
cd testsuite/execute/oe; $(MAKE) clean
cd testsuite/compile/elektra; $(MAKE) clean
cd testsuite/compile/votrics; $(MAKE) clean
cd testsuite/compile; $(MAKE) clean
cd testsuite/noncompile; $(MAKE) clean
cd testsuite/examples; $(MAKE) clean
mostlyclean:
test -d testsuite && $(MAKE) clean-tests
rm -f *.o
clean: mostlyclean
#
Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
cd ..; $(SHELL) config.status
native: config.status ../cc1chill$(exeext) ../chill
#
# Compiling object files from source files.
# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# CHILL language specific files.
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
CHILL_TREE_H = $(TREE_H) ch-tree.h ch-tree.def
# hash.h really depends on $(srcdir)/gperf.
# But this would screw things for people that don't have gperf,
# if gperf got touched, say.
# Thus you have to remove hash.h to force it to be re-made.
# Note: CHILL requires two sets of keywords, one all uppercase and
# one all lowercase. The hash table ends up with both sets in it.
$(srcdir)/hash.h:
sed -e '1,/^%%/d' < $(srcdir)/gperf | \
sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp2
cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
gperf.tmp > $(srcdir)/hash.h || ( \
echo "Please update your 'gperf' from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2 ; \
exit 1 )
$(RM) gperf.tmp gperf.tmp2
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
lex.h $(srcdir)/../flags.h $(srcdir)/../input.h \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../convert.h
decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(EXPR_H) $(srcdir)/../tree.h lex.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h $(srcdir)/../output.h
inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H) \
$(srcdir)/../diagnostic.h
lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h lex.h hash.h
loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
$(srcdir)/../flags.h $(srcdir)/../input.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
$(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
$(srcdir)/../flags.h $(srcdir)/../input.h \
lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
$(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../output.h
ch-version.o : ch-version.c
ch-version.c : Makefile
echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
## This is ugly, but I don't want GNU make to put these variables in
## the environment. Older makes will see this as a set of targets
## with no dependencies and no actions.
unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
#
# These exist for maintenance purposes.
# Update the tags table.
TAGS: force
cd $(srcdir); \
etags *.y *.h *.c *.l ../*.h ../*.c; \
.PHONY: TAGS
force: