OSDN Git Service

Fix copyrights.
[pf3gnuchains/gcc-fork.git] / gcc / ch / Makefile.in
1 # Makefile for GNU CHILL compiler.
2 #   Copyright (C) 1987, 88, 90-94, 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # The makefile built from this file lives in the language subdirectory.
21 # It's purpose is to provide support for:
22 #
23 # 1) recursion where necessary, and only then (building .o's), and
24 # 2) building and debugging cc1 from the language subdirectory, and
25 # 3) nothing else.
26 #
27 # The parent makefile handles all other chores, with help from the
28 # language makefile fragment, of course.
29 #
30 # The targets for external use are:
31 # all, TAGS, ???mostlyclean, ???clean.
32
33 # Suppress smart makes who think they know how to automake Yacc files
34 .y.c:
35
36
37 # Variables that exist for you to override.
38 # See below for how to change them for certain systems.
39
40 ALLOCA =
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 in the definition of SUBDIR_USE_ALLOCA.
70 # ??? Perhaps it would be better if it just looked for *gcc*.
71 OLDCC = cc
72
73 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
74 # It omits XCFLAGS, and specifies -B./.
75 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
76 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
77
78 # Tools to use when building a cross-compiler.
79 # These are used because `configure' appends `cross-make'
80 # to the makefile when making a cross-compiler.
81
82 # CYGNUS LOCAL: we don't use cross-make.  Instead we use the tools
83 # from the build tree, if they are available.
84 # program_transform_name and objdir are set by configure.in.
85 program_transform_name =
86 objdir = .
87
88 target= ... `configure' substitutes actual target name here.
89 xmake_file= ... `configure' substitutes actual x- file name here.
90 tmake_file= ... `configure' substitutes actual t- file name here.
91 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
92 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
93
94 # Directory where sources are, from where we are.
95 srcdir = .
96
97 # CYGNUS LOCAL
98 # Directory where texinfo.tex lives
99 texidir = $(srcdir)/../../texinfo
100
101 # Additional system libraries to link with.
102 CLIB=
103
104 # Change this to a null string if obstacks are installed in the
105 # system library.
106 OBSTACK=obstack.o
107
108 # Choose the real default target.
109 ALL=all
110
111 # End of variables for you to override.
112
113 # Definition of `all' is here so that new rules inserted by sed
114 # do not specify the default target.
115 all: all.indirect
116
117 # This tells GNU Make version 3 not to put all variables in the environment.
118 .NOEXPORT:
119
120 # sed inserts variable overrides after the following line.
121 ####target overrides
122 ####host overrides
123 ####cross overrides
124 ####build overrides
125 ####site overrides
126 \f
127 # Now figure out from those variables how to compile and link.
128
129 all.indirect: Makefile ../chill ../cc1chill$(exeext)
130
131 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
132 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
133
134 # This is the variable actually used when we compile.
135 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
136
137 # Likewise.
138 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
139
140 # CYGNUS LOCAL: SUBDIR_USE_ALLOCA is different from FSF.
141 # Even if ALLOCA is set, don't use it if compiling with GCC.
142
143 SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
144 #SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
145 SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
146 SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
147
148 # How to link with both our special library facilities
149 # and the system's installed libraries.
150 LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
151
152 # Specify the directories to be searched for header files.
153 # Both . and srcdir are used, in that order,
154 # so that tm.h and config.h will be found in the compilation
155 # subdirectory rather than in the source directory.
156 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
157
158 # Flags to pass to recursive makes.
159 # ??? $(CC) may need some work to handle stage[123].
160 # ??? The choices here will need some experimenting with.
161 FLAGS_TO_PASS = \
162         "AR_FLAGS=$(AR_FLAGS)" \
163         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
164         "BISON=$(BISON)" \
165         "BISONFLAGS=$(BISONFLAGS)" \
166         "CC=$(CC)" \
167         "CFLAGS=$(CFLAGS)" \
168         "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
169         "LDFLAGS=$(LDFLAGS)" \
170         "LEX=$(LEX)" \
171         "LEXFLAGS=$(LEXFLAGS)" \
172         "MAKEINFO=$(MAKEINFO)" \
173         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
174         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
175         "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
176         "SHELL=$(SHELL)" \
177         "exec_prefix=$(exec_prefix)" \
178         "prefix=$(prefix)" \
179         "tooldir=$(tooldir)" \
180         "bindir=$(bindir)" \
181         "libsubdir=$(libsubdir)"
182
183 # Always use -I$(srcdir)/config when compiling.
184 .c.o:
185         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
186
187 # This tells GNU make version 3 not to export all the variables
188 # defined in this file into the environment.
189 .NOEXPORT:
190 \f
191 # Lists of files for various purposes.
192
193 # Language-specific object files for CHILL
194
195 #C_OBJS = ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o
196
197 CHILL_OBJS = parse.o actions.o except.o grant.o lang.o \
198    tree.o lex.o decl.o typeck.o convert.o expr.o loop.o \
199    tasking.o timing.o inout.o satisfy.o ch-version.o
200
201 # Language-independent object files.
202 OBJS = `cat ../stamp-objlist`
203 OBJDEPS = ../stamp-objlist
204
205 ../cc1chill$(exeext): $(P) $(CHILL_OBJS) $(OBJDEPS) $(LIBDEPS)
206         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CHILL_OBJS) \
207               $(OBJS) $(C_OBJS) $(LIBS)
208
209 # This executable is used in the CHILL regression 
210 # test script
211 utils/printf : $(srcdir)/utils/printf.c
212         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $<
213
214 #
215 # This is the top-level trigger for a CHILL regression test.
216 # It also builds those tools needed for CHILL regression testing.
217 #
218 check: ../cc1chill$(exeext) utils/printf
219         cd ..; $(MAKE) $(FLAGS_TO_PASS) xgcc gcov cpp cc1 ld
220         $(srcdir)/regression.sh -d -p
221
222 clean-tests:
223         cd testsuite/execute;  $(MAKE) clean
224         cd testsuite/execute/oe;  $(MAKE) clean
225         cd testsuite/compile/elektra;  $(MAKE) clean
226         cd testsuite/compile/votrics;  $(MAKE) clean
227         cd testsuite/compile;  $(MAKE) clean
228         cd testsuite/noncompile;  $(MAKE) clean
229         cd testsuite/examples;  $(MAKE) clean
230
231 mostlyclean:
232         test -d testsuite && $(MAKE) clean-tests
233         rm -f *.o
234
235 clean:  mostlyclean
236
237 \f
238 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
239         cd ..; $(SHELL) config.status
240
241 native: config.status ../cc1chill$(exeext) ../chill
242 \f
243 # Compiling object files from source files.
244
245 # Note that dependencies on obstack.h are not written
246 # because that file is not part of GCC.
247
248 # CHILL language specific files.
249
250 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
251         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
252 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
253         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
254 CHILL_TREE_H = $(TREE_H) ch-tree.h ch-tree.def
255
256 # hash.h really depends on $(srcdir)/gperf.
257 # But this would screw things for people that don't have gperf,
258 # if gperf got touched, say.
259 # Thus you have to remove hash.h to force it to be re-made.
260 # Note: CHILL requires two sets of keywords, one all uppercase and
261 # one all lowercase.  The hash table ends up with both sets in it.
262 $(srcdir)/hash.h:
263         sed -e '1,/^%%/d' < $(srcdir)/gperf | \
264           sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp
265         gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp
266         sed -f sed.tmp < gperf.tmp > gperf.tmp2
267         cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
268         gperf -L KR-C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
269           gperf.tmp > $(srcdir)/hash.h
270         $(RM) gperf.tmp gperf.tmp2 sed.tmp
271
272 actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
273         lex.h $(srcdir)/../flags.h $(srcdir)/../../include/obstack.h \
274         $(srcdir)/../input.h $(srcdir)/../expr.h ../insn-codes.h \
275         $(srcdir)/../system.h $(srcdir)/../toplev.h
276 convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
277         $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
278 decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
279         $(srcdir)/../system.h $(srcdir)/../toplev.h
280 except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
281         $(srcdir)/../system.h $(srcdir)/../toplev.h
282 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
283         $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../tree.h lex.h \
284         $(srcdir)/../system.h $(srcdir)/../toplev.h
285 grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
286         $(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
287         $(srcdir)/../toplev.h $(srcdir)/../output.h
288 inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
289         $(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
290 lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
291         $(srcdir)/../system.h $(srcdir)/../toplev.h
292 lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
293         $(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
294         $(srcdir)/../toplev.h $(srcdir)/../../include/obstack.h lex.h \
295         $(srcdir)/../dwarfout.h hash.h
296 loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
297         $(srcdir)/../flags.h $(srcdir)/../input.h \
298         $(srcdir)/../../include/obstack.h $(srcdir)/../tree.h \
299         $(srcdir)/../system.h $(srcdir)/../toplev.h
300 parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
301         lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
302 satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
303         $(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
304 timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
305         $(srcdir)/../input.h $(srcdir)/../../include/obstack.h lex.h \
306         $(srcdir)/../system.h $(srcdir)/../toplev.h
307 tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
308         $(srcdir)/../flags.h $(srcdir)/../input.h \
309         $(srcdir)/../../include/obstack.h lex.h $(srcdir)/../system.h \
310         $(srcdir)/../toplev.h
311 tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
312         $(srcdir)/../toplev.h
313 typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
314         $(srcdir)/../expr.h $(srcdir)/../flags.h lex.h $(srcdir)/../system.h \
315         $(srcdir)/../toplev.h
316 ch-version.o : ch-version.c
317 ch-version.c : Makefile
318         echo 'char *gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
319
320 ## This is ugly, but I don't want GNU make to put these variables in
321 ## the environment.  Older makes will see this as a set of targets
322 ## with no dependencies and no actions.
323 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
324
325 \f
326 # These exist for maintenance purposes.
327
328 # Update the tags table.
329 TAGS: force
330         cd $(srcdir);                                                   \
331         etags *.y *.h *.c *.l ../*.h ../*.c;                            \
332
333 .PHONY: TAGS
334
335 force: