]>
Commit | Line | Data |
---|---|---|
d7f09764 | 1 | # Top level -*- makefile -*- fragment for LTO |
a5544970 | 2 | # Copyright (C) 2009-2019 Free Software Foundation, Inc. |
d7f09764 DN |
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 | # Variables | |
21 | ||
22 | # The name of the LTO compiler. | |
23 | LTO_EXE = lto1$(exeext) | |
66d62d9f | 24 | LTO_DUMP_EXE = lto-dump$(exeext) |
d7f09764 | 25 | # The LTO-specific object files inclued in $(LTO_EXE). |
a79420f9 | 26 | LTO_OBJS = lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-common.o |
7c6fedd2 | 27 | lto_OBJS = $(LTO_OBJS) |
66d62d9f HK |
28 | LTO_DUMP_OBJS = lto/lto-lang.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-dump.o lto/lto-common.o |
29 | lto_dump_OBJS = $(LTO_DUMP_OBJS) | |
d7f09764 | 30 | |
277d7ee0 AK |
31 | # this is only useful in a LTO bootstrap, but this does not work right |
32 | # now. Should reenable after this is fixed, but only when LTO bootstrap | |
33 | # is enabled. | |
34 | ||
e9ac1f86 JJ |
35 | #ifeq ($(if $(wildcard ../stage_current),$(shell cat \ |
36 | # ../stage_current)),stageautofeedback) | |
277d7ee0 AK |
37 | #$(LTO_OBJS): CFLAGS += -fauto-profile=lto1.fda |
38 | #$(LTO_OBJS): lto1.fda | |
39 | #endif | |
40 | ||
d7f09764 DN |
41 | # Rules |
42 | ||
43 | # These hooks are used by the main GCC Makefile. Consult that | |
44 | # Makefile for documentation. | |
66d62d9f HK |
45 | lto.all.cross: $(LTO_EXE) $(LTO_DUMP_EXE) |
46 | lto.start.encap: $(LTO_EXE) $(LTO_DUMP_EXE) | |
d7f09764 DN |
47 | lto.rest.encap: |
48 | lto.tags: | |
66d62d9f HK |
49 | lto.install-common: installdirs |
50 | $(INSTALL_PROGRAM) $(LTO_DUMP_EXE) \ | |
51 | $(DESTDIR)/$(bindir)/$(LTO_DUMP_EXE) | |
52 | ||
d7f09764 DN |
53 | lto.install-man: |
54 | lto.install-info: | |
55 | lto.dvi: | |
56 | lto.pdf: | |
57 | lto.install-pdf: | |
58 | lto.html: | |
55bcd32b | 59 | lto.install-html: |
d7f09764 DN |
60 | lto.uninstall: |
61 | lto.info: | |
62 | lto.man: | |
63 | lto.srcextra: | |
64 | lto.srcman: | |
65 | lto.srcinfo: | |
66 | lto.install-plugin: | |
67 | ||
68 | lto.mostlyclean: | |
66d62d9f | 69 | rm -f $(LTO_OBJS) $(LTO_EXE) lto1.fda $(LTO_DUMP_OBJS) $(LTO_DUMP_EXE) lto-dump.fda |
d7f09764 DN |
70 | |
71 | lto.clean: | |
72 | lto.distclean: | |
73 | lto.maintainer-clean: | |
74 | lto.stage1: | |
75 | lto.stage2: | |
76 | lto.stage3: | |
77 | lto.stage4: | |
78 | lto.stageprofile: | |
79 | lto.stagefeedback: | |
80 | ||
81 | # LTO rules. | |
82 | ||
83 | # Use strict warnings for this front end. | |
84 | lto-warn = $(STRICT_WARN) | |
85 | ||
86 | $(LTO_EXE): $(LTO_OBJS) $(BACKEND) $(LIBDEPS) | |
427b248d | 87 | +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ |
6b3456d1 | 88 | $(LTO_OBJS) $(BACKEND) $(BACKENDLIBS) $(LIBS) |
d7f09764 | 89 | |
66d62d9f HK |
90 | $(LTO_DUMP_EXE): $(LTO_EXE) $(LTO_DUMP_OBJS) $(BACKEND) $(LIBDEPS) |
91 | +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ | |
92 | $(LTO_DUMP_OBJS) $(BACKEND) $(BACKENDLIBS) $(LIBS) | |
93 | ||
94 | lto/lto-dump.o: $(LTO_EXE) | |
95 | ||
277d7ee0 AK |
96 | lto1.fda: ../prev-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA) |
97 | $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov lto1.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1 | |
98 | ||
1915c739 JJ |
99 | # LTO testing is done as part of C/C++/Fortran etc. testing. |
100 | check-lto: | |
033eb567 DM |
101 | |
102 | # No LTO-specific selftests | |
103 | selftest-lto: |