]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/c/Make-lang.in
72c9ae74f87e149ef5d7860bcbe38cab9994b760
[thirdparty/gcc.git] / gcc / c / Make-lang.in
1 # Top level -*- makefile -*- fragment for GNU C - C language.
2 # Copyright (C) 1994-2016 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: gcc)
34 # - the compiler proper (eg: cc1)
35 # - define the names for selecting the language in LANGUAGES.
36
37 #\f
38 # Define the names for selecting c in LANGUAGES.
39 c: cc1$(exeext)
40
41 # Tell GNU make to ignore these if they exist.
42 .PHONY: c gcc
43
44 # The C front end driver. This is different from the drivers for other
45 # front ends, because there is no C language specific driver (i.e. nothing
46 # is to cc1 as e.g. g++ is to cc1plus, or gfortran is to f951).
47 CFLAGS-c/gccspec.o += $(DRIVER_DEFINES)
48
49 # The C compiler itself.
50
51 # Language-specific object files for C and Objective C.
52 C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \
53 c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o \
54 c/c-array-notation.o c/c-fold.o $(C_COMMON_OBJS) $(C_TARGET_OBJS)
55
56 # Language-specific object files for C.
57 C_OBJS = c/c-lang.o c-family/stub-objc.o $(C_AND_OBJC_OBJS)
58 c_OBJS = $(C_OBJS) cc1-checksum.o c/gccspec.o
59
60 # Use strict warnings for this front end.
61 c-warn = $(STRICT_WARN)
62
63 ifeq ($(if $(wildcard ../stage_current),$(shell cat \
64 ../stage_current)),stageautofeedback)
65 $(C_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1.fda
66 $(C_OBJS): cc1.fda
67 endif
68
69 # compute checksum over all object files and the options
70 # re-use the checksum from the prev-final stage so it passes
71 # the bootstrap comparison and allows comparing of the cc1 binary
72 cc1-checksum.c : build/genchecksum$(build_exeext) checksum-options \
73 $(C_OBJS) $(BACKEND) $(LIBDEPS)
74 if [ -f ../stage_final ] \
75 && cmp -s ../stage_current ../stage_final; then \
76 cp ../prev-gcc/cc1-checksum.c cc1-checksum.c; \
77 else \
78 build/genchecksum$(build_exeext) $(C_OBJS) $(BACKEND) $(LIBDEPS) \
79 checksum-options > cc1-checksum.c.tmp && \
80 $(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c; \
81 fi
82
83 cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
84 +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
85 cc1-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
86
87 cc1.fda: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
88 $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov cc1.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1
89
90 #\f
91 # Build hooks:
92
93 c.info:
94 c.dvi:
95 c.pdf:
96 c.html:
97 c.install-info:
98 c.install-pdf:
99 c.install-html:
100 c.all.cross:
101 c.start.encap:
102 c.rest.encap:
103 c.srcinfo:
104 c.srcextra: gengtype-lex.c
105 -cp -p $^ $(srcdir)
106 c.tags: force
107 cd $(srcdir)/c; etags -o TAGS.sub *.c *.h; \
108 etags --include TAGS.sub --include ../TAGS.sub
109 c.man:
110 c.srcman:
111
112 # List of targets that can use the generic check- rule and its // variant.
113 lang_checks += check-gcc
114 lang_checks_parallelized += check-gcc
115 # For description see the check_$lang_parallelize comment in gcc/Makefile.in.
116 check_gcc_parallelize=10000
117
118 # 'make check' in gcc/ looks for check-c. Redirect it to check-gcc.
119 check-c : check-gcc
120
121 #\f
122 # Install hooks:
123 # cc1 is installed elsewhere as part of $(COMPILERS).
124
125 c.install-common:
126 c.install-man:
127 c.install-plugin:
128 c.uninstall:
129
130 #\f
131 # Clean hooks:
132 # A lot of the ancillary files are deleted by the main makefile.
133 # We just have to delete files specific to us.
134
135 c.mostlyclean:
136 -rm -f cc1$(exeext)
137 -rm -f c/*$(objext)
138 -rm -f c/*$(coverageexts)
139 -rm -f cc1.fda
140 c.clean:
141 c.distclean:
142 -rm -f c/config.status c/Makefile
143 c.maintainer-clean:
144 #\f
145 # Stage hooks:
146 # The main makefile has already created stage?/cp.
147
148 c.stage1: stage1-start
149 -mv c/*$(objext) stage1/c
150 c.stage2: stage2-start
151 -mv c/*$(objext) stage2/c
152 c.stage3: stage3-start
153 -mv c/*$(objext) stage3/c
154 c.stage4: stage4-start
155 -mv c/*$(objext) stage4/c
156 c.stageprofile: stageprofile-start
157 -mv c/*$(objext) stageprofile/c
158 c.stagefeedback: stagefeedback-start
159 -mv c/*$(objext) stagefeedback/c
160 c.autostageprofile: autostageprofile-start
161 -mv c/*$(objext) autostageprofile/c
162 c.autostagefeedback: autostagefeedback-start
163 -mv c/*$(objext) autostagefeedback/c