OSDN Git Service

2ea3b656c3868a2643ea3e455a016a347e9d745d
[pf3gnuchains/gcc-fork.git] / gcc / treelang / Make-lang.in
1 # Top level makefile fragment for TREELANG For GCC. -*- makefile -*-
2
3 #   Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 #   Free Software Foundation, Inc.
5
6 #This file is part of GCC.
7
8 #GCC is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
12
13 #GCC is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with GCC; see the file COPYING.  If not, write to
20 #the Free Software Foundation, 59 Temple Place - Suite 330,
21 #Boston, MA 02111-1307, USA.
22
23 # This file provides the language dependent support in the main Makefile.
24 # Each language makefile fragment must provide the following targets:
25 #
26 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
27 # foo.install-normal, foo.install-common, foo.install-man,
28 # foo.uninstall, foo.distdir,
29 # foo.mostlyclean, foo.clean, foo.distclean,
30 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
31 #
32 # where `foo' is the name of the language.
33 #
34 # It should also provide rules for:
35 #
36 # - making any compiler driver (eg: GCC)
37 # - the compiler proper (eg: treelang)
38 # - define the names for selecting the language in LANGUAGES.
39 #\f
40
41 ## note program-prefix and program-suffix options are not supported
42 ## just program_transform_name which is a sed script to transform the
43 ## names
44
45 TREELANGSED = sed
46 TREELANGSEDFLAGS = -n
47
48 GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
49
50 # ./xgcc is the just built compiler. See GCC_FOR_TARGET in the GCC Makefile.in.
51 # If this can't be found, you probably have not done a bootstrap of GCC,
52 # which you need to do.
53
54 # GCC_FOR_TREELANG = ./xgcc $(GCC_EXTRAS)
55
56 TREE_GENERATED = lex.c parse.c parse.h parse.output
57 TREE_EXES = tree1
58
59 #no -Wtraditional warnings, allow long long
60 treelang-warn = $(LOOSE_WARN) -pedantic -Wno-long-long -Wmissing-prototypes \
61   -Wmissing-declarations -Wno-variadic-macros $(WERROR)
62 # bison emits some unused static arrays (yytoknum)
63 treelang/parse.o-warn = -Wno-error
64 # flex produces 'no previous prototype' warnings
65 treelang/lex.o-warn = -Wno-error
66
67 #\f
68 # Define the names for selecting treelang in LANGUAGES.
69
70 .phony: treelang TREELANG
71
72 treelang TREELANG:treelang.done
73
74 treelang.done: tree1$(exeext)
75         $(STAMP) treelang.done
76
77 # no preprocessor
78
79 # core compiler
80 tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
81         treelang/lex.o treelang/parse.o \
82         $(BACKEND) $(LIBSDEPS) attribs.o
83         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
84         treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
85         treelang/lex.o treelang/parse.o \
86         $(BACKEND) $(LIBS) attribs.o
87
88 #\f
89 # Compiling object files from source files.
90
91 # object file makes
92
93 treelang/tree1.o: treelang/tree1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
94   flags.h toplev.h $(GGC_H) $(TREE_H) diagnostic.h treelang/treelang.h \
95   input.h treelang/treetree.h options.h opts.h \
96   treelang/treetree.h gt-treelang-tree1.h gtype-treelang.h
97
98 treelang/treetree.o: treelang/treetree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
99   $(TM_H) $(TREE_H) flags.h output.h $(RTL_H) $(GGC_H) toplev.h \
100   varray.h $(LANGHOOKS_DEF_H) langhooks.h treelang/treelang.h input.h \
101   treelang/treetree.h treelang/parse.h
102
103 treelang/tree-convert.o: treelang/tree-convert.c $(CONFIG_H) $(SYSTEM_H) \
104   coretypes.h diagnostic.h $(TREE_H) flags.h toplev.h langhooks.h $(TM_H)
105
106 treelang/parse.o: treelang/parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
107   $(TM_H) diagnostic.h treelang/treelang.h input.h treelang/treetree.h
108
109 treelang/lex.o: treelang/lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
110   $(TM_H) diagnostic.h $(TREE_H) treelang/treelang.h input.h \
111   treelang/parse.h
112
113 # generated files the files from lex and yacc are put into the source
114 # directory in case someone wants to build but does not have
115 # lex/yacc
116
117 treelang.srcextra: treelang/parse.c treelang/parse.h treelang/lex.c
118         -cp -p $^ $(srcdir)/treelang
119
120 treelang/lex.c: treelang/lex.l
121         -$(FLEX) $(FLEXFLAGS) -o$@ $<
122
123 treelang/parse.c treelang/parse.h treelang/parse.output: treelang/parse.y
124         -$(BISON) $(BISONFLAGS) -v --defines --output=treelang/parse.c $<
125
126 # -v
127
128 gt-treelang-tree1.h gtype-treelang.h : s-gtype; @true
129
130 #\f
131 # Build hooks:
132
133 treelang.all.build: treelang
134 treelang.all.cross:
135         _error_not_here_yet - havent even thought about it - it may even work
136
137 treelang.start.encap:
138 treelang.rest.encap:
139 treelang.man:
140 treelang.srcman:
141
142 treelang.tags: force
143         cd $(srcdir)/treelang; etags -o TAGS.sub *.y *.l *.c *.h; \
144         etags --include TAGS.sub --include ../TAGS.sub
145
146 treelang.info: doc/treelang.info
147
148 treelang.srcinfo: doc/treelang.info
149         -cp -p $^ $(srcdir)/doc
150
151 dvi:: doc/treelang.dvi
152
153 doc/treelang.info: treelang/treelang.texi $(docdir)/include/gcc-common.texi \
154          $(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
155          $(docdir)/include/funding.texi
156         $(MAKEINFO) $(MAKEINFOFLAGS) -I$(docdir)/include -o $@ $<
157
158 doc/treelang.dvi: treelang/treelang.texi $(docdir)/include/gcc-common.texi \
159          $(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
160          $(docdir)/include/funding.texi
161         $(TEXI2DVI) -I $(abs_docdir)/include -o $@ $<
162
163 #\f
164 # Install hooks:
165
166 # Nothing to do here.
167 treelang.install-normal: treelang.install.common
168
169 # Install
170 .phony:treelang.install.common
171 .phony:treelang.install
172
173 treelang.install treelang.install.common treelang.install-common: treelang.install.common.done
174
175 treelang.install.common.done:  installdirs treelang.done
176         for name in $(TREE_EXES); \
177         do \
178            if [ -f $$name ] ; then \
179             name2="`echo \`basename $$name\` | sed -e '$(program_transform_name)' `"; \
180             rm -f $(DESTDIR)$(bindir)/$$name2$(exeext); \
181             echo $(INSTALL_PROGRAM) $$name$(exeext) $(DESTDIR)$(bindir)/$$name2$(exeext); \
182             $(INSTALL_PROGRAM) $$name$(exeext) $(DESTDIR)$(bindir)/$$name2$(exeext); \
183             chmod a+x $(DESTDIR)$(bindir)/$$name2$(exeext); \
184           fi ; \
185         done
186         $(STAMP) treelang.install.common.done
187
188 # We might not be able to build the info files
189 install-info:: $(DESTDIR)$(infodir)/treelang.info
190
191 treelang.install-man:
192
193 treelang.uninstall:
194         for name in $(TREE_EXES); \
195         do \
196           echo $$name; \
197           name2="`echo $$name | sed -e '$(program_transform_name)' `"; \
198           echo becomes $$name2; \
199           echo -rm -rf $(DESTDIR)$(bindir)/$$name2$(exeext); \
200           rm -rf $(DESTDIR)$(bindir)/$$name2$(exeext); \
201         done
202         -rm treelang.install.common.done
203
204 #\f
205 # Clean hooks:
206 # A lot of the ancillary files are deleted by the main makefile.
207 # We just have to delete files specific to us.
208
209 treelang.mostlyclean:
210         for name in $(TREE_EXES); \
211         do \
212           echo deleting $$name; \
213           if [ -f treelang/$$name$(exeext) ] ; then \
214             rm -f treelang/$$name$(exeext); \
215           fi ; \
216         done
217         -rm -f treelang/*$(objext)
218         -rm -f treelang/*$(coverageexts)
219         -rm treelang.done
220
221
222 treelang.clean: treelang.mostlyclean
223
224 treelang.distclean: treelang.clean
225         -rm -f treelang/config.status
226         -rm -f treelang/*.output
227
228 treelang.maintainer-clean: treelang.distclean
229         for name in $(TREE_GENERATED); \
230         do \
231           if [ -f $(srcdir)/treelang/$$name ] ; then \
232              echo deleting $(srcdir)/treelang/$$name; \
233              rm -f $(srcdir)/treelang/$$name; \
234           fi ; \
235         done
236         -rm -R $(srcdir)/treelang/*~
237
238
239 #\f
240 # Stage hooks:
241 # The main makefile has already created stage?/treelang.
242
243 treelang.stage1: stage1-start
244         -mv treelang/*$(objext) stage1/treelang
245 treelang.stage2: stage2-start
246         -mv treelang/*$(objext) stage2/treelang
247 treelang.stage3: stage3-start
248         -mv treelang/*$(objext) stage3/treelang
249 treelang.stage4: stage4-start
250         -mv treelang/*$(objext) stage4/treelang
251 treelang.stageprofile: stageprofile-start
252         -mv treelang/*$(objext) stageprofile/treelang
253 treelang.stagefeedback: stagefeedback-start
254         -mv treelang/*$(objext) stagefeedback/treelang
255 #\f
256 # Maintenance hooks:
257
258 # This target creates the files that can be rebuilt, but go in the
259 # distribution anyway.  It then copies the files to the distdir directory.
260 treelang.distdir:
261 #       not here yet sorry not sure if this is needed or not???
262
263 # test hook
264
265 check-treelang: treelang.check
266
267 TESTSUITEDIR = testsuite
268
269 treelang.check: $(TESTSUITEDIR)/site.exp
270         -mkdir testsuite/treelang
271
272 # these three files are empty and it seems diff has trouble generating
273 # patch files for new empty files as required for cvs.
274 # STAMP does not cut it here as I need an empty file.
275         touch $(srcdir)/testsuite/treelang/{a01gcco01runpgmerr,a01gcc.out01,a01gcc.out01err}
276         -rootme=`${PWD_COMMAND}`; export rootme; \
277         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
278         cd testsuite; \
279         EXPECT=${EXPECT} ; export EXPECT ; \
280         TRANSFORM=$(program_transform_name); export TRANSFORM; \
281         if [ -f $${rootme}/../expect/expect ] ; then  \
282            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
283            export TCL_LIBRARY ; fi ; \
284         PATH=`cd ..;${PWD_COMMAND}`:$$PATH; export PATH; \
285         gcc_extras="-B`cd ..;${PWD_COMMAND}` -B`cd ..;${PWD_COMMAND}`/treelang"; export gcc_extras; \
286         $(RUNTEST) --tool treelang $(RUNTESTFLAGS)
287         rm $(srcdir)/testsuite/treelang/{a01gcco01runpgmerr,a01gcc.out01,a01gcc.out01err}
288 #       GCC_EXTRAS="$(GCC_EXTRAS)"; export GCC_EXTRAS; \
289
290 # copy the output files from the current test to source ie say the new results are OK
291 treelang.check.fix: force
292         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ;
293         -cp testsuite/treelang/*.out* t
294         -cp testsuite/treelang/*runpgm* t
295         -rm -f t/*nofilename
296
297 #\f
298
299 .PHONY: treelang.html
300
301 treelang.html:
302         cd $(srcdir)/treelang && texi2html -I ../doc/include -verbose -menu -split_chapter -number treelang.texi
303 #       mv treelang*.html $(srcdir)/treelang
304
305 config.status: treelang/config-lang.in