1 # Top level Makefile fragment for GNU CHILL.
2 # Copyright (C) 1994 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, 675 Mass Ave, Cambridge, MA 02139, USA.
20 # This file provides the language dependent support in the main Makefile.
21 # Each language makefile fragment must provide the following targets:
23 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
25 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
26 # foo.uninstall, foo.distdir,
27 # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
28 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
30 # where `foo' is the name of the language.
32 # It should also provide rules for:
34 # - making any compiler driver (eg: g++)
35 # - the compiler proper (eg: cc1plus)
36 # - define the names for selecting the language in LANGUAGES.
38 # define version of GNUCHILL compiler. Note: maybe we have to change the
40 GNUCHILL_VERSION = 1.5.2
42 # Actual names to use when installing a native compiler.
43 # (Cygnus configure overrides these when using -program-transform-name).
44 CHILL_INSTALL_NAME = chill
46 # Actual names to use when installing a cross-compiler.
47 # (Cygnus configure overrides these when using -program-transform-name).
48 CHILL_CROSS_NAME = $(target_alias)-chill
50 CHILL_SRCS = $(srcdir)/ch/actions.c $(srcdir)/ch/convert.c \
51 $(srcdir)/ch/decl.c $(srcdir)/ch/except.c $(srcdir)/ch/expr.c \
52 $(srcdir)/ch/grant.c $(srcdir)/ch/inout.c $(srcdir)/ch/lang.c \
53 $(srcdir)/ch/lex.c $(srcdir)/ch/loop.c \
54 $(srcdir)/ch/parse.c $(srcdir)/ch/satisfy.c \
55 $(srcdir)/ch/tasking.c $(srcdir)/ch/timing.c $(srcdir)/ch/tree.c \
58 # Extra flags to pass to recursive makes.
59 CHILL_FLAGS_TO_PASS = \
60 "CHILLFLAGS=$(CHILLFLAGS)" \
61 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
62 "CHILL_LIB=$(CHILL_LIB)" \
64 "GNUCHILL_VERSION=$(GNUCHILL_VERSION)"
66 # Define the names for selecting languages in LANGUAGES.
67 CHILL: chill cc1chill chill-runtime
69 # handle startfile in chill script and build script to install
70 chill: $(srcdir)/ch/chill.in Makefile
72 sed -e "s:startfile=chillrt0:startfile=$${thisdir}/ch/runtime/chillrt0.o:" \
73 -e "s:libpath=chillrt:libpath=-L$${thisdir}/ch/runtime/:" \
74 -e "s:whatgcc=gcc:whatgcc=\"$${thisdir}/xgcc -B$${thisdir}/\":" \
75 -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
76 -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill ; \
78 if [ -f ../gcc-cross$(exeext) ]; then \
79 whatgcc=$(GCC_CROSS_NAME) ; \
81 whatgcc=$(GCC_INSTALL_NAME) ; \
83 sed -e "s:startfile=chillrt0:startfile=$(libsubdir)/chillrt0.o:" \
84 -e "s:whatgcc=gcc:whatgcc=$(bindir)/$${whatgcc}:" \
85 -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
86 -e "s:libpath=chillrt:libpath=:" \
87 -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill.install ; \
88 chmod a+x chill.install
90 # Don't depend on cc1chill, because chill-cross is always built for cross,
91 # and thus a cc1chill dependence would force cc1chill to always be built.
92 # Note that gcc-cross and g++-cross do not have cc1 or cc1plus dependencies.
93 chill-cross: $(srcdir)/ch/chill.in
96 cc1chill: $(P) $(CHILL_SRCS) $(LIBDEPS) stamp-objlist \
97 insn-config.h insn-flags.h insn-attr.h insn-codes.h \
98 c-typeck.o c-aux-info.o c-common.o c-iterate.o
99 cd ch; $(MAKE) $(FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) ../cc1chill
101 chill-runtime: stmp-headers $(GCC_PASSES)
102 case "$(LANGUAGES)" in \
103 *CHILL*) if [ -f ch/runtime/Makefile -a -z "$(CROSS)" ] ; then \
105 cd ch/runtime; $(MAKE) $(FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" all ; \
111 CHILL.all.build: chill
112 CHILL.all.cross: chill-cross
113 CHILL.start.encap: chill
116 CHILL.info: $(srcdir)/ch/chill.texi
117 $(MAKEINFO) -I$(srcdir)/ch $(srcdir)/ch/chill.texi -o chill.info
119 chill.dvi: $(srcdir)/ch/chill.texi $(srcdir)/extend.texi $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi $(srcdir)/tm.texi
121 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi ; \
122 texindex chill.?? ; \
123 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi
124 # FIXME: Not sure languages should do this.
125 cp ch/chill.dvi chill.dvi
128 # cc1chill is installed elsewhere as part of $(COMPILERS).
130 CHILL.install-normal: install-libchill
132 # Install the CHILL run time library.
133 install-libchill: chill-runtime
134 if [ -f ch/runtime/libchill.a ] ; then \
135 $(INSTALL_DATA) ch/runtime/libchill.a $(libsubdir)/libchill.a; \
136 if $(RANLIB_TEST) ; then \
137 (cd $(libsubdir); $(RANLIB) libchill.a); else true; fi; \
138 chmod a-x $(libsubdir)/libchill.a; \
139 $(INSTALL_DATA) ch/runtime/chillrt0.o $(libsubdir)/chillrt0.o; \
142 # Install the driver program
143 CHILL.install-common:
144 -if [ -f cc1chill ] ; then \
145 if [ -f chill.install ] ; then \
146 if [ -f gcc-cross$(exeext) ]; then \
147 rm -f $(bindir)/$(CHILL_CROSS_NAME); \
148 $(INSTALL_PROGRAM) chill.install $(bindir)/$(CHILL_CROSS_NAME); \
149 chmod a+x $(bindir)/$(CHILL_CROSS_NAME); \
151 rm -f $(bindir)/$(CHILL_INSTALL_NAME); \
152 $(INSTALL_PROGRAM) chill.install $(bindir)/$(CHILL_INSTALL_NAME); \
153 chmod a+x $(bindir)/$(CHILL_INSTALL_NAME); \
159 -for i in chill.info*; do \
160 rm -f $(infodir)/$$i; \
161 $(INSTALL_DATA) $$i $(infodir)/$$i; \
167 -rm -rf $(bindir)/$(CHILL_INSTALL_NAME)
168 -rm -rf $(bindir)/$(CHILL_CROSS_NAME)
171 # A lot of the ancillary files are deleted by the main makefile.
172 # We just have to delete files specific to us.
175 -rm -f chill.install ch/*.o ch/ch-version.c
176 -cd ch/runtime && $(MAKE) mostlyclean
179 -rm -f ch/config.status ch/Makefile
181 CHILL.maintainer-clean:
183 -rm -f ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux
184 # CYGNUS LOCAL: Delete locally created file.
188 # The main makefile has already created stage?/ch.
201 # This target creates the files that can be rebuilt, but go in the
202 # distribution anyway. It then copies the files to the distdir directory.
205 cd ch ; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) hash.h
207 for file in *[0-9a-zA-Z+]; do \
208 ln $$file ../tmp/ch >/dev/null 2>&1 || cp $$file ../tmp/ch; \