]>
Commit | Line | Data |
---|---|---|
61a0eea4 | 1 | # Makefile for GNU Objective C runtime library. |
fbd26352 | 2 | # Copyright (C) 1993-2019 Free Software Foundation, Inc. |
265ab036 | 3 | |
893d9197 | 4 | #This file is part of GCC. |
265ab036 | 5 | |
893d9197 | 6 | #GCC is free software; you can redistribute it and/or modify |
265ab036 | 7 | #it under the terms of the GNU General Public License as published by |
6bc9506f | 8 | #the Free Software Foundation; either version 3, or (at your option) |
265ab036 | 9 | #any later version. |
10 | ||
893d9197 | 11 | #GCC is distributed in the hope that it will be useful, |
265ab036 | 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 | |
6bc9506f | 17 | #along with GCC; see the file COPYING3. If not see |
18 | #<http://www.gnu.org/licenses/>. | |
265ab036 | 19 | |
20 | #This was cribbed from the libchill, libiberty and libstdc++ | |
21 | #Makefile.in files. Some of this stuff may be unnecessary and | |
22 | #worthless. | |
23 | ||
c86bfe45 | 24 | SHELL = @SHELL@ |
6ed57656 | 25 | MAKEOVERRIDES= |
265ab036 | 26 | |
27 | #### Start of system configuration section. #### | |
28 | ||
6ed57656 | 29 | srcdir = @glibcpp_srcdir@ |
30 | VPATH = @glibcpp_srcdir@ | |
265ab036 | 31 | prefix = @prefix@ |
32 | exec_prefix = @exec_prefix@ | |
9c4e05bc | 33 | target_noncanonical = @target_noncanonical@ |
0812bb06 | 34 | gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) |
c1eb9e31 | 35 | host_subdir = @host_subdir@ |
6ed57656 | 36 | top_srcdir = @top_srcdir@ |
ff434425 | 37 | multi_basedir = @multi_basedir@ |
57a4c641 | 38 | toolexecdir = @toolexecdir@ |
85fe910a | 39 | # Toolexecdir is used only by toolexeclibdir |
7fc7cb73 | 40 | toolexeclibdir = @toolexeclibdir@ |
6ed57656 | 41 | |
ce716239 | 42 | includedirname = @includedirname@ |
f90c9f0e | 43 | libsuffix = @libsuffix@ |
166e6519 | 44 | |
8c35d268 | 45 | lt_host_flags = @lt_host_flags@ |
a16ff609 | 46 | extra_ldflags_libobjc = @extra_ldflags_libobjc@ |
47 | ||
6ed57656 | 48 | top_builddir = . |
265ab036 | 49 | |
50 | libdir = $(exec_prefix)/lib | |
9c4e05bc | 51 | libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version) |
265ab036 | 52 | |
53 | # Multilib support variables. | |
54 | MULTISRCTOP = | |
55 | MULTIBUILDTOP = | |
56 | MULTIDIRS = | |
57 | MULTISUBDIR = | |
58 | MULTIDO = true | |
59 | MULTICLEAN = true | |
60 | ||
61 | # Not configured per top-level version, since that doesn't get passed | |
62 | # down at configure time, but overrridden by the top-level install | |
63 | # target. | |
64 | INSTALL = @INSTALL@ | |
65 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
66 | INSTALL_DATA = @INSTALL_DATA@ | |
67 | ||
68 | AR = @AR@ | |
69 | AR_FLAGS = rc | |
70 | ||
71 | RANLIB = @RANLIB@ | |
72 | ||
73 | CC = @CC@ | |
74 | CFLAGS = @CFLAGS@ | |
65d4019c | 75 | XCFLAGS = @XCFLAGS@ |
c86bfe45 | 76 | WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes |
65d4019c | 77 | ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) \ |
78 | $(XCFLAGS) $(CFLAGS) $(WARN_CFLAGS) \ | |
7f0dae42 | 79 | -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions |
265ab036 | 80 | |
0f72a548 | 81 | # Libtool |
82 | # The following strings describe the version of the obj-C library | |
83 | # begin compiled and compatibility issues. | |
84 | # Please refer to Libtool documentation about how to manage these | |
85 | # numbers. | |
f01fd551 | 86 | LIBOBJC_VERSION = @VERSION@ |
87 | LIBOBJC_GC_VERSION = @VERSION@ | |
60598a3a | 88 | LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS) |
0f72a548 | 89 | LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile |
90 | LIBTOOL_LINK = $(LIBTOOL) --mode=link | |
91 | LIBTOOL_INSTALL = $(LIBTOOL) --mode=install | |
92 | LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean | |
93 | #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall | |
94 | ||
fc367e10 | 95 | OBJC_GCFLAGS=@OBJC_GCFLAGS@ |
e23e7a91 | 96 | OBJC_BOEHM_GC=@OBJC_BOEHM_GC@ |
97 | OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@ | |
baf71228 | 98 | OBJC_BOEHM_GC_LIBS=@OBJC_BOEHM_GC_LIBS@ |
e23e7a91 | 99 | |
db7e3326 | 100 | INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \ |
c1eb9e31 | 101 | -I$(srcdir)/$(MULTISRCTOP)../gcc/config \ |
102 | -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \ | |
e59be7e3 | 103 | -I$(srcdir)/$(MULTISRCTOP)../libgcc \ |
630d52ca | 104 | -I$(MULTIBUILDTOP)../libgcc \ |
e23e7a91 | 105 | -I$(srcdir)/$(MULTISRCTOP)../include \ |
106 | $(OBJC_BOEHM_GC_INCLUDES) | |
265ab036 | 107 | |
db7e3326 | 108 | ## |
109 | ## The list of header/source files | |
110 | ## | |
265ab036 | 111 | |
01eb761e | 112 | # User-visible header files, from the objc/ directory |
344bfd09 | 113 | OBJC_H = \ |
114 | objc.h \ | |
115 | objc-exception.h \ | |
a2a8dcb1 | 116 | objc-sync.h \ |
344bfd09 | 117 | \ |
344bfd09 | 118 | NXConstStr.h \ |
119 | Object.h \ | |
120 | Protocol.h \ | |
c3a945cd | 121 | message.h \ |
c3a945cd | 122 | objc-decls.h \ |
0a65c3bb | 123 | runtime.h \ |
0fbd2a47 | 124 | thr.h |
265ab036 | 125 | |
db7e3326 | 126 | # Objective-C source files to compile |
127 | OBJC_SOURCE_FILES = \ | |
128 | NXConstStr.m \ | |
129 | Object.m \ | |
130 | Protocol.m \ | |
8438c249 | 131 | accessors.m \ |
db7e3326 | 132 | linking.m |
133 | ||
134 | # C source files to compile | |
135 | C_SOURCE_FILES = \ | |
db7e3326 | 136 | class.c \ |
137 | encoding.c \ | |
138 | error.c \ | |
139 | gc.c \ | |
140 | hash.c \ | |
141 | init.c \ | |
631bc351 | 142 | ivars.c \ |
db7e3326 | 143 | memory.c \ |
1da9f882 | 144 | methods.c \ |
db7e3326 | 145 | nil_method.c \ |
0a65c3bb | 146 | objc-foreach.c \ |
a2a8dcb1 | 147 | objc-sync.c \ |
db7e3326 | 148 | objects.c \ |
e983fc72 | 149 | protocols.c \ |
db7e3326 | 150 | sarray.c \ |
151 | selector.c \ | |
152 | sendmsg.c \ | |
153 | thr.c \ | |
154 | exception.c | |
155 | ||
156 | # Object files to link (when the library is linked with no GC (Garbage Collection)) | |
157 | OBJS = \ | |
158 | $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \ | |
159 | $(patsubst %.c,%.lo,$(C_SOURCE_FILES)) | |
160 | ||
161 | # Object files to link (when the library is linked with GC (Garbage Collection)) | |
c3a945cd | 162 | OBJS_GC = \ |
db7e3326 | 163 | $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \ |
164 | $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES)) | |
265ab036 | 165 | |
265ab036 | 166 | |
db7e3326 | 167 | ## |
168 | ## The rules to build | |
169 | ## | |
265ab036 | 170 | |
db7e3326 | 171 | # Flags to pass to a recursive make. |
172 | FLAGS_TO_PASS = \ | |
173 | "AR=$(AR)" \ | |
174 | "AR_FLAGS=$(AR_FLAGS)" \ | |
175 | "CC=$(CC)" \ | |
176 | "CFLAGS=$(CFLAGS)" \ | |
177 | "DESTDIR=$(DESTDIR)" \ | |
178 | "LIBCFLAGS=$(LIBCFLAGS)" \ | |
179 | "EXTRA_OFILES=$(EXTRA_OFILES)" \ | |
180 | "HDEFINES=$(HDEFINES)" \ | |
181 | "INSTALL=$(INSTALL)" \ | |
182 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
183 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
184 | "LDFLAGS=$(LDFLAGS)" \ | |
185 | "LIBTOOL=$(LIBTOOL)" \ | |
186 | "LOADLIBES=$(LOADLIBES)" \ | |
187 | "PICFLAG=$(PICFLAG)" \ | |
188 | "RANLIB=$(RANLIB)" \ | |
189 | "SHELL=$(SHELL)" \ | |
190 | "prefix=$(prefix)" \ | |
191 | "exec_prefix=$(exec_prefix)" \ | |
192 | "libdir=$(libdir)" \ | |
193 | "libsubdir=$(libsubdir)" \ | |
194 | "tooldir=$(tooldir)" | |
265ab036 | 195 | |
db7e3326 | 196 | # The 'all' rule must be the first one so that it is executed if |
197 | # nothing is specified on the command-line. | |
198 | all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC) | |
199 | : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all | |
c3a945cd | 200 | |
db7e3326 | 201 | .SUFFIXES: |
202 | .SUFFIXES: .c .m .lo | |
265ab036 | 203 | |
db7e3326 | 204 | %.lo: %.c |
205 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
206 | $(ALL_CFLAGS) $(INCLUDES) \ | |
207 | -o $@ | |
265ab036 | 208 | |
db7e3326 | 209 | %_gc.lo: %.c |
210 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
211 | $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \ | |
212 | -o $@ | |
265ab036 | 213 | |
db7e3326 | 214 | %.lo: %.m |
215 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
216 | $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \ | |
217 | -o $@ | |
265ab036 | 218 | |
db7e3326 | 219 | %_gc.lo: %.m |
220 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
221 | $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \ | |
222 | -o $@ | |
265ab036 | 223 | |
db7e3326 | 224 | # sendmsg has a special rule because it depends on runtime-info.h. |
225 | runtime-info.h: | |
226 | echo "" > tmp-runtime.m | |
227 | echo "/* This file is automatically generated */" > $@ | |
228 | $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@ | |
229 | rm -f tmp-runtime.m tmp-runtime.s | |
265ab036 | 230 | |
db7e3326 | 231 | sendmsg.lo: sendmsg.c runtime-info.h |
232 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
233 | $(ALL_CFLAGS) $(INCLUDES) \ | |
234 | -o $@ | |
265ab036 | 235 | |
db7e3326 | 236 | sendmsg_gc.lo: sendmsg.c runtime-info.h |
237 | $(LIBTOOL_COMPILE) $(CC) $< -c \ | |
238 | $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \ | |
239 | -o $@ | |
265ab036 | 240 | |
db7e3326 | 241 | # These files have separate rules because they require special |
242 | # compiler flags. | |
265ab036 | 243 | |
2c5cfd29 | 244 | exception.lo: exception.c |
db7e3326 | 245 | $(LIBTOOL_COMPILE) $(CC) $< -c \ |
c0eeb2f4 | 246 | $(ALL_CFLAGS) $(INCLUDES) -fexceptions \ |
db7e3326 | 247 | -o $@ |
98fde024 | 248 | |
249 | exception_gc.lo: exception.c | |
db7e3326 | 250 | $(LIBTOOL_COMPILE) $(CC) $< -c \ |
c0eeb2f4 | 251 | $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \ |
db7e3326 | 252 | -o $@ |
2c5cfd29 | 253 | |
51f93521 | 254 | doc: info dvi pdf html |
265ab036 | 255 | |
cbb90fc8 | 256 | # No install-html or install-pdf support |
e0f44d87 | 257 | .PHONY: install-html install-pdf install-info |
ba0c10ab | 258 | install-html: |
cbb90fc8 | 259 | install-pdf: |
e0f44d87 | 260 | install-info: |
ba0c10ab | 261 | |
ac051731 | 262 | LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) |
263 | ||
f90c9f0e | 264 | libobjc$(libsuffix).la: $(OBJS) |
6ed57656 | 265 | $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \ |
6bd88b86 | 266 | -Wc,-shared-libgcc -rpath $(toolexeclibdir) \ |
ac051731 | 267 | -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \ |
268 | $(LTLDFLAGS) | |
265ab036 | 269 | |
f90c9f0e | 270 | libobjc_gc$(libsuffix).la: $(OBJS_GC) |
7170e5e2 | 271 | $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \ |
6bd88b86 | 272 | -Wc,-shared-libgcc -rpath $(toolexeclibdir) \ |
ac051731 | 273 | -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \ |
274 | $(LTLDFLAGS) | |
265ab036 | 275 | |
6b515411 | 276 | info: |
277 | dvi: | |
51f93521 | 278 | pdf: |
6b515411 | 279 | html: |
265ab036 | 280 | |
281 | Makefile: Makefile.in config.status | |
282 | $(SHELL) config.status | |
283 | ||
284 | config.status: configure | |
285 | rm -f config.cache | |
286 | CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ | |
287 | CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck | |
288 | ||
a2655af1 | 289 | AUTOCONF = autoconf |
290 | ACLOCAL = aclocal | |
291 | ACLOCAL_AMFLAGS = -I ../config -I .. | |
292 | aclocal_deps = \ | |
293 | $(srcdir)/../config/multi.m4 \ | |
294 | $(srcdir)/../config/override.m4 \ | |
295 | $(srcdir)/../config/proginstall.m4 \ | |
296 | $(srcdir)/../ltoptions.m4 \ | |
297 | $(srcdir)/../ltsugar.m4 \ | |
298 | $(srcdir)/../ltversion.m4 \ | |
299 | $(srcdir)/../lt~obsolete.m4 \ | |
65d4019c | 300 | $(srcdir)/../cet.m4 \ |
a2655af1 | 301 | $(srcdir)/acinclude.m4 |
302 | ||
303 | $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4 | |
265ab036 | 304 | rm -f config.cache |
a2655af1 | 305 | cd $(srcdir) && $(AUTOCONF) |
306 | ||
307 | $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) | |
308 | cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) | |
265ab036 | 309 | |
6ed57656 | 310 | install: install-libs install-headers |
265ab036 | 311 | |
312 | install-libs: installdirs | |
ff434425 | 313 | $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir) |
f90c9f0e | 314 | $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir); |
0f72a548 | 315 | if [ "$(OBJC_BOEHM_GC)" ]; then \ |
f90c9f0e | 316 | $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \ |
7fc7cb73 | 317 | $(DESTDIR)$(toolexeclibdir);\ |
0f72a548 | 318 | fi |
6ed57656 | 319 | $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" |
7fc7cb73 | 320 | @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir) |
265ab036 | 321 | |
db7e3326 | 322 | # Copy Objective-C headers to installation include directory. |
6ed57656 | 323 | install-headers: |
ff434425 | 324 | $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc |
265ab036 | 325 | for file in $(OBJC_H); do \ |
3c3646e7 | 326 | realfile=$(srcdir)/objc/$${file}; \ |
ce716239 | 327 | $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \ |
265ab036 | 328 | done |
329 | ||
330 | check uninstall install-strip dist installcheck installdirs: | |
331 | ||
332 | mostlyclean: | |
f90c9f0e | 333 | -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo |
0f72a548 | 334 | -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \ |
51f93521 | 335 | fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \ |
265ab036 | 336 | *.toc *.tp *.vr *.html libobj.exp |
337 | @$(MULTICLEAN) multi-clean DO=mostlyclean | |
338 | ||
339 | clean: mostlyclean | |
340 | rm -f config.log | |
341 | @$(MULTICLEAN) multi-clean DO=clean | |
342 | ||
343 | distclean: clean | |
344 | @$(MULTICLEAN) multi-clean DO=distclean | |
345 | rm -f config.cache config.status Makefile configure | |
346 | ||
347 | maintainer-clean realclean: distclean | |
348 | ||
349 | .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \ | |
350 | install-strip dist installcheck installdirs | |
428b4753 | 351 | |
352 | # Don't export variables to the environment, in order to not confuse | |
353 | # configure. | |
354 | .NOEXPORT: |