OSDN Git Service

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