OSDN Git Service

* Makefile.in: Add html support.
[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 #strict warnings for treelang
60 treelang-warn = $(STRICT_WARN)
61 # bison emits some unused static arrays (yytoknum)
62 treelang/parse.o-warn = -Wno-error
63 # flex produces 'no previous prototype' warnings
64 treelang/lex.o-warn = -Wno-error
65
66 #\f
67 # Define the names for selecting treelang in LANGUAGES.
68
69 .phony: treelang TREELANG
70
71 treelang TREELANG:treelang.done
72
73 treelang.done: tree1$(exeext)
74         $(STAMP) treelang.done
75
76 # no preprocessor
77
78 # core compiler
79 tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
80         treelang/lex.o treelang/parse.o \
81         $(BACKEND) $(LIBSDEPS) attribs.o
82         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
83         treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
84         treelang/lex.o treelang/parse.o \
85         $(BACKEND) $(LIBS) attribs.o
86
87 #\f
88 # Compiling object files from source files.
89
90 # object file makes
91
92 treelang/tree1.o: treelang/tree1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
93   flags.h toplev.h $(GGC_H) $(TREE_H) diagnostic.h treelang/treelang.h \
94   input.h treelang/treetree.h options.h opts.h \
95   treelang/treetree.h gt-treelang-tree1.h gtype-treelang.h
96
97 treelang/treetree.o: treelang/treetree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
98   $(TM_H) $(TREE_H) flags.h output.h $(RTL_H) $(GGC_H) toplev.h \
99   varray.h $(LANGHOOKS_DEF_H) langhooks.h treelang/treelang.h input.h \
100   treelang/treetree.h treelang/parse.h
101
102 treelang/tree-convert.o: treelang/tree-convert.c $(CONFIG_H) $(SYSTEM_H) \
103   coretypes.h diagnostic.h $(TREE_H) flags.h toplev.h langhooks.h $(TM_H)
104
105 treelang/parse.o: treelang/parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
106   $(TM_H) diagnostic.h treelang/treelang.h input.h treelang/treetree.h
107
108 treelang/lex.o: treelang/lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
109   $(TM_H) diagnostic.h $(TREE_H) treelang/treelang.h input.h \
110   treelang/parse.h
111
112 # generated files the files from lex and yacc are put into the source
113 # directory in case someone wants to build but does not have
114 # lex/yacc
115
116 treelang.srcextra: treelang/parse.c treelang/parse.h treelang/lex.c
117         -cp -p $^ $(srcdir)/treelang
118
119 treelang/lex.c: treelang/lex.l
120         -$(FLEX) $(FLEXFLAGS) -o$@ $<
121
122 treelang/parse.c treelang/parse.h treelang/parse.output: treelang/parse.y
123         -$(BISON) $(BISONFLAGS) -v --defines --output=treelang/parse.c $<
124
125 # -v
126
127 gt-treelang-tree1.h gtype-treelang.h : s-gtype; @true
128
129 #\f
130 # Build hooks:
131
132 treelang.all.build: treelang
133 treelang.all.cross:
134         _error_not_here_yet - havent even thought about it - it may even work
135
136 treelang.start.encap:
137 treelang.rest.encap:
138 treelang.man:
139 treelang.srcman:
140
141 treelang.tags: force
142         cd $(srcdir)/treelang; etags -o TAGS.sub *.y *.l *.c *.h; \
143         etags --include TAGS.sub --include ../TAGS.sub
144
145 treelang.info: doc/treelang.info
146
147 treelang.srcinfo: doc/treelang.info
148         -cp -p $^ $(srcdir)/doc
149
150 dvi:: doc/treelang.dvi
151
152 TEXI_TREELANG_FILES = treelang/treelang.texi \
153          $(docdir)/include/gcc-common.texi \
154          $(docdir)/include/gpl.texi \
155          $(docdir)/include/fdl.texi \
156          $(docdir)/include/funding.texi
157
158 doc/treelang.info: $(TEXI_TREELANG_FILES)
159         $(MAKEINFO) $(MAKEINFOFLAGS) -I$(docdir)/include -o $@ $<
160
161 doc/treelang.dvi: $(TEXI_TREELANG_FILES)
162         $(TEXI2DVI) -I $(abs_docdir)/include -o $@ $<
163
164 html:: $(htmldir)/treelang/index.html
165
166 $(htmldir)/treelang/index.html: $(TEXI_TREELANG_FILES)
167         $(mkinstalldirs) $(@D)
168         rm -f $(@D)/*
169         $(TEXI2HTML) -I$(docdir)/include -I$(srcdir)/treelang \
170            --verbose --number-sections \
171           -o $(@D) $<
172
173 #\f
174 # Install hooks:
175
176 # Nothing to do here.
177 treelang.install-normal: treelang.install.common
178
179 # Install
180 .phony:treelang.install.common
181 .phony:treelang.install
182
183 treelang.install treelang.install.common treelang.install-common: treelang.install.common.done
184
185 treelang.install.common.done:  installdirs treelang.done
186         for name in $(TREE_EXES); \
187         do \
188            if [ -f $$name ] ; then \
189             name2="`echo \`basename $$name\` | sed -e '$(program_transform_name)' `"; \
190             rm -f $(DESTDIR)$(bindir)/$$name2$(exeext); \
191             echo $(INSTALL_PROGRAM) $$name$(exeext) $(DESTDIR)$(bindir)/$$name2$(exeext); \
192             $(INSTALL_PROGRAM) $$name$(exeext) $(DESTDIR)$(bindir)/$$name2$(exeext); \
193             chmod a+x $(DESTDIR)$(bindir)/$$name2$(exeext); \
194           fi ; \
195         done
196         $(STAMP) treelang.install.common.done
197
198 # We might not be able to build the info files
199 install-info:: $(DESTDIR)$(infodir)/treelang.info
200
201 treelang.install-man:
202
203 treelang.uninstall:
204         for name in $(TREE_EXES); \
205         do \
206           echo $$name; \
207           name2="`echo $$name | sed -e '$(program_transform_name)' `"; \
208           echo becomes $$name2; \
209           echo -rm -rf $(DESTDIR)$(bindir)/$$name2$(exeext); \
210           rm -rf $(DESTDIR)$(bindir)/$$name2$(exeext); \
211         done
212         -rm treelang.install.common.done
213
214 #\f
215 # Clean hooks:
216 # A lot of the ancillary files are deleted by the main makefile.
217 # We just have to delete files specific to us.
218
219 treelang.mostlyclean:
220         for name in $(TREE_EXES); \
221         do \
222           echo deleting $$name; \
223           if [ -f treelang/$$name$(exeext) ] ; then \
224             rm -f treelang/$$name$(exeext); \
225           fi ; \
226         done
227         -rm -f treelang/*$(objext)
228         -rm -f treelang/*$(coverageexts)
229         -rm treelang.done
230
231
232 treelang.clean: treelang.mostlyclean
233
234 treelang.distclean: treelang.clean
235         -rm -f treelang/config.status
236         -rm -f treelang/*.output
237
238 treelang.maintainer-clean: treelang.distclean
239         for name in $(TREE_GENERATED); \
240         do \
241           if [ -f $(srcdir)/treelang/$$name ] ; then \
242              echo deleting $(srcdir)/treelang/$$name; \
243              rm -f $(srcdir)/treelang/$$name; \
244           fi ; \
245         done
246         -rm -R $(srcdir)/treelang/*~
247
248
249 #\f
250 # Stage hooks:
251 # The main makefile has already created stage?/treelang.
252
253 treelang.stage1: stage1-start
254         -mv treelang/*$(objext) stage1/treelang
255 treelang.stage2: stage2-start
256         -mv treelang/*$(objext) stage2/treelang
257 treelang.stage3: stage3-start
258         -mv treelang/*$(objext) stage3/treelang
259 treelang.stage4: stage4-start
260         -mv treelang/*$(objext) stage4/treelang
261 treelang.stageprofile: stageprofile-start
262         -mv treelang/*$(objext) stageprofile/treelang
263 treelang.stagefeedback: stagefeedback-start
264         -mv treelang/*$(objext) stagefeedback/treelang
265 #\f
266 # Maintenance hooks:
267
268 # This target creates the files that can be rebuilt, but go in the
269 # distribution anyway.  It then copies the files to the distdir directory.
270 treelang.distdir:
271 #       not here yet sorry not sure if this is needed or not???
272
273 # test hook
274
275 check-treelang: treelang.check
276
277 TESTSUITEDIR = testsuite
278
279 treelang.check: $(TESTSUITEDIR)/site.exp
280         -mkdir testsuite/treelang
281
282 # these three files are empty and it seems diff has trouble generating
283 # patch files for new empty files as required for cvs.
284 # STAMP does not cut it here as I need an empty file.
285         touch $(srcdir)/testsuite/treelang/{a01gcco01runpgmerr,a01gcc.out01,a01gcc.out01err}
286         -rootme=`${PWD_COMMAND}`; export rootme; \
287         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
288         cd testsuite; \
289         EXPECT=${EXPECT} ; export EXPECT ; \
290         TRANSFORM=$(program_transform_name); export TRANSFORM; \
291         if [ -f $${rootme}/../expect/expect ] ; then  \
292            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
293            export TCL_LIBRARY ; fi ; \
294         PATH=`cd ..;${PWD_COMMAND}`:$$PATH; export PATH; \
295         gcc_extras="-B`cd ..;${PWD_COMMAND}` -B`cd ..;${PWD_COMMAND}`/treelang"; export gcc_extras; \
296         $(RUNTEST) --tool treelang $(RUNTESTFLAGS)
297         rm $(srcdir)/testsuite/treelang/{a01gcco01runpgmerr,a01gcc.out01,a01gcc.out01err}
298 #       GCC_EXTRAS="$(GCC_EXTRAS)"; export GCC_EXTRAS; \
299
300 # copy the output files from the current test to source ie say the new results are OK
301 treelang.check.fix: force
302         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ;
303         -cp testsuite/treelang/*.out* t
304         -cp testsuite/treelang/*runpgm* t
305         -rm -f t/*nofilename
306
307 #\f
308
309 config.status: treelang/config-lang.in