ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
[gcc.git] / gcc / jit / Make-lang.in
1 # Top level -*- makefile -*- fragment for libgccjit.so.
2 # Copyright (C) 2013-2014 Free Software Foundation, Inc.
3
4 #This file is part of GCC.
5
6 #GCC 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 3, or (at your option)
9 #any later version.
10
11 #GCC 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 GCC; see the file COPYING3. If not see
18 # <http://www.gnu.org/licenses/>.
19
20 # This file provides the language dependent support in the main Makefile.
21 # Each language makefile fragment must provide the following targets:
22 #
23 # foo.all.cross, foo.start.encap, foo.rest.encap,
24 # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
25 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
26 # foo.mostlyclean, foo.clean, foo.distclean,
27 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
28 #
29 # where `foo' is the name of the language.
30 #
31 # It should also provide rules for:
32 #
33 # - making any compiler driver (eg: g++)
34 # - the compiler proper (eg: cc1plus)
35 # - define the names for selecting the language in LANGUAGES.
36
37 #\f
38 # Define the names for selecting jit in LANGUAGES.
39 # Note that it would be nice to move the dependency on g++
40 # into the jit rule, but that needs a little bit of work
41 # to do the right thing within all.cross.
42
43 LIBGCCJIT_LINKER_NAME = libgccjit.so
44 LIBGCCJIT_VERSION_NUM = 0
45 LIBGCCJIT_MINOR_NUM = 0
46 LIBGCCJIT_RELEASE_NUM = 1
47 LIBGCCJIT_SONAME = $(LIBGCCJIT_LINKER_NAME).$(LIBGCCJIT_VERSION_NUM)
48 LIBGCCJIT_FILENAME = \
49 $(LIBGCCJIT_SONAME).$(LIBGCCJIT_MINOR_NUM).$(LIBGCCJIT_RELEASE_NUM)
50
51 LIBGCCJIT_LINKER_NAME_SYMLINK = $(LIBGCCJIT_LINKER_NAME)
52 LIBGCCJIT_SONAME_SYMLINK = $(LIBGCCJIT_SONAME)
53
54 jit: $(LIBGCCJIT_FILENAME) \
55 $(LIBGCCJIT_SYMLINK) \
56 $(LIBGCCJIT_LINKER_NAME_SYMLINK) \
57 $(FULL_DRIVER_NAME)
58
59 # Tell GNU make to ignore these if they exist.
60 .PHONY: jit
61
62 jit_OBJS = attribs.o \
63 jit/dummy-frontend.o \
64 jit/libgccjit.o \
65 jit/jit-recording.o \
66 jit/jit-playback.o \
67 jit/jit-builtins.o
68
69 # Use strict warnings for this front end.
70 jit-warn = $(STRICT_WARN)
71
72 # We avoid using $(BACKEND) from Makefile.in in order to avoid pulling
73 # in main.o
74 $(LIBGCCJIT_FILENAME): $(jit_OBJS) \
75 libbackend.a libcommon-target.a libcommon.a \
76 $(CPPLIB) $(LIBDECNUMBER) \
77 $(LIBDEPS) $(srcdir)/jit/libgccjit.map
78 +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ -shared \
79 $(jit_OBJS) libbackend.a libcommon-target.a libcommon.a \
80 $(CPPLIB) $(LIBDECNUMBER) $(LIBS) $(BACKENDLIBS) \
81 -Wl,--version-script=$(srcdir)/jit/libgccjit.map \
82 -Wl,-soname,$(LIBGCCJIT_SONAME)
83
84 $(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME)
85 ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK)
86
87 $(LIBGCCJIT_LINKER_NAME_SYMLINK): $(LIBGCCJIT_SONAME_SYMLINK)
88 ln -sf $(LIBGCCJIT_SONAME_SYMLINK) $(LIBGCCJIT_LINKER_NAME_SYMLINK)
89
90 #\f
91 # Build hooks:
92
93 jit.all.cross:
94 jit.start.encap:
95 jit.rest.encap:
96
97 # Documentation build hooks.
98 #
99 # The documentation can be built using the texinfo toolchain, or
100 # the sphinx toolchain
101 #
102 # The jit documentation is authored using Sphinx, which has numerous
103 # advantages over Texinfo, including:
104 #
105 # * much faster
106 #
107 # * use of CSS and JS to provide less of a 1990s feel in the generated
108 # HTML.
109 #
110 # * sane, stable HTML page and anchor names
111 #
112 # * sane HTML navigation: ability to move forward and back in the HTML
113 # at every node to read the HTML like a book
114 #
115 # * syntax-coloring of examples
116 #
117 # * the ability to "include" fragments of code inline. This is used
118 # heavily by the jit docs, so that the example code is shared by both
119 # the test suite and the documentation to ensure that the examples
120 # appearing in the docs actually compile and work
121 #
122 # Sphinx is not a "blessed" dependency, and so a prebuilt libgccjit.texinfo
123 # file built by Sphinx is checked into the source tree to avoid requiring
124 # everyone to have Sphinx installed.
125 #
126 # This prebuilt libgccjit.texinfo has the "include" fragments "baked in",
127 # and so contains the content from the sphinx toolchain, but lacks the
128 # syntax-coloring, and the generated HTML is (IMHO) greatly inferior to
129 # that generated by Sphinx.
130
131 # These targets redirect HTML creation and installation to either
132 # jit.sphinx.(install-)html or jit.texinfo.(install-)html.
133 jit.html: jit.$(doc_build_sys).html
134 jit.install-html: jit.$(doc_build_sys).install-html
135
136 # For now, use texinfo for pdf, since the sphinx latex toolchain currently
137 # fails for me deep inside pdflatex (see notes below)
138 jit.pdf: jit.texinfo.pdf
139 jit.install-pdf: jit.texinfo.install-pdf
140
141 # Hooks for building docs using texinfo
142 JIT_TEXI_FILES = $(srcdir)/jit/docs/_build/texinfo/libgccjit.texi
143
144 jit.info: doc/libgccjit.info
145 doc/libgccjit.info: $(JIT_TEXI_FILES)
146 if test "x$(BUILD_INFO)" = xinfo; then \
147 rm -f doc/libgccjit.info*; \
148 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
149 -I $(gcc_docdir)/include -o $@ $<; \
150 else true; fi
151
152 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
153
154 jit.dvi: doc/libgccjit.dvi
155 doc/libgccjit.dvi: $(JIT_TEXI_FILES)
156 $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
157
158 jit.texinfo.html: $(build_htmldir)/jit/index.html
159
160 $(build_htmldir)/jit/index.html: $(srcdir)/jit/docs/_build/texinfo/libgccjit.texi
161 $(mkinstalldirs) $(@D)
162 rm -f $(@D)/*
163 $(TEXI2HTML) -I $(gcc_docdir)/include -I $(srcdir)/jit -o $(@D) $<
164
165 jit.texinfo.install-html: jit.texinfo.html
166 @$(NORMAL_INSTALL)
167 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
168 @for p in $(build_htmldir)/jit; do \
169 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
170 f=$(html__strip_dir) \
171 if test -d "$$d$$p"; then \
172 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
173 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
174 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
175 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
176 else \
177 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
178 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
179 fi; \
180 done
181
182 jit.texinfo.pdf: doc/libgccjit.pdf
183
184 doc/libgccjit.pdf: $(JIT_TEXI_FILES)
185 $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
186
187 jit.texinfo.install-pdf: doc/libgccjit.pdf
188 @$(NORMAL_INSTALL)
189 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
190 @for p in doc/libgccjit.pdf; do \
191 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
192 f=$(pdf__strip_dir) \
193 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
194 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
195 done
196
197 # Hooks for building docs using the Sphinx toolchain:
198
199 SPHINX_BUILD_DIR=jit/sphinx-build
200
201 jit.sphinx.html:
202 mkdir -p $(SPHINX_BUILD_DIR)
203 (cd $(srcdir)/jit/docs && \
204 make html BUILDDIR=$(PWD)/$(SPHINX_BUILD_DIR) )
205
206 jit_htmldir=$(htmldir)/jit
207
208 jit.sphinx.install-html: jit.sphinx.html
209 @$(NORMAL_INSTALL)
210 test -z "$(jit_htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(jit_htmldir)"
211 @for f in $(shell cd $(SPHINX_BUILD_DIR)/html && find) ; do \
212 if test -f $(SPHINX_BUILD_DIR)/html/"$$f"; then \
213 $(INSTALL_DATA) $(SPHINX_BUILD_DIR)/html/"$$f" $(DESTDIR)$(jit_htmldir)/"$$f"; \
214 else \
215 mkdir $(DESTDIR)$(jit_htmldir)/"$$f"; \
216 fi; \
217 done
218
219 # (This one is currently failing deep inside pdflatex for me;
220 # see https://bugzilla.redhat.com/show_bug.cgi?id=1148845 )
221 jit.sphinx.pdf: $(SPHINX_BUILD_DIR)/latex/libgccjit.pdf
222 $(SPHINX_BUILD_DIR)/latex/libgccjit.pdf:
223 mkdir -p $(SPHINX_BUILD_DIR)
224 (cd $(srcdir)/jit/docs && \
225 make latexpdf BUILDDIR=$(PWD)/$(SPHINX_BUILD_DIR) )
226
227 jit.sphinx.install-pdf: $(SPHINX_BUILD_DIR)/latex/libgccjit.pdf
228 @$(NORMAL_INSTALL)
229 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
230 @for p in $(SPHINX_BUILD_DIR)/latex/libgccjit.pdf; do \
231 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
232 f=$(pdf__strip_dir) \
233 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
234 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
235 done
236
237 jit.srcinfo:
238 jit.srcextra:
239
240 jit.tags:
241
242 jit.man:
243
244 jit.srcman:
245
246 lang_checks += check-jit
247
248 #\f
249 # Install hooks:
250 jit.install-common: installdirs
251 $(INSTALL_PROGRAM) $(LIBGCCJIT_FILENAME) \
252 $(DESTDIR)/$(libdir)/$(LIBGCCJIT_FILENAME)
253 ln -sf \
254 $(LIBGCCJIT_FILENAME) \
255 $(DESTDIR)/$(libdir)/$(LIBGCCJIT_SONAME_SYMLINK)
256 ln -sf \
257 $(LIBGCCJIT_SONAME_SYMLINK)\
258 $(DESTDIR)/$(libdir)/$(LIBGCCJIT_LINKER_NAME_SYMLINK)
259 $(INSTALL_PROGRAM) $(srcdir)/jit/libgccjit.h \
260 $(DESTDIR)/$(includedir)/libgccjit.h
261 $(INSTALL_PROGRAM) $(srcdir)/jit/libgccjit++.h \
262 $(DESTDIR)/$(includedir)/libgccjit++.h
263
264 jit.install-man:
265
266 jit.install-plugin:
267
268 jit.uninstall:
269
270 #\f
271 # Clean hooks:
272 # A lot of the ancillary files are deleted by the main makefile.
273 # We just have to delete files specific to us.
274
275 jit.mostlyclean:
276
277 jit.clean:
278
279 jit.distclean:
280
281 jit.maintainer-clean:
282
283 #\f
284 # Stage hooks:
285 # The main makefile has already created stage?/jit.
286
287 jit.stage1: stage1-start
288 -mv jit/*$(objext) stage1/jit
289 jit.stage2: stage2-start
290 -mv jit/*$(objext) stage2/jit
291 jit.stage3: stage3-start
292 -mv jit/*$(objext) stage3/jit
293 jit.stage4: stage4-start
294 -mv jit/*$(objext) stage4/jit
295 jit.stageprofile: stageprofile-start
296 -mv jit/*$(objext) stageprofile/jit
297 jit.stagefeedback: stagefeedback-start
298 -mv jit/*$(objext) stagefeedback/jit