SMP bootstrap fixes for chill:
[platform/upstream/gcc.git] / gcc / ch / Make-lang.in
1 # Top level Makefile fragment for GNU CHILL.
2 #   Copyright (C) 1994, 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, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.  */
20
21 # This file provides the language dependent support in the main Makefile.
22 # Each language makefile fragment must provide the following targets:
23 #
24 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
25 # foo.info, foo.dvi,
26 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
27 # foo.uninstall, foo.distdir,
28 # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
29 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
30 #
31 # where `foo' is the name of the language.
32 #
33 # It should also provide rules for:
34 #
35 # - making any compiler driver (eg: g++)
36 # - the compiler proper (eg: cc1plus)
37 # - define the names for selecting the language in LANGUAGES.
38 #\f
39 # define version of GNUCHILL compiler. Note: maybe we have to change the
40 # mechanism
41 GNUCHILL_VERSION = 1.5.2
42
43 # Actual names to use when installing a native compiler.
44 # (Cygnus configure overrides these when using -program-transform-name).
45 CHILL_INSTALL_NAME = chill
46
47 # Actual names to use when installing a cross-compiler.
48 # (Cygnus configure overrides these when using -program-transform-name).
49 CHILL_CROSS_NAME = $(target_alias)-chill
50
51 CHILL_SRCS = $(srcdir)/ch/actions.c $(srcdir)/ch/convert.c \
52  $(srcdir)/ch/decl.c $(srcdir)/ch/except.c $(srcdir)/ch/expr.c \
53  $(srcdir)/ch/grant.c $(srcdir)/ch/inout.c $(srcdir)/ch/lang.c \
54  $(srcdir)/ch/lex.c $(srcdir)/ch/loop.c \
55  $(srcdir)/ch/parse.c $(srcdir)/ch/satisfy.c \
56  $(srcdir)/ch/tasking.c $(srcdir)/ch/timing.c $(srcdir)/ch/tree.c \
57  $(srcdir)/ch/typeck.c
58
59 # Extra flags to pass to recursive makes.
60 CHILL_FLAGS_TO_PASS = \
61         "CHILLFLAGS=$(CHILLFLAGS)" \
62         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
63         "CHILL_LIB=$(CHILL_LIB)" \
64         "GNUCHILL_VERSION=$(GNUCHILL_VERSION)"
65 #\f
66 # Define the names for selecting languages in LANGUAGES.
67 CHILL: chill cc1chill$(exeext)
68
69 # handle startfile in chill script and build script to install
70 chill: $(srcdir)/ch/chill.in Makefile
71         thisdir=`pwd` ; \
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$(exeext) -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 ; \
77         chmod a+x chill ; \
78         if [ -f ../gcc-cross$(exeext) ]; then \
79           whatgcc=$(GCC_CROSS_NAME) ; \
80         else \
81           whatgcc=$(GCC_INSTALL_NAME) ; \
82         fi; \
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
89
90 # Don't depend on cc1chill$(exeext), because chill-cross is always built for cross,
91 # and thus a cc1chill$(exeext) dependence would force cc1chill$(exeext) 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
94         touch $@
95
96 cc1chill$(exeext): $(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$(exeext)
100
101 #\f
102 # Build hooks:
103
104 CHILL.all.build: chill
105 CHILL.all.cross: chill-cross
106 CHILL.start.encap: chill
107 CHILL.rest.encap:
108 CHILL.dvi: chill.dvi
109
110 CHILL.info: ch/chill.info
111
112 ch/chill.info: $(srcdir)/ch/chill.texi
113         $(MAKEINFO) -I$(srcdir)/ch -o ch/chill.info $(srcdir)/ch/chill.texi
114
115 chill.dvi: $(srcdir)/ch/chill.texi $(srcdir)/extend.texi $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi $(srcdir)/tm.texi
116         cd ch ; \
117         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi ; \
118         texindex chill.?? ; \
119         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi
120 # FIXME: Not sure languages should do this.
121         cp ch/chill.dvi chill.dvi
122 #\f
123 # Install hooks:
124 # cc1chill is installed elsewhere as part of $(COMPILERS).
125
126 CHILL.install-normal:
127
128 # Install the driver program
129 CHILL.install-common:
130         -if [ -f cc1chill$(exeext) ] ; then \
131           if [ -f chill.install ] ; then \
132             if [ -f gcc-cross$(exeext) ]; then \
133               rm -f $(bindir)/$(CHILL_CROSS_NAME); \
134               $(INSTALL_PROGRAM) chill.install $(bindir)/$(CHILL_CROSS_NAME); \
135               chmod a+x $(bindir)/$(CHILL_CROSS_NAME); \
136             else \
137               rm -f $(bindir)/$(CHILL_INSTALL_NAME); \
138               $(INSTALL_PROGRAM) chill.install $(bindir)/$(CHILL_INSTALL_NAME); \
139               chmod a+x $(bindir)/$(CHILL_INSTALL_NAME); \
140             fi ; \
141           fi ; \
142         fi
143
144 # Don't delete $(infodir)/ch.info* unless there's actually new
145 # docs to install (in case LANGUAGES didn't contain chill earlier).
146 CHILL.install-info:
147         -for i in ch/chill.info*; do \
148           rm -f $(infodir)/chill.info*; \
149           realfile=`echo $$i | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
150           $(INSTALL_DATA) $$i $(infodir)/$$realfile; \
151         done
152
153 CHILL.install-man:
154
155 CHILL.uninstall:
156         -rm -rf $(bindir)/$(CHILL_INSTALL_NAME)
157         -rm -rf $(bindir)/$(CHILL_CROSS_NAME)
158 #\f
159 # Clean hooks:
160 # A lot of the ancillary files are deleted by the main makefile.
161 # We just have to delete files specific to us.
162
163 CHILL.mostlyclean:
164         -rm -f chill.install ch/*.o ch/ch-version.c
165 CHILL.clean:
166 CHILL.distclean:
167         -rm -f ch/config.status ch/Makefile
168 CHILL.extraclean:
169 CHILL.maintainer-clean:
170         -rm -f ch/TAGS
171         -rm -f ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux
172 # CYGNUS LOCAL: Delete locally created file.
173         -rm -f ch/hash.h
174 #\f
175 # Stage hooks:
176 # The main makefile has already created stage?/ch.
177
178 CHILL.stage1: stage1-start
179         -mv ch/*.o stage1/ch
180 CHILL.stage2: stage2-start
181         -mv ch/*.o stage2/ch
182 CHILL.stage3: stage3-start
183         -mv ch/*.o stage3/ch
184 CHILL.stage4: stage4-start
185         -mv ch/*.o stage4/ch
186 #\f
187 # Maintenance hooks:
188
189 # This target creates the files that can be rebuilt, but go in the
190 # distribution anyway.  It then copies the files to the distdir directory.
191 CHILL.distdir:
192         mkdir tmp/ch
193         cd ch ; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) hash.h
194         cd ch; \
195         for file in *[0-9a-zA-Z+]; do \
196           ln $$file ../tmp/ch >/dev/null 2>&1 || cp $$file ../tmp/ch; \
197         done