]>
Commit | Line | Data |
---|---|---|
b2e61dde | 1 | # Top level -*- makefile -*- fragment for GNU Objective-C++ |
a945c346 | 2 | # Copyright (C) 2005-2024 Free Software Foundation, Inc. |
b2e61dde MS |
3 | # Contributed by Ziemowit Laski <zlaski@apple.com> |
4 | ||
5 | #This file is part of GCC. | |
6 | ||
7 | #GCC is free software; you can redistribute it and/or modify | |
8 | #it under the terms of the GNU General Public License as published by | |
af84f9c5 | 9 | #the Free Software Foundation; either version 3, or (at your option) |
b2e61dde MS |
10 | #any later version. |
11 | ||
12 | #GCC is distributed in the hope that it will be useful, | |
13 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | #GNU General Public License for more details. | |
16 | ||
17 | #You should have received a copy of the GNU General Public License | |
af84f9c5 NC |
18 | #along with GCC; see the file COPYING3. If not see |
19 | #<http://www.gnu.org/licenses/>. | |
20 | ||
b2e61dde MS |
21 | |
22 | # This file provides the language dependent support in the main Makefile. | |
23 | # Each language makefile fragment must provide the following targets: | |
24 | # | |
bd97af06 | 25 | # foo.all.cross, foo.start.encap, foo.rest.encap, |
5fbc6266 | 26 | # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf, |
55bcd32b | 27 | # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall, |
b2e61dde MS |
28 | # foo.mostlyclean, foo.clean, foo.distclean, |
29 | # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 | |
30 | # | |
31 | # where `foo' is the name of the language. | |
32 | # | |
33 | # It should also provide rules for: | |
34 | # | |
35 | # - making any compiler driver (eg: g++) | |
36 | # - the compiler proper (eg: cc1plus) | |
37 | # - define the names for selecting the language in LANGUAGES. | |
38 | ||
39 | #\f | |
40 | # Define the names for selecting Objective-C++ in LANGUAGES. | |
9d29a5b7 | 41 | obj-c++: cc1objplus$(exeext) |
a774a6a2 | 42 | obj-c++.serial = cc1objplus$(exeext) |
b2e61dde MS |
43 | |
44 | # Tell GNU make to ignore these if they exist. | |
a774a6a2 | 45 | .PHONY: obj-c++ |
b2e61dde MS |
46 | |
47 | # Use maximal warnings for this front end. Also, make ObjC and C++ | |
48 | # headers accessible. | |
49 | objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp | |
50 | ||
51 | # Language-specific object files for Objective C++. | |
52 | OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \ | |
d764a8e6 IS |
53 | objcp/objc-runtime-shared-support.o \ |
54 | objcp/objc-gnu-runtime-abi-01.o \ | |
55 | objcp/objc-next-runtime-abi-01.o \ | |
56 | objcp/objc-next-runtime-abi-02.o \ | |
f027ee7c | 57 | objcp/objc-encoding.o \ |
3cc2dd4b | 58 | objcp/objc-map.o \ |
b2e61dde MS |
59 | $(CXX_AND_OBJCXX_OBJS) |
60 | ||
6cba282a TT |
61 | obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o |
62 | ||
3e00f8dd BE |
63 | # compute checksum over all object files and the options |
64 | # re-use the checksum from the prev-final stage so it passes | |
65 | # the bootstrap comparison and allows comparing of the cc1 binary | |
e53b6e56 | 66 | cc1objplus-checksum.cc : build/genchecksum$(build_exeext) checksum-options \ |
8ea81f56 | 67 | $(OBJCXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) |
3e00f8dd | 68 | if [ -f ../stage_final ] \ |
40917137 BE |
69 | && cmp -s ../stage_current ../stage_final \ |
70 | && [ -f ../prev-gcc/$@ ]; then \ | |
3e00f8dd BE |
71 | cp ../prev-gcc/$@ $@; \ |
72 | else \ | |
73 | build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) \ | |
74 | $(CODYLIB) $(LIBDEPS) checksum-options > $@.tmp && \ | |
75 | $(srcdir)/../move-if-change $@.tmp $@; \ | |
76 | fi | |
3fd30b88 | 77 | |
d326ebc9 | 78 | cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \ |
8ea81f56 | 79 | $(CODYLIB) $(LIBDEPS) $(obj-c++.prev) |
d326ebc9 | 80 | @$(call LINK_PROGRESS,$(INDEX.obj-c++),start) |
427b248d | 81 | +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ |
a20893cf RO |
82 | $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \ |
83 | $(CODYLIB) $(NETLIBS) $(LIBS) $(BACKENDLIBS) | |
d326ebc9 | 84 | @$(call LINK_PROGRESS,$(INDEX.obj-c++),end) |
b2e61dde | 85 | |
e980df8e TT |
86 | # Objective C++ language specific files. |
87 | ||
e53b6e56 | 88 | objcp/objc-runtime-shared-support.o: objc/objc-runtime-shared-support.cc |
694e859a TT |
89 | $(COMPILE) $< |
90 | $(POSTCOMPILE) | |
91 | ||
e53b6e56 | 92 | objcp/objc-gnu-runtime-abi-01.o: objc/objc-gnu-runtime-abi-01.cc |
694e859a TT |
93 | $(COMPILE) $< |
94 | $(POSTCOMPILE) | |
95 | ||
e53b6e56 | 96 | objcp/objc-next-runtime-abi-01.o: objc/objc-next-runtime-abi-01.cc |
694e859a TT |
97 | $(COMPILE) $< |
98 | $(POSTCOMPILE) | |
99 | ||
e53b6e56 | 100 | objcp/objc-next-runtime-abi-02.o: objc/objc-next-runtime-abi-02.cc |
694e859a TT |
101 | $(COMPILE) $< |
102 | $(POSTCOMPILE) | |
103 | ||
e53b6e56 | 104 | objcp/objcp-act.o: objc/objc-act.cc |
694e859a TT |
105 | $(COMPILE) $< |
106 | $(POSTCOMPILE) | |
107 | ||
e53b6e56 | 108 | objcp/objc-encoding.o: objc/objc-encoding.cc |
694e859a TT |
109 | $(COMPILE) $< |
110 | $(POSTCOMPILE) | |
111 | ||
e53b6e56 | 112 | objcp/objc-map.o: objc/objc-map.cc |
694e859a TT |
113 | $(COMPILE) $< |
114 | $(POSTCOMPILE) | |
3cc2dd4b | 115 | |
b2e61dde MS |
116 | po-generated: |
117 | ||
b2e61dde MS |
118 | #\f |
119 | # Build hooks: | |
120 | ||
b2e61dde MS |
121 | obj-c++.all.cross: |
122 | obj-c++.start.encap: | |
123 | obj-c++.rest.encap: | |
124 | obj-c++.info: | |
dedfa466 PB |
125 | obj-c++.install-info: |
126 | obj-c++.dvi: | |
c3e80a16 | 127 | obj-c++.install-dvi: |
b5422ad7 | 128 | obj-c++.pdf: |
5fbc6266 | 129 | obj-c++.install-pdf: |
dedfa466 | 130 | obj-c++.html: |
55bcd32b | 131 | obj-c++.install-html: |
b2e61dde | 132 | obj-c++.srcinfo: |
30cce6f6 | 133 | obj-c++.srcman: |
b2e61dde MS |
134 | obj-c++.srcextra: |
135 | obj-c++.man: | |
2a4c0366 | 136 | obj-c++.install-plugin: |
b2e61dde MS |
137 | |
138 | obj-c++.tags: force | |
a8b5d635 | 139 | cd $(srcdir)/objcp; $(ETAGS) -o TAGS.sub *.cc *.h; \ |
909b30a1 | 140 | $(ETAGS) --include TAGS.sub --include ../TAGS.sub |
b2e61dde MS |
141 | |
142 | lang_checks += check-obj-c++ | |
143 | ||
033eb567 DM |
144 | # No objc-c++-specific selftests |
145 | selftest-obj-c++: | |
146 | ||
b2e61dde MS |
147 | #\f |
148 | # Install hooks: | |
149 | # cc1objplus is installed elsewhere as part of $(COMPILERS). | |
150 | ||
b2e61dde MS |
151 | obj-c++.install-common: |
152 | ||
153 | obj-c++.install-man: | |
154 | ||
155 | obj-c++.uninstall: | |
156 | #\f | |
157 | # Clean hooks: | |
158 | # A lot of the ancillary files are deleted by the main makefile. | |
159 | # We just have to delete files specific to us. | |
160 | obj-c++.mostlyclean: | |
161 | -rm -f objcp/*$(objext) | |
162 | -rm -f objcp/*$(coverageexts) | |
46bf0b0a | 163 | -rm -f cc1objplus$(exeext) |
b2e61dde MS |
164 | obj-c++.clean: obj-c++.mostlyclean |
165 | obj-c++.distclean: | |
166 | -rm -f objcp/config.status objcp/Makefile | |
167 | obj-c++.maintainer-clean: | |
168 | ||
169 | #\f | |
170 | # Stage hooks: | |
171 | ||
172 | obj-c++.stage1: stage1-start | |
173 | -mv objcp/*$(objext) stage1/objcp | |
174 | obj-c++.stage2: stage2-start | |
175 | -mv objcp/*$(objext) stage2/objcp | |
176 | obj-c++.stage3: stage3-start | |
177 | -mv objcp/*$(objext) stage3/objcp | |
178 | obj-c++.stage4: stage4-start | |
179 | -mv objcp/*$(objext) stage4/objcp | |
180 | obj-c++.stageprofile: stageprofile-start | |
181 | -mv objcp/*$(objext) stageprofile/objcp | |
182 | obj-c++.stagefeedback: stagefeedback-start | |
183 | -mv objcp/*$(objext) stagefeedback/objcp |