]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/Makefile.in
ivars.c: Include stdlib.h.
[thirdparty/gcc.git] / libobjc / Makefile.in
CommitLineData
05dcec66 1# Makefile for GNU Objective C runtime library.
8c3e5222 2# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
748086b7 3# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
bce1b489 4
6c82ad25 5#This file is part of GCC.
bce1b489 6
6c82ad25 7#GCC is free software; you can redistribute it and/or modify
bce1b489 8#it under the terms of the GNU General Public License as published by
748086b7 9#the Free Software Foundation; either version 3, or (at your option)
bce1b489
BE
10#any later version.
11
6c82ad25 12#GCC is distributed in the hope that it will be useful,
bce1b489
BE
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
748086b7
JJ
18#along with GCC; see the file COPYING3. If not see
19#<http://www.gnu.org/licenses/>.
bce1b489
BE
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
9aa338ec 25SHELL = @SHELL@
b150efee 26MAKEOVERRIDES=
bce1b489
BE
27
28#### Start of system configuration section. ####
29
b150efee
FS
30srcdir = @glibcpp_srcdir@
31VPATH = @glibcpp_srcdir@
bce1b489
BE
32prefix = @prefix@
33exec_prefix = @exec_prefix@
9c01f395 34target_noncanonical = @target_noncanonical@
2b37e3d5 35gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
215c351a 36host_subdir = @host_subdir@
b150efee 37top_srcdir = @top_srcdir@
5b043f08 38multi_basedir = @multi_basedir@
eb01299a 39toolexecdir = @toolexecdir@
a42a57cb 40# Toolexecdir is used only by toolexeclibdir
608e1e0c 41toolexeclibdir = @toolexeclibdir@
b150efee 42
7d34a5a9 43includedirname = @includedirname@
45d5f86c 44libsuffix = @libsuffix@
ff65de76 45
a5a813f8
AP
46extra_ldflags_libobjc = @extra_ldflags_libobjc@
47
b150efee 48top_builddir = .
bce1b489 49
920d063d 50-include ../boehm-gc/threads.mk
785fad0a 51
bce1b489 52libdir = $(exec_prefix)/lib
9c01f395 53libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
bce1b489
BE
54
55# Multilib support variables.
56MULTISRCTOP =
57MULTIBUILDTOP =
58MULTIDIRS =
59MULTISUBDIR =
60MULTIDO = true
61MULTICLEAN = true
62
63# Not configured per top-level version, since that doesn't get passed
64# down at configure time, but overrridden by the top-level install
65# target.
66INSTALL = @INSTALL@
67INSTALL_PROGRAM = @INSTALL_PROGRAM@
68INSTALL_DATA = @INSTALL_DATA@
69
70AR = @AR@
71AR_FLAGS = rc
72
73RANLIB = @RANLIB@
74
75CC = @CC@
76CFLAGS = @CFLAGS@
9aa338ec 77WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
9aa338ec 78ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
84fd360d 79 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
bce1b489 80
c161c99b
NP
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.
68a1af87
MH
86LIBOBJC_VERSION = @VERSION@
87LIBOBJC_GC_VERSION = @VERSION@
84fec8a5 88LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
c161c99b
NP
89LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
90LIBTOOL_LINK = $(LIBTOOL) --mode=link
91LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
92LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
93#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
94
8c3e5222 95OBJC_GCFLAGS=-DOBJC_WITH_GC=1
8c3e5222
DA
96OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
97OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
785fad0a 98OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
8c3e5222 99
7e268280 100INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
215c351a
PB
101 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
102 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
8c3e5222
DA
103 -I$(srcdir)/$(MULTISRCTOP)../include \
104 $(OBJC_BOEHM_GC_INCLUDES)
bce1b489 105
7e268280
NP
106##
107## The list of header/source files
108##
bce1b489 109
e976a775 110# User-visible header files, from the objc/ directory
3d0d8739
NP
111OBJC_H = \
112 objc.h \
113 objc-exception.h \
fd312537 114 objc-sync.h \
3d0d8739 115 \
3d0d8739
NP
116 NXConstStr.h \
117 Object.h \
118 Protocol.h \
119 encoding.h \
7b869986
NP
120 message.h \
121 objc-api.h \
122 objc-decls.h \
f05b9d93 123 runtime.h \
3d0d8739 124 thr.h \
7e268280 125 \
349cfd93
NP
126 hash.h \
127 objc-list.h \
5d3b14bd 128 sarray.h \
7b869986 129 typedstream.h
bce1b489 130
e976a775
NP
131# User-visible header files containing deprecated APIs, from the
132# objc/deprecated directory
3d0d8739 133OBJC_DEPRECATED_H = \
cf3822f1 134 METHOD_NULL.h \
3d0d8739
NP
135 MetaClass.h \
136 Object.h \
137 STR.h \
5be9cdc1
NP
138 hash.h \
139 objc-list.h \
7b869986 140 objc_error.h \
b0453850 141 objc_get_uninstalled_dtable.h \
d1be5d82 142 objc_malloc.h \
b0453850 143 objc_object_alloc.h \
3d0d8739 144 objc_unexpected_exception.h \
d1be5d82 145 objc_valloc.h \
5d3b14bd 146 sarray.h \
2461ab4b 147 struct_objc_category.h \
3d0d8739 148 struct_objc_class.h \
2461ab4b
NP
149 struct_objc_ivar.h \
150 struct_objc_ivar_list.h \
151 struct_objc_method.h \
152 struct_objc_method_list.h \
153 struct_objc_module.h \
3d0d8739 154 struct_objc_protocol.h \
2461ab4b 155 struct_objc_protocol_list.h \
3d0d8739 156 struct_objc_selector.h \
b0453850 157 struct_objc_static_instances.h \
2461ab4b 158 struct_objc_symtab.h \
3d0d8739 159 typedstream.h
e976a775 160
7e268280
NP
161# Objective-C source files to compile
162OBJC_SOURCE_FILES = \
163 NXConstStr.m \
164 Object.m \
165 Protocol.m \
682e805a 166 accessors.m \
7e268280
NP
167 linking.m
168
169# C source files to compile
170C_SOURCE_FILES = \
171 archive.c \
172 class.c \
173 encoding.c \
174 error.c \
175 gc.c \
176 hash.c \
177 init.c \
fdcbbfe7 178 ivars.c \
7e268280 179 memory.c \
ad9eef11 180 methods.c \
7e268280 181 nil_method.c \
f05b9d93 182 objc-foreach.c \
fd312537 183 objc-sync.c \
7e268280 184 objects.c \
debfbfee 185 protocols.c \
7e268280
NP
186 sarray.c \
187 selector.c \
188 sendmsg.c \
189 thr.c \
190 exception.c
191
192# Object files to link (when the library is linked with no GC (Garbage Collection))
193OBJS = \
194 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
195 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
196
197# Object files to link (when the library is linked with GC (Garbage Collection))
7b869986 198OBJS_GC = \
7e268280
NP
199 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
200 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
bce1b489 201
bce1b489 202
7e268280
NP
203##
204## The rules to build
205##
bce1b489 206
7e268280
NP
207# Flags to pass to a recursive make.
208FLAGS_TO_PASS = \
209 "AR=$(AR)" \
210 "AR_FLAGS=$(AR_FLAGS)" \
211 "CC=$(CC)" \
212 "CFLAGS=$(CFLAGS)" \
213 "DESTDIR=$(DESTDIR)" \
214 "LIBCFLAGS=$(LIBCFLAGS)" \
215 "EXTRA_OFILES=$(EXTRA_OFILES)" \
216 "HDEFINES=$(HDEFINES)" \
217 "INSTALL=$(INSTALL)" \
218 "INSTALL_DATA=$(INSTALL_DATA)" \
219 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
220 "LDFLAGS=$(LDFLAGS)" \
221 "LIBTOOL=$(LIBTOOL)" \
222 "LOADLIBES=$(LOADLIBES)" \
223 "PICFLAG=$(PICFLAG)" \
224 "RANLIB=$(RANLIB)" \
225 "SHELL=$(SHELL)" \
226 "prefix=$(prefix)" \
227 "exec_prefix=$(exec_prefix)" \
228 "libdir=$(libdir)" \
229 "libsubdir=$(libsubdir)" \
230 "tooldir=$(tooldir)"
bce1b489 231
7e268280
NP
232# The 'all' rule must be the first one so that it is executed if
233# nothing is specified on the command-line.
234all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
235 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
7b869986 236
7e268280
NP
237.SUFFIXES:
238.SUFFIXES: .c .m .lo
bce1b489 239
7e268280
NP
240%.lo: %.c
241 $(LIBTOOL_COMPILE) $(CC) $< -c \
242 $(ALL_CFLAGS) $(INCLUDES) \
243 -o $@
bce1b489 244
7e268280
NP
245%_gc.lo: %.c
246 $(LIBTOOL_COMPILE) $(CC) $< -c \
247 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
248 -o $@
bce1b489 249
7e268280
NP
250%.lo: %.m
251 $(LIBTOOL_COMPILE) $(CC) $< -c \
252 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
253 -o $@
bce1b489 254
7e268280
NP
255%_gc.lo: %.m
256 $(LIBTOOL_COMPILE) $(CC) $< -c \
257 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
258 -o $@
bce1b489 259
7e268280
NP
260# sendmsg has a special rule because it depends on runtime-info.h.
261runtime-info.h:
262 echo "" > tmp-runtime.m
263 echo "/* This file is automatically generated */" > $@
264 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
265 rm -f tmp-runtime.m tmp-runtime.s
bce1b489 266
7e268280
NP
267sendmsg.lo: sendmsg.c runtime-info.h
268 $(LIBTOOL_COMPILE) $(CC) $< -c \
269 $(ALL_CFLAGS) $(INCLUDES) \
270 -o $@
bce1b489 271
7e268280
NP
272sendmsg_gc.lo: sendmsg.c runtime-info.h
273 $(LIBTOOL_COMPILE) $(CC) $< -c \
274 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
275 -o $@
bce1b489 276
7e268280
NP
277# These files have separate rules because they require special
278# compiler flags.
279archive.lo: archive.c
280 $(LIBTOOL_COMPILE) $(CC) $< -c \
281 $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
282 -o $@
bce1b489 283
7e268280
NP
284archive_gc.lo: archive.c
285 $(LIBTOOL_COMPILE) $(CC) $< -c \
286 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
287 -o $@
bce1b489 288
4470254f 289# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
c161c99b 290Object.lo: Object.m
7e268280
NP
291 $(LIBTOOL_COMPILE) $(CC) $< -c \
292 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
293 -o $@
bce1b489 294
4470254f 295# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
c161c99b 296Object_gc.lo: Object.m
7e268280
NP
297 $(LIBTOOL_COMPILE) $(CC) $< -c \
298 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
299 -o $@
bce1b489 300
e30511ed
NP
301# -Wno-deprecated-declarations is to silence warnings from using
302# _objc_unexpected_exception.
a776161b 303exception.lo: exception.c
7e268280
NP
304 $(LIBTOOL_COMPILE) $(CC) $< -c \
305 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
306 -o $@
5520b936
AM
307
308exception_gc.lo: exception.c
7e268280
NP
309 $(LIBTOOL_COMPILE) $(CC) $< -c \
310 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
311 -o $@
a776161b 312
b5422ad7 313doc: info dvi pdf html
bce1b489 314
38593123 315# No install-html or install-pdf support
a0ed5099 316.PHONY: install-html install-pdf install-info
2788992b 317install-html:
38593123 318install-pdf:
a0ed5099 319install-info:
2788992b 320
7afa92c5
JB
321LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
322
45d5f86c 323libobjc$(libsuffix).la: $(OBJS)
b150efee 324 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
608e1e0c 325 -rpath $(toolexeclibdir) \
7afa92c5
JB
326 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
327 $(LTLDFLAGS)
bce1b489 328
45d5f86c 329libobjc_gc$(libsuffix).la: $(OBJS_GC)
785fad0a 330 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
608e1e0c 331 -rpath $(toolexeclibdir) \
7afa92c5
JB
332 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
333 $(LTLDFLAGS)
bce1b489 334
10c179f3
JM
335info:
336dvi:
b5422ad7 337pdf:
10c179f3 338html:
bce1b489
BE
339
340Makefile: Makefile.in config.status
341 $(SHELL) config.status
342
343config.status: configure
344 rm -f config.cache
345 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
346 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
347
6efbd53f
RW
348AUTOCONF = autoconf
349ACLOCAL = aclocal
350ACLOCAL_AMFLAGS = -I ../config -I ..
351aclocal_deps = \
352 $(srcdir)/../config/multi.m4 \
353 $(srcdir)/../config/override.m4 \
354 $(srcdir)/../config/proginstall.m4 \
355 $(srcdir)/../ltoptions.m4 \
356 $(srcdir)/../ltsugar.m4 \
357 $(srcdir)/../ltversion.m4 \
358 $(srcdir)/../lt~obsolete.m4 \
359 $(srcdir)/acinclude.m4
360
361$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
bce1b489 362 rm -f config.cache
6efbd53f
RW
363 cd $(srcdir) && $(AUTOCONF)
364
365$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
366 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
bce1b489 367
b150efee 368install: install-libs install-headers
bce1b489
BE
369
370install-libs: installdirs
5b043f08 371 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
45d5f86c 372 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
c161c99b 373 if [ "$(OBJC_BOEHM_GC)" ]; then \
45d5f86c 374 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
608e1e0c 375 $(DESTDIR)$(toolexeclibdir);\
c161c99b 376 fi
b150efee 377 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
608e1e0c 378 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
bce1b489 379
7e268280 380# Copy Objective-C headers to installation include directory.
b150efee 381install-headers:
5b043f08 382 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
bce1b489 383 for file in $(OBJC_H); do \
789eb4f5 384 realfile=$(srcdir)/objc/$${file}; \
7d34a5a9 385 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
bce1b489 386 done
e976a775
NP
387 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
388 for file in $(OBJC_DEPRECATED_H); do \
389 realfile=$(srcdir)/objc/deprecated/$${file}; \
390 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
391 done
bce1b489
BE
392
393check uninstall install-strip dist installcheck installdirs:
394
395mostlyclean:
45d5f86c 396 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
c161c99b 397 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
b5422ad7 398 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
bce1b489
BE
399 *.toc *.tp *.vr *.html libobj.exp
400 @$(MULTICLEAN) multi-clean DO=mostlyclean
401
402clean: mostlyclean
403 rm -f config.log
404 @$(MULTICLEAN) multi-clean DO=clean
405
406distclean: clean
407 @$(MULTICLEAN) multi-clean DO=distclean
408 rm -f config.cache config.status Makefile configure
409
410maintainer-clean realclean: distclean
411
412.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
413 install-strip dist installcheck installdirs
54b2f310
DJ
414
415# Don't export variables to the environment, in order to not confuse
416# configure.
417.NOEXPORT: