aboutsummaryrefslogtreecommitdiff
path: root/gcc/ch/Make-lang.in
blob: 7554b8e77a585d348ad20f5b02cc8a2dae6c9f07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Top level Makefile fragment for GNU CHILL.
#   Copyright (C) 1994, 1998, 2000 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.

#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.  */

# This file provides the language dependent support in the main Makefile.
# Each language makefile fragment must provide the following targets:
#
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.info, foo.dvi,
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
# foo.uninstall, foo.distdir,
# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
#
# It should also provide rules for:
#
# - making any compiler driver (eg: g++)
# - the compiler proper (eg: cc1plus)
# - define the names for selecting the language in LANGUAGES.
#
# define version of GNUCHILL compiler. Note: maybe we have to change the
# mechanism
GNUCHILL_VERSION = 1.5.2

# Actual names to use when installing a native compiler.
# (Cygnus configure overrides these when using -program-transform-name).
CHILL_INSTALL_NAME = chill

# Actual names to use when installing a cross-compiler.
# (Cygnus configure overrides these when using -program-transform-name).
CHILL_CROSS_NAME = $(target_alias)-chill

CHILL_SRCS = $(srcdir)/ch/actions.c $(srcdir)/ch/convert.c \
 $(srcdir)/ch/decl.c $(srcdir)/ch/except.c $(srcdir)/ch/expr.c \
 $(srcdir)/ch/grant.c $(srcdir)/ch/inout.c $(srcdir)/ch/lang.c \
 $(srcdir)/ch/lex.c $(srcdir)/ch/loop.c \
 $(srcdir)/ch/parse.c $(srcdir)/ch/satisfy.c \
 $(srcdir)/ch/tasking.c $(srcdir)/ch/timing.c $(srcdir)/ch/tree.c \
 $(srcdir)/ch/typeck.c

# Extra flags to pass to recursive makes.
CHILL_FLAGS_TO_PASS = \
	"CHILLFLAGS=$(CHILLFLAGS)" \
	"CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
	"CHILL_LIB=$(CHILL_LIB)" \
	"GNUCHILL_VERSION=$(GNUCHILL_VERSION)"
#
# Define the names for selecting languages in LANGUAGES.
CHILL: chill cc1chill$(exeext)

# handle startfile in chill script and build script to install
chill: $(srcdir)/ch/chill.in Makefile
	thisdir=`pwd` ; \
	sed -e "s:startfile=chillrt0:startfile=$${thisdir}/ch/runtime/chillrt0.o:" \
	    -e "s:libpath=chillrt:libpath=-L$${thisdir}/ch/runtime/:" \
	    -e "s:whatgcc=gcc:whatgcc=\"$${thisdir}/xgcc$(exeext) -B$${thisdir}/\":" \
	    -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
	    -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill ; \
	chmod a+x chill ; \
	if [ -f ../gcc-cross$(exeext) ]; then \
	  whatgcc=$(GCC_CROSS_NAME) ; \
	else \
	  whatgcc=$(GCC_INSTALL_NAME) ; \
	fi; \
	sed -e "s:startfile=chillrt0:startfile=$(libsubdir)/chillrt0.o:" \
	    -e "s:whatgcc=gcc:whatgcc=$(bindir)/$${whatgcc}:" \
	    -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
	    -e "s:libpath=chillrt:libpath=:" \
	    -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill.install ; \
	chmod a+x chill.install

# Don't depend on cc1chill$(exeext), because chill-cross is always built for cross,
# and thus a cc1chill$(exeext) dependence would force cc1chill$(exeext) to always be built.
# Note that gcc-cross and g++-cross do not have cc1 or cc1plus dependencies.
chill-cross: $(srcdir)/ch/chill.in
	touch $@

cc1chill$(exeext): $(P) $(CHILL_SRCS) $(LIBDEPS) $(BACKEND) \
	insn-config.h insn-flags.h insn-attr.h insn-codes.h \
	c-typeck.o c-aux-info.o c-common.o \
        ggc-callbacks.o
	cd ch; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) ../cc1chill$(exeext)

#
# Build hooks:

CHILL.all.build: chill
CHILL.all.cross: chill-cross
CHILL.start.encap: chill
CHILL.rest.encap:
CHILL.dvi: chill.dvi

CHILL.info: ch/chill.info

ch/chill.info: $(srcdir)/ch/chill.texi
	$(MAKEINFO) -I$(srcdir)/ch -o ch/chill.info $(srcdir)/ch/chill.texi

chill.dvi: $(srcdir)/ch/chill.texi $(srcdir)/extend.texi $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi $(srcdir)/tm.texi
	cd ch ; \
	TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi ; \
	texindex chill.?? ; \
	TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi
# FIXME: Not sure languages should do this.
	cp ch/chill.dvi chill.dvi
#
# Install hooks:
# cc1chill is installed elsewhere as part of $(COMPILERS).

CHILL.install-normal:

# Install the driver program
CHILL.install-common:
	-if [ -f cc1chill$(exeext) ] ; then \
	  if [ -f chill.install ] ; then \
	    if [ -f gcc-cross$(exeext) ]; then \
	      rm -f $(bindir)/$(CHILL_CROSS_NAME); \
	      $(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_CROSS_NAME); \
	      chmod a+x $(bindir)/$(CHILL_CROSS_NAME); \
	    else \
	      rm -f $(bindir)/$(CHILL_INSTALL_NAME); \
	      $(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_INSTALL_NAME); \
	      chmod a+x $(bindir)/$(CHILL_INSTALL_NAME); \
	    fi ; \
	  fi ; \
	fi

# Don't delete $(infodir)/ch.info* unless there's actually new
# docs to install (in case LANGUAGES didn't contain chill earlier).
CHILL.install-info:
	-for i in ch/chill.info*; do \
	  rm -f $(infodir)/chill.info*; \
	  realfile=`echo $$i | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
	  $(INSTALL_DATA) $$i $(infodir)/$$realfile; \
	done

CHILL.install-man:

CHILL.uninstall:
	-rm -rf $(bindir)/$(CHILL_INSTALL_NAME)
	-rm -rf $(bindir)/$(CHILL_CROSS_NAME)
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.

CHILL.mostlyclean:
	-rm -f chill.install ch/*.o ch/ch-version.c
CHILL.clean:
CHILL.distclean:
	-rm -f ch/config.status ch/Makefile
CHILL.extraclean:
CHILL.maintainer-clean:
	-rm -f ch/TAGS
	-rm -f ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux
# CYGNUS LOCAL: Delete locally created file.
	-rm -f ch/hash.h
#
# Stage hooks:
# The main makefile has already created stage?/ch.

CHILL.stage1: stage1-start
	-mv ch/*.o stage1/ch
CHILL.stage2: stage2-start
	-mv ch/*.o stage2/ch
CHILL.stage3: stage3-start
	-mv ch/*.o stage3/ch
CHILL.stage4: stage4-start
	-mv ch/*.o stage4/ch
#
# Maintenance hooks:

# This target creates the files that can be rebuilt, but go in the
# distribution anyway.  It then copies the files to the distdir directory.
CHILL.distdir:
	mkdir tmp/ch
	cd ch ; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) hash.h
	cd ch; \
	for file in *[0-9a-zA-Z+]; do \
	  ln $$file ../tmp/ch >/dev/null 2>&1 || cp $$file ../tmp/ch; \
	done