]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/Makefile.in
In libobjc/:
[thirdparty/gcc.git] / libobjc / Makefile.in
CommitLineData
61a0eea4 1# Makefile for GNU Objective C runtime library.
e23e7a91 2# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
6bc9506f 3# 2005, 2006, 2007, 2008, 2009 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 25SHELL = @SHELL@
6ed57656 26MAKEOVERRIDES=
265ab036 27
28#### Start of system configuration section. ####
29
6ed57656 30srcdir = @glibcpp_srcdir@
31VPATH = @glibcpp_srcdir@
265ab036 32prefix = @prefix@
33exec_prefix = @exec_prefix@
9c4e05bc 34target_noncanonical = @target_noncanonical@
32ee7eb8 35gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
c1eb9e31 36host_subdir = @host_subdir@
6ed57656 37top_srcdir = @top_srcdir@
ff434425 38multi_basedir = @multi_basedir@
57a4c641 39toolexecdir = @toolexecdir@
85fe910a 40# Toolexecdir is used only by toolexeclibdir
7fc7cb73 41toolexeclibdir = @toolexeclibdir@
6ed57656 42
ce716239 43includedirname = @includedirname@
f90c9f0e 44libsuffix = @libsuffix@
166e6519 45
a16ff609 46extra_ldflags_libobjc = @extra_ldflags_libobjc@
47
6ed57656 48top_builddir = .
265ab036 49
cec41e68 50-include ../boehm-gc/threads.mk
7170e5e2 51
265ab036 52libdir = $(exec_prefix)/lib
9c4e05bc 53libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
265ab036 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@
c86bfe45 77WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
c86bfe45 78ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(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 86LIBOBJC_VERSION = @VERSION@
87LIBOBJC_GC_VERSION = @VERSION@
60598a3a 88LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
0f72a548 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
e23e7a91 95OBJC_GCFLAGS=-DOBJC_WITH_GC=1
e23e7a91 96OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
97OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
7170e5e2 98OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
e23e7a91 99
db7e3326 100INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
c1eb9e31 101 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
102 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
e23e7a91 103 -I$(srcdir)/$(MULTISRCTOP)../include \
104 $(OBJC_BOEHM_GC_INCLUDES)
265ab036 105
db7e3326 106##
107## The list of header/source files
108##
265ab036 109
01eb761e 110# User-visible header files, from the objc/ directory
344bfd09 111OBJC_H = \
112 objc.h \
113 objc-exception.h \
a2a8dcb1 114 objc-sync.h \
344bfd09 115 \
344bfd09 116 NXConstStr.h \
117 Object.h \
118 Protocol.h \
119 encoding.h \
c3a945cd 120 message.h \
121 objc-api.h \
122 objc-decls.h \
0a65c3bb 123 runtime.h \
344bfd09 124 thr.h \
db7e3326 125 \
41c3fcad 126 hash.h \
127 objc-list.h \
54d533d3 128 sarray.h \
c3a945cd 129 typedstream.h
265ab036 130
01eb761e 131# User-visible header files containing deprecated APIs, from the
132# objc/deprecated directory
344bfd09 133OBJC_DEPRECATED_H = \
83b8166b 134 METHOD_NULL.h \
344bfd09 135 MetaClass.h \
136 Object.h \
137 STR.h \
1a46e3f1 138 hash.h \
139 objc-list.h \
c3a945cd 140 objc_error.h \
bb882a43 141 objc_malloc.h \
344bfd09 142 objc_unexpected_exception.h \
bb882a43 143 objc_valloc.h \
54d533d3 144 sarray.h \
011c3116 145 struct_objc_category.h \
344bfd09 146 struct_objc_class.h \
011c3116 147 struct_objc_ivar.h \
148 struct_objc_ivar_list.h \
149 struct_objc_method.h \
150 struct_objc_method_list.h \
151 struct_objc_module.h \
344bfd09 152 struct_objc_protocol.h \
011c3116 153 struct_objc_protocol_list.h \
344bfd09 154 struct_objc_selector.h \
011c3116 155 struct_objc_symtab.h \
344bfd09 156 typedstream.h
01eb761e 157
db7e3326 158# Objective-C source files to compile
159OBJC_SOURCE_FILES = \
160 NXConstStr.m \
161 Object.m \
162 Protocol.m \
163 linking.m
164
165# C source files to compile
166C_SOURCE_FILES = \
167 archive.c \
168 class.c \
169 encoding.c \
170 error.c \
171 gc.c \
172 hash.c \
173 init.c \
631bc351 174 ivars.c \
db7e3326 175 memory.c \
176 nil_method.c \
0a65c3bb 177 objc-foreach.c \
a2a8dcb1 178 objc-sync.c \
db7e3326 179 objects.c \
180 sarray.c \
181 selector.c \
182 sendmsg.c \
183 thr.c \
184 exception.c
185
186# Object files to link (when the library is linked with no GC (Garbage Collection))
187OBJS = \
188 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
189 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
190
191# Object files to link (when the library is linked with GC (Garbage Collection))
c3a945cd 192OBJS_GC = \
db7e3326 193 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
194 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
265ab036 195
265ab036 196
db7e3326 197##
198## The rules to build
199##
265ab036 200
db7e3326 201# Flags to pass to a recursive make.
202FLAGS_TO_PASS = \
203 "AR=$(AR)" \
204 "AR_FLAGS=$(AR_FLAGS)" \
205 "CC=$(CC)" \
206 "CFLAGS=$(CFLAGS)" \
207 "DESTDIR=$(DESTDIR)" \
208 "LIBCFLAGS=$(LIBCFLAGS)" \
209 "EXTRA_OFILES=$(EXTRA_OFILES)" \
210 "HDEFINES=$(HDEFINES)" \
211 "INSTALL=$(INSTALL)" \
212 "INSTALL_DATA=$(INSTALL_DATA)" \
213 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
214 "LDFLAGS=$(LDFLAGS)" \
215 "LIBTOOL=$(LIBTOOL)" \
216 "LOADLIBES=$(LOADLIBES)" \
217 "PICFLAG=$(PICFLAG)" \
218 "RANLIB=$(RANLIB)" \
219 "SHELL=$(SHELL)" \
220 "prefix=$(prefix)" \
221 "exec_prefix=$(exec_prefix)" \
222 "libdir=$(libdir)" \
223 "libsubdir=$(libsubdir)" \
224 "tooldir=$(tooldir)"
265ab036 225
db7e3326 226# The 'all' rule must be the first one so that it is executed if
227# nothing is specified on the command-line.
228all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
229 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
c3a945cd 230
db7e3326 231.SUFFIXES:
232.SUFFIXES: .c .m .lo
265ab036 233
db7e3326 234%.lo: %.c
235 $(LIBTOOL_COMPILE) $(CC) $< -c \
236 $(ALL_CFLAGS) $(INCLUDES) \
237 -o $@
265ab036 238
db7e3326 239%_gc.lo: %.c
240 $(LIBTOOL_COMPILE) $(CC) $< -c \
241 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
242 -o $@
265ab036 243
db7e3326 244%.lo: %.m
245 $(LIBTOOL_COMPILE) $(CC) $< -c \
246 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
247 -o $@
265ab036 248
db7e3326 249%_gc.lo: %.m
250 $(LIBTOOL_COMPILE) $(CC) $< -c \
251 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
252 -o $@
265ab036 253
db7e3326 254# sendmsg has a special rule because it depends on runtime-info.h.
255runtime-info.h:
256 echo "" > tmp-runtime.m
257 echo "/* This file is automatically generated */" > $@
258 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
259 rm -f tmp-runtime.m tmp-runtime.s
265ab036 260
db7e3326 261sendmsg.lo: sendmsg.c runtime-info.h
262 $(LIBTOOL_COMPILE) $(CC) $< -c \
263 $(ALL_CFLAGS) $(INCLUDES) \
264 -o $@
265ab036 265
db7e3326 266sendmsg_gc.lo: sendmsg.c runtime-info.h
267 $(LIBTOOL_COMPILE) $(CC) $< -c \
268 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
269 -o $@
265ab036 270
db7e3326 271# These files have separate rules because they require special
272# compiler flags.
273archive.lo: archive.c
274 $(LIBTOOL_COMPILE) $(CC) $< -c \
275 $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
276 -o $@
265ab036 277
db7e3326 278archive_gc.lo: archive.c
279 $(LIBTOOL_COMPILE) $(CC) $< -c \
280 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
281 -o $@
265ab036 282
aaba593f 283# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
0f72a548 284Object.lo: Object.m
db7e3326 285 $(LIBTOOL_COMPILE) $(CC) $< -c \
286 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
287 -o $@
265ab036 288
aaba593f 289# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
0f72a548 290Object_gc.lo: Object.m
db7e3326 291 $(LIBTOOL_COMPILE) $(CC) $< -c \
292 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
293 -o $@
265ab036 294
a5974a58 295# -Wno-deprecated-declarations is to silence warnings from using
296# _objc_unexpected_exception.
2c5cfd29 297exception.lo: exception.c
db7e3326 298 $(LIBTOOL_COMPILE) $(CC) $< -c \
299 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
300 -o $@
98fde024 301
302exception_gc.lo: exception.c
db7e3326 303 $(LIBTOOL_COMPILE) $(CC) $< -c \
304 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
305 -o $@
2c5cfd29 306
51f93521 307doc: info dvi pdf html
265ab036 308
cbb90fc8 309# No install-html or install-pdf support
e0f44d87 310.PHONY: install-html install-pdf install-info
ba0c10ab 311install-html:
cbb90fc8 312install-pdf:
e0f44d87 313install-info:
ba0c10ab 314
ac051731 315LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
316
f90c9f0e 317libobjc$(libsuffix).la: $(OBJS)
6ed57656 318 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
7fc7cb73 319 -rpath $(toolexeclibdir) \
ac051731 320 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
321 $(LTLDFLAGS)
265ab036 322
f90c9f0e 323libobjc_gc$(libsuffix).la: $(OBJS_GC)
7170e5e2 324 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
7fc7cb73 325 -rpath $(toolexeclibdir) \
ac051731 326 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
327 $(LTLDFLAGS)
265ab036 328
6b515411 329info:
330dvi:
51f93521 331pdf:
6b515411 332html:
265ab036 333
334Makefile: Makefile.in config.status
335 $(SHELL) config.status
336
337config.status: configure
338 rm -f config.cache
339 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
340 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
341
a2655af1 342AUTOCONF = autoconf
343ACLOCAL = aclocal
344ACLOCAL_AMFLAGS = -I ../config -I ..
345aclocal_deps = \
346 $(srcdir)/../config/multi.m4 \
347 $(srcdir)/../config/override.m4 \
348 $(srcdir)/../config/proginstall.m4 \
349 $(srcdir)/../ltoptions.m4 \
350 $(srcdir)/../ltsugar.m4 \
351 $(srcdir)/../ltversion.m4 \
352 $(srcdir)/../lt~obsolete.m4 \
353 $(srcdir)/acinclude.m4
354
355$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
265ab036 356 rm -f config.cache
a2655af1 357 cd $(srcdir) && $(AUTOCONF)
358
359$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
360 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
265ab036 361
6ed57656 362install: install-libs install-headers
265ab036 363
364install-libs: installdirs
ff434425 365 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
f90c9f0e 366 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
0f72a548 367 if [ "$(OBJC_BOEHM_GC)" ]; then \
f90c9f0e 368 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
7fc7cb73 369 $(DESTDIR)$(toolexeclibdir);\
0f72a548 370 fi
6ed57656 371 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
7fc7cb73 372 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
265ab036 373
db7e3326 374# Copy Objective-C headers to installation include directory.
6ed57656 375install-headers:
ff434425 376 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
265ab036 377 for file in $(OBJC_H); do \
3c3646e7 378 realfile=$(srcdir)/objc/$${file}; \
ce716239 379 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
265ab036 380 done
01eb761e 381 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
382 for file in $(OBJC_DEPRECATED_H); do \
383 realfile=$(srcdir)/objc/deprecated/$${file}; \
384 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
385 done
265ab036 386
387check uninstall install-strip dist installcheck installdirs:
388
389mostlyclean:
f90c9f0e 390 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
0f72a548 391 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
51f93521 392 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
265ab036 393 *.toc *.tp *.vr *.html libobj.exp
394 @$(MULTICLEAN) multi-clean DO=mostlyclean
395
396clean: mostlyclean
397 rm -f config.log
398 @$(MULTICLEAN) multi-clean DO=clean
399
400distclean: clean
401 @$(MULTICLEAN) multi-clean DO=distclean
402 rm -f config.cache config.status Makefile configure
403
404maintainer-clean realclean: distclean
405
406.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
407 install-strip dist installcheck installdirs
428b4753 408
409# Don't export variables to the environment, in order to not confuse
410# configure.
411.NOEXPORT: