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