annotate gcc/c/Make-lang.in @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # Top level -*- makefile -*- fragment for GNU C - C language.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 # Copyright (C) 1994-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 #This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
7 #it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 #the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 #any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 #GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
14 #GNU General Public License for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 # along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 # <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 # This file provides the language dependent support in the main Makefile.
kono
parents:
diff changeset
21 # Each language makefile fragment must provide the following targets:
kono
parents:
diff changeset
22 #
kono
parents:
diff changeset
23 # foo.all.cross, foo.start.encap, foo.rest.encap,
kono
parents:
diff changeset
24 # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
kono
parents:
diff changeset
25 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
kono
parents:
diff changeset
26 # foo.mostlyclean, foo.clean, foo.distclean,
kono
parents:
diff changeset
27 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
kono
parents:
diff changeset
28 #
kono
parents:
diff changeset
29 # where `foo' is the name of the language.
kono
parents:
diff changeset
30 #
kono
parents:
diff changeset
31 # It should also provide rules for:
kono
parents:
diff changeset
32 #
kono
parents:
diff changeset
33 # - making any compiler driver (eg: gcc)
kono
parents:
diff changeset
34 # - the compiler proper (eg: cc1)
kono
parents:
diff changeset
35 # - define the names for selecting the language in LANGUAGES.
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 #
kono
parents:
diff changeset
38 # Define the names for selecting c in LANGUAGES.
kono
parents:
diff changeset
39 c: cc1$(exeext)
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 # Tell GNU make to ignore these if they exist.
kono
parents:
diff changeset
42 .PHONY: c gcc
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 # The C front end driver. This is different from the drivers for other
kono
parents:
diff changeset
45 # front ends, because there is no C language specific driver (i.e. nothing
kono
parents:
diff changeset
46 # is to cc1 as e.g. g++ is to cc1plus, or gfortran is to f951).
kono
parents:
diff changeset
47 CFLAGS-c/gccspec.o += $(DRIVER_DEFINES)
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 # The C compiler itself.
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 # Language-specific object files for C and Objective C.
kono
parents:
diff changeset
52 C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \
kono
parents:
diff changeset
53 c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
54 c/c-fold.o c/gimple-parser.o \
111
kono
parents:
diff changeset
55 $(C_COMMON_OBJS) $(C_TARGET_OBJS)
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 # Language-specific object files for C.
kono
parents:
diff changeset
58 C_OBJS = c/c-lang.o c-family/stub-objc.o $(C_AND_OBJC_OBJS)
kono
parents:
diff changeset
59 c_OBJS = $(C_OBJS) cc1-checksum.o c/gccspec.o
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 # Use strict warnings for this front end.
kono
parents:
diff changeset
62 c-warn = $(STRICT_WARN)
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 ifeq ($(if $(wildcard ../stage_current),$(shell cat \
kono
parents:
diff changeset
65 ../stage_current)),stageautofeedback)
kono
parents:
diff changeset
66 $(C_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1.fda
kono
parents:
diff changeset
67 $(C_OBJS): cc1.fda
kono
parents:
diff changeset
68 endif
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 # compute checksum over all object files and the options
kono
parents:
diff changeset
71 # re-use the checksum from the prev-final stage so it passes
kono
parents:
diff changeset
72 # the bootstrap comparison and allows comparing of the cc1 binary
kono
parents:
diff changeset
73 cc1-checksum.c : build/genchecksum$(build_exeext) checksum-options \
kono
parents:
diff changeset
74 $(C_OBJS) $(BACKEND) $(LIBDEPS)
kono
parents:
diff changeset
75 if [ -f ../stage_final ] \
kono
parents:
diff changeset
76 && cmp -s ../stage_current ../stage_final; then \
kono
parents:
diff changeset
77 cp ../prev-gcc/cc1-checksum.c cc1-checksum.c; \
kono
parents:
diff changeset
78 else \
kono
parents:
diff changeset
79 build/genchecksum$(build_exeext) $(C_OBJS) $(BACKEND) $(LIBDEPS) \
kono
parents:
diff changeset
80 checksum-options > cc1-checksum.c.tmp && \
kono
parents:
diff changeset
81 $(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c; \
kono
parents:
diff changeset
82 fi
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
kono
parents:
diff changeset
85 +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
kono
parents:
diff changeset
86 cc1-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 cc1.fda: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
kono
parents:
diff changeset
89 $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov cc1.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 #
kono
parents:
diff changeset
92 # Build hooks:
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 c.info:
kono
parents:
diff changeset
95 c.dvi:
kono
parents:
diff changeset
96 c.pdf:
kono
parents:
diff changeset
97 c.html:
kono
parents:
diff changeset
98 c.install-info:
kono
parents:
diff changeset
99 c.install-pdf:
kono
parents:
diff changeset
100 c.install-html:
kono
parents:
diff changeset
101 c.all.cross:
kono
parents:
diff changeset
102 c.start.encap:
kono
parents:
diff changeset
103 c.rest.encap:
kono
parents:
diff changeset
104 c.srcinfo:
kono
parents:
diff changeset
105 c.srcextra: gengtype-lex.c
kono
parents:
diff changeset
106 -cp -p $^ $(srcdir)
kono
parents:
diff changeset
107 c.tags: force
kono
parents:
diff changeset
108 cd $(srcdir)/c; etags -o TAGS.sub *.c *.h; \
kono
parents:
diff changeset
109 etags --include TAGS.sub --include ../TAGS.sub
kono
parents:
diff changeset
110 c.man:
kono
parents:
diff changeset
111 c.srcman:
kono
parents:
diff changeset
112
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
113 # C selftests
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
114
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
115 # If C is enabled, require the selftests to be run for it
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
116 # at each stage of the build:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
117 selftest-c: s-selftest-c
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
118
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
119 C_SELFTEST_FLAGS = -xc $(SELFTEST_FLAGS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
120 C_SELFTEST_DEPS = cc1$(exeext) $(SELFTEST_DEPS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
121
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
122 # Run the C selftests:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
123 s-selftest-c: $(C_SELFTEST_DEPS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
124 $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
125 $(STAMP) $@
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
126
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
127 # Convenience methods for running C selftests under gdb:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
128 .PHONY: selftest-c-gdb
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
129 selftest-c-gdb: $(C_SELFTEST_DEPS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
130 $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
131 -wrapper gdb,--args
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
132
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
133 .PHONY: selftest-gdb
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
134 selftest-gdb: selftest-c-gdb
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
135
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
136 # Convenience methods for running C selftests under valgrind:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
137 .PHONY: selftest-c-valgrind
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
138 selftest-c-valgrind: $(C_SELFTEST_DEPS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
139 $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
140 -wrapper valgrind,--leak-check=full
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
141
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
142 .PHONY: selftest-valgrind
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
143 selftest-valgrind: selftest-c-valgrind
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
144
111
kono
parents:
diff changeset
145 # List of targets that can use the generic check- rule and its // variant.
kono
parents:
diff changeset
146 lang_checks += check-gcc
kono
parents:
diff changeset
147 lang_checks_parallelized += check-gcc
kono
parents:
diff changeset
148 # For description see the check_$lang_parallelize comment in gcc/Makefile.in.
kono
parents:
diff changeset
149 check_gcc_parallelize=10000
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 # 'make check' in gcc/ looks for check-c. Redirect it to check-gcc.
kono
parents:
diff changeset
152 check-c : check-gcc
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 #
kono
parents:
diff changeset
155 # Install hooks:
kono
parents:
diff changeset
156 # cc1 is installed elsewhere as part of $(COMPILERS).
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 c.install-common:
kono
parents:
diff changeset
159 c.install-man:
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
160
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
161 c.install-plugin: installdirs
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
162 # Install import library.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
163 ifeq ($(plugin_implib),yes)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
164 $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
165 $(INSTALL_DATA) cc1$(exeext).a $(DESTDIR)/$(plugin_resourcesdir)/cc1$(exeext).a
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
166 endif
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
167
111
kono
parents:
diff changeset
168 c.uninstall:
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170 #
kono
parents:
diff changeset
171 # Clean hooks:
kono
parents:
diff changeset
172 # A lot of the ancillary files are deleted by the main makefile.
kono
parents:
diff changeset
173 # We just have to delete files specific to us.
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 c.mostlyclean:
kono
parents:
diff changeset
176 -rm -f cc1$(exeext)
kono
parents:
diff changeset
177 -rm -f c/*$(objext)
kono
parents:
diff changeset
178 -rm -f c/*$(coverageexts)
kono
parents:
diff changeset
179 -rm -f cc1.fda
kono
parents:
diff changeset
180 c.clean:
kono
parents:
diff changeset
181 c.distclean:
kono
parents:
diff changeset
182 -rm -f c/config.status c/Makefile
kono
parents:
diff changeset
183 c.maintainer-clean:
kono
parents:
diff changeset
184 #
kono
parents:
diff changeset
185 # Stage hooks:
kono
parents:
diff changeset
186 # The main makefile has already created stage?/cp.
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 c.stage1: stage1-start
kono
parents:
diff changeset
189 -mv c/*$(objext) stage1/c
kono
parents:
diff changeset
190 c.stage2: stage2-start
kono
parents:
diff changeset
191 -mv c/*$(objext) stage2/c
kono
parents:
diff changeset
192 c.stage3: stage3-start
kono
parents:
diff changeset
193 -mv c/*$(objext) stage3/c
kono
parents:
diff changeset
194 c.stage4: stage4-start
kono
parents:
diff changeset
195 -mv c/*$(objext) stage4/c
kono
parents:
diff changeset
196 c.stageprofile: stageprofile-start
kono
parents:
diff changeset
197 -mv c/*$(objext) stageprofile/c
kono
parents:
diff changeset
198 c.stagefeedback: stagefeedback-start
kono
parents:
diff changeset
199 -mv c/*$(objext) stagefeedback/c
kono
parents:
diff changeset
200 c.autostageprofile: autostageprofile-start
kono
parents:
diff changeset
201 -mv c/*$(objext) autostageprofile/c
kono
parents:
diff changeset
202 c.autostagefeedback: autostagefeedback-start
kono
parents:
diff changeset
203 -mv c/*$(objext) autostagefeedback/c