Make-lang.in (f771): Depend on ggc-callbacks.o.
[platform/upstream/gcc.git] / gcc / ch / Makefile.in
1 # Makefile for GNU CHILL compiler.
2 #   Copyright (C) 1987, 88, 90-94, 1998, 1999 Free Software Foundation, Inc.
3
4 #This file is part of GNU CC.
5
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
10
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING.  If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.  */
20
21 # The makefile built from this file lives in the language subdirectory.
22 # It's purpose is to provide support for:
23 #
24 # 1) recursion where necessary, and only then (building .o's), and
25 # 2) building and debugging cc1 from the language subdirectory, and
26 # 3) nothing else.
27 #
28 # The parent makefile handles all other chores, with help from the
29 # language makefile fragment, of course.
30 #
31 # The targets for external use are:
32 # all, TAGS, ???mostlyclean, ???clean.
33
34 # Suppress smart makes who think they know how to automake Yacc files
35 .y.c:
36
37
38 # Variables that exist for you to override.
39 # See below for how to change them for certain systems.
40
41 # Various ways of specifying flags for compilations:  
42 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
43 # BOOT_CFLAGS is the value of CFLAGS to pass
44 # to the stage2 and stage3 compilations
45 # XCFLAGS is used for most compilations but not when using the GCC just built.
46 XCFLAGS =
47 CFLAGS = -g
48 BOOT_CFLAGS = -O $(CFLAGS)
49 # These exists to be overridden by the x-* and t-* files, respectively.
50 X_CFLAGS =
51 T_CFLAGS =
52
53 X_CPPFLAGS =
54 T_CPPFLAGS =
55
56 CC = cc
57 AR = ar
58 AR_FLAGS = rc
59 SHELL = /bin/sh
60 MAKEINFO = makeinfo
61 TEXI2DVI = texi2dvi
62
63 # Define this as & to perform parallel make on a Sequent.
64 # Note that this has some bugs, and it seems currently necessary 
65 # to compile all the gen* files first by hand to avoid erroneous results.
66 P =
67
68 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
69 # It omits XCFLAGS, and specifies -B./.
70 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
71 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
72
73 # Tools to use when building a cross-compiler.
74 # These are used because `configure' appends `cross-make'
75 # to the makefile when making a cross-compiler.
76
77 # CYGNUS LOCAL: we don't use cross-make.  Instead we use the tools
78 # from the build tree, if they are available.
79 # program_transform_name and objdir are set by configure.in.
80 program_transform_name =
81 objdir = .
82
83 target= ... `configure' substitutes actual target name here.
84 xmake_file= ... `configure' substitutes actual x- file name here.
85 tmake_file= ... `configure' substitutes actual t- file name here.
86 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
87 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
88
89 # Directory where sources are, from where we are.
90 srcdir = .
91
92 # CYGNUS LOCAL
93 # Directory where texinfo.tex lives
94 texidir = $(srcdir)/../../texinfo
95
96 # Additional system libraries to link with.
97 CLIB=
98
99 # Choose the real default target.
100 ALL=all
101
102 # End of variables for you to override.
103
104 # Definition of `all' is here so that new rules inserted by sed
105 # do not specify the default target.
106 all: all.indirect
107
108 # This tells GNU Make version 3 not to put all variables in the environment.
109 .NOEXPORT:
110
111 # sed inserts variable overrides after the following line.
112 ####target overrides
113 ####host overrides
114 ####cross overrides
115 ####build overrides
116 ####site overrides
117 #\f
118 # Now figure out from those variables how to compile and link.
119
120 all.indirect: Makefile ../chill ../cc1chill$(exeext)
121
122 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
123 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
124
125 # This is the variable actually used when we compile.
126 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
127
128 # Likewise.
129 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
130
131 # This is where we get libiberty.a from.
132 LIBIBERTY = ../../libiberty/libiberty.a
133
134 # How to link with both our special library facilities
135 # and the system's installed libraries.
136 LIBS = $(LIBIBERTY) $(CLIB)
137 LIBDEPS = $(LIBIBERTY)
138
139 # Specify the directories to be searched for header files.
140 # Both . and srcdir are used, in that order,
141 # so that tm.h and config.h will be found in the compilation
142 # subdirectory rather than in the source directory.
143 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
144
145 # Flags to pass to recursive makes.
146 # ??? $(CC) may need some work to handle stage[123].
147 # ??? The choices here will need some experimenting with.
148 FLAGS_TO_PASS = \
149         "AR_FLAGS=$(AR_FLAGS)" \
150         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
151         "BISON=$(BISON)" \
152         "BISONFLAGS=$(BISONFLAGS)" \
153         "CC=$(CC)" \
154         "CFLAGS=$(CFLAGS)" \
155         "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
156         "LDFLAGS=$(LDFLAGS)" \
157         "LEX=$(LEX)" \
158         "LEXFLAGS=$(LEXFLAGS)" \
159         "MAKEINFO=$(MAKEINFO)" \
160         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
161         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
162         "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
163         "SHELL=$(SHELL)" \
164         "exec_prefix=$(exec_prefix)" \
165         "prefix=$(prefix)" \
166         "tooldir=$(tooldir)" \
167         "bindir=$(bindir)" \
168         "libsubdir=$(libsubdir)"
169
170 # Always use -I$(srcdir)/config when compiling.
171 .c.o:
172         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
173
174 # This tells GNU make version 3 not to export all the variables
175 # defined in this file into the environment.
176 .NOEXPORT:
177 #\f
178 # Lists of files for various purposes.
179
180 # Language-specific object files for CHILL
181
182 #C_OBJS = ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o
183
184 CHILL_OBJS = parse.o actions.o except.o grant.o lang.o \
185    tree.o lex.o decl.o typeck.o convert.o expr.o loop.o \
186    tasking.o timing.o inout.o satisfy.o ch-version.o \
187    ../ggc-callbacks.o
188
189 # Language-independent object files.
190 OBJS = `cat ../stamp-objlist`
191 OBJDEPS = ../stamp-objlist
192
193 ../cc1chill$(exeext): $(P) $(CHILL_OBJS) $(OBJDEPS) $(LIBDEPS)
194         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CHILL_OBJS) \
195               $(OBJS) $(C_OBJS) $(LIBS)
196
197 # This executable is used in the CHILL regression 
198 # test script
199 utils/printf : $(srcdir)/utils/printf.c
200         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $<
201
202 #
203 # This is the top-level trigger for a CHILL regression test.
204 # It also builds those tools needed for CHILL regression testing.
205 #
206 check: ../cc1chill$(exeext) utils/printf
207         cd ..; $(MAKE) $(FLAGS_TO_PASS) xgcc gcov cpp cc1 ld
208         $(srcdir)/regression.sh -d -p
209
210 clean-tests:
211         cd testsuite/execute;  $(MAKE) clean
212         cd testsuite/execute/oe;  $(MAKE) clean
213         cd testsuite/compile/elektra;  $(MAKE) clean
214         cd testsuite/compile/votrics;  $(MAKE) clean
215         cd testsuite/compile;  $(MAKE) clean
216         cd testsuite/noncompile;  $(MAKE) clean
217         cd testsuite/examples;  $(MAKE) clean
218
219 mostlyclean:
220         test -d testsuite && $(MAKE) clean-tests
221         rm -f *.o
222
223 clean:  mostlyclean
224
225 #\f
226 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
227         cd ..; $(SHELL) config.status
228
229 native: config.status ../cc1chill$(exeext) ../chill
230 #\f
231 # Compiling object files from source files.
232
233 # Note that dependencies on obstack.h are not written
234 # because that file is not part of GCC.
235
236 # CHILL language specific files.
237
238 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
239         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
240 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
241         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
242 CHILL_TREE_H = $(TREE_H) ch-tree.h ch-tree.def
243
244 # hash.h really depends on $(srcdir)/gperf.
245 # But this would screw things for people that don't have gperf,
246 # if gperf got touched, say.
247 # Thus you have to remove hash.h to force it to be re-made.
248 # Note: CHILL requires two sets of keywords, one all uppercase and
249 # one all lowercase.  The hash table ends up with both sets in it.
250 $(srcdir)/hash.h:
251         sed -e '1,/^%%/d' < $(srcdir)/gperf | \
252           sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp
253         gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp
254         sed -f sed.tmp < gperf.tmp > gperf.tmp2
255         cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
256         gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
257           gperf.tmp > $(srcdir)/hash.h
258         $(RM) gperf.tmp gperf.tmp2 sed.tmp
259
260 actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H)    \
261         lex.h $(srcdir)/../flags.h $(srcdir)/../input.h                 \
262         $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h       \
263         $(srcdir)/../toplev.h
264 convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
265         $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
266 decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
267         $(srcdir)/../system.h $(srcdir)/../toplev.h
268 except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
269         $(srcdir)/../system.h $(srcdir)/../toplev.h
270 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
271         $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../tree.h lex.h \
272         $(srcdir)/../system.h $(srcdir)/../toplev.h
273 grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
274         $(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
275         $(srcdir)/../toplev.h $(srcdir)/../output.h
276 inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
277         $(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
278 lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
279         $(srcdir)/../system.h $(srcdir)/../toplev.h
280 lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
281         $(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h    \
282         $(srcdir)/../toplev.h lex.h $(srcdir)/../dwarfout.h hash.h
283 loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
284         $(srcdir)/../flags.h $(srcdir)/../input.h \
285         $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
286 parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
287         lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
288 satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
289         $(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
290 timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
291         $(srcdir)/../input.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
292 tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
293         $(srcdir)/../flags.h $(srcdir)/../input.h \
294         lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
295 tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
296         $(srcdir)/../toplev.h
297 typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
298         $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../flags.h lex.h \
299         $(srcdir)/../system.h $(srcdir)/../toplev.h
300 ch-version.o : ch-version.c
301 ch-version.c : Makefile
302         echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
303
304 ## This is ugly, but I don't want GNU make to put these variables in
305 ## the environment.  Older makes will see this as a set of targets
306 ## with no dependencies and no actions.
307 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
308
309 \f
310 # These exist for maintenance purposes.
311
312 # Update the tags table.
313 TAGS: force
314         cd $(srcdir);                                                   \
315         etags *.y *.h *.c *.l ../*.h ../*.c;                            \
316
317 .PHONY: TAGS
318
319 force: