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)
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
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
38 # Variables that exist for you to override.
39 # See below for how to change them for certain systems.
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.
48 BOOT_CFLAGS
= -O
$(CFLAGS
)
49 # These exists to be overridden by the x-* and t-* files, respectively.
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.
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
)
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.
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
=
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`
89 # Directory where sources are, from where we are.
93 # Directory where texinfo.tex lives
94 texidir
= $(srcdir)/..
/..
/texinfo
96 # Additional system libraries to link with.
99 # Choose the real default target.
102 # End of variables for you to override.
104 # Definition of `all' is here so that new rules inserted by sed
105 # do not specify the default target.
108 # This tells GNU Make version 3 not to put all variables in the environment.
111 # sed inserts variable overrides after the following line.
118 # Now figure out from those variables how to compile and link.
120 all.indirect
: Makefile ..
/chill ..
/cc1chill
$(exeext
)
122 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
123 INTERNAL_CFLAGS
= $(CROSS
) -DIN_GCC
125 # This is the variable actually used when we compile.
126 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(X_CFLAGS
) $(T_CFLAGS
) $(CFLAGS
) $(XCFLAGS
)
129 ALL_CPPFLAGS
= $(CPPFLAGS
) $(X_CPPFLAGS
) $(T_CPPFLAGS
)
131 # This is where we get libiberty.a from.
132 LIBIBERTY
= ..
/..
/libiberty
/libiberty.a
134 # How to link with both our special library facilities
135 # and the system's installed libraries.
136 LIBS
= $(LIBIBERTY
) $(CLIB
)
137 LIBDEPS
= $(LIBIBERTY
)
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
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.
149 "AR_FLAGS=$(AR_FLAGS)" \
150 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
152 "BISONFLAGS=$(BISONFLAGS)" \
155 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
156 "LDFLAGS=$(LDFLAGS)" \
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)" \
164 "exec_prefix=$(exec_prefix)" \
166 "tooldir=$(tooldir)" \
168 "libsubdir=$(libsubdir)"
170 # Always use -I$(srcdir)/config when compiling.
172 $(CC
) -c
$(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(INCLUDES
) $<
174 # This tells GNU make version 3 not to export all the variables
175 # defined in this file into the environment.
178 # Lists of files for various purposes.
180 # Language-specific object files for CHILL
182 #C_OBJS = ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o
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 \
189 # Language-independent object files.
190 OBJS
= `cat ../stamp-objlist`
191 OBJDEPS
= ..
/stamp-objlist
193 ..
/cc1chill
$(exeext
): $(P
) $(CHILL_OBJS
) $(OBJDEPS
) $(LIBDEPS
)
194 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$(CHILL_OBJS
) \
195 $(OBJS
) $(C_OBJS
) $(LIBS
)
197 # This executable is used in the CHILL regression
199 utils
/printf
: $(srcdir)/utils
/printf.c
200 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$<
203 # This is the top-level trigger for a CHILL regression test.
204 # It also builds those tools needed for CHILL regression testing.
206 check: ..
/cc1chill
$(exeext
) utils
/printf
207 cd ..
; $(MAKE
) $(FLAGS_TO_PASS
) xgcc gcov
cpp cc1
ld
208 $(srcdir)/regression.sh
-d
-p
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
220 test -d testsuite
&& $(MAKE
) clean-tests
226 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/..
/configure
227 cd ..
; $(SHELL
) config.status
229 native
: config.status ..
/cc1chill
$(exeext
) ..
/chill
231 # Compiling object files from source files.
233 # Note that dependencies on obstack.h are not written
234 # because that file is not part of GCC.
236 # CHILL language specific files.
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
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.
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 echo
"Please update your 'gperf' from the GCC infrastructure" >&2 ; \
259 echo
" ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
261 $(RM
) gperf.tmp gperf.tmp2 sed.tmp
263 actions.o
: actions.c
$(CONFIG_H
) $(CHILL_TREE_H
) actions.h
$(RTL_H
) \
264 lex.h
$(srcdir)/..
/flags.h
$(srcdir)/..
/input.h \
265 $(srcdir)/..
/expr.h ..
/insn-codes.h
$(srcdir)/..
/system.h \
266 $(srcdir)/..
/toplev.h
267 convert.o
: convert.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/flags.h \
268 $(srcdir)/..
/tree.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
269 decl.o
: decl.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/flags.h
lex.h \
270 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
271 except.o
: except.c
$(CONFIG_H
) $(srcdir)/..
/tree.h
$(RTL_H
) $(CHILL_TREE_H
) \
272 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
273 expr.o
: expr.c
$(CONFIG_H
) $(RTL_H
) $(CHILL_TREE_H
) $(srcdir)/..
/flags.h \
274 $(srcdir)/..
/expr.h ..
/insn-codes.h
$(srcdir)/..
/tree.h
lex.h \
275 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
276 grant.o
: grant.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(RTL_H
) $(srcdir)/..
/flags.h \
277 $(srcdir)/..
/input.h
lex.h actions.h
$(srcdir)/..
/system.h \
278 $(srcdir)/..
/toplev.h
$(srcdir)/..
/output.h
279 inout.o
: inout.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/flags.h \
280 $(srcdir)/..
/input.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
281 lang.o
: lang.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/input.h
lex.h \
282 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
283 lex.o
: lex.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(RTL_H
) $(srcdir)/..
/flags.h \
284 $(srcdir)/..
/input.h
$(srcdir)/parse.h
$(srcdir)/..
/system.h \
285 $(srcdir)/..
/toplev.h
lex.h
$(srcdir)/..
/dwarfout.h hash.h
286 loop.o
: loop.c
$(CONFIG_H
) $(RTL_H
) $(CHILL_TREE_H
) lex.h \
287 $(srcdir)/..
/flags.h
$(srcdir)/..
/input.h \
288 $(srcdir)/..
/tree.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
289 parse.o
: parse.c
$(CONFIG_H
) $(CHILL_TREE_H
) parse.h \
290 lex.h actions.h tasking.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
291 satisfy.o
: satisfy.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/tree.h \
292 $(srcdir)/..
/flags.h
lex.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
293 timing.o
: timing.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(RTL_H
) $(srcdir)/..
/flags.h \
294 $(srcdir)/..
/input.h
lex.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
295 tasking.o
: tasking.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(RTL_H
) \
296 $(srcdir)/..
/flags.h
$(srcdir)/..
/input.h \
297 lex.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
298 tree.o
: tree.c
$(CONFIG_H
) $(CHILL_TREE_H
) $(srcdir)/..
/system.h \
299 $(srcdir)/..
/toplev.h
300 typeck.o
: typeck.c
$(CONFIG_H
) $(CHILL_TREE_H
) ..
/insn-codes.h \
301 $(srcdir)/..
/expr.h ..
/insn-codes.h
$(srcdir)/..
/flags.h
lex.h \
302 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
303 ch-version.o
: ch-version.c
304 ch-version.c
: Makefile
305 echo
'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
307 ## This is ugly, but I don't want GNU make to put these variables in
308 ## the environment. Older makes will see this as a set of targets
309 ## with no dependencies and no actions.
310 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET
:
313 # These exist for maintenance purposes.
315 # Update the tags table.
318 etags
*.y
*.h
*.c
*.l ..
/*.h ..
/*.c
; \