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