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