]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/Makefile.in
Remove freebsd1 from libtool.m4 macros and config.rpath.
[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
8c3e5222 96OBJC_GCFLAGS=-DOBJC_WITH_GC=1
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 \
3d0d8739 125 thr.h \
7e268280 126 \
349cfd93
NP
127 hash.h \
128 objc-list.h \
5d3b14bd 129 sarray.h \
7b869986 130 typedstream.h
bce1b489 131
e976a775
NP
132# User-visible header files containing deprecated APIs, from the
133# objc/deprecated directory
3d0d8739 134OBJC_DEPRECATED_H = \
cf3822f1 135 METHOD_NULL.h \
3d0d8739
NP
136 MetaClass.h \
137 Object.h \
c06a8664 138 Protocol.h \
3d0d8739 139 STR.h \
5be9cdc1
NP
140 hash.h \
141 objc-list.h \
7b869986 142 objc_error.h \
b0453850 143 objc_get_uninstalled_dtable.h \
d1be5d82 144 objc_malloc.h \
5ec582f9 145 objc_msg_sendv.h \
b0453850 146 objc_object_alloc.h \
3d0d8739 147 objc_unexpected_exception.h \
d1be5d82 148 objc_valloc.h \
5d3b14bd 149 sarray.h \
2461ab4b 150 struct_objc_category.h \
3d0d8739 151 struct_objc_class.h \
2461ab4b
NP
152 struct_objc_ivar.h \
153 struct_objc_ivar_list.h \
154 struct_objc_method.h \
155 struct_objc_method_list.h \
156 struct_objc_module.h \
3d0d8739 157 struct_objc_protocol.h \
2461ab4b 158 struct_objc_protocol_list.h \
3d0d8739 159 struct_objc_selector.h \
b0453850 160 struct_objc_static_instances.h \
2461ab4b 161 struct_objc_symtab.h \
3d0d8739 162 typedstream.h
e976a775 163
7e268280
NP
164# Objective-C source files to compile
165OBJC_SOURCE_FILES = \
166 NXConstStr.m \
167 Object.m \
168 Protocol.m \
682e805a 169 accessors.m \
7e268280
NP
170 linking.m
171
172# C source files to compile
173C_SOURCE_FILES = \
174 archive.c \
175 class.c \
176 encoding.c \
177 error.c \
178 gc.c \
179 hash.c \
180 init.c \
fdcbbfe7 181 ivars.c \
7e268280 182 memory.c \
ad9eef11 183 methods.c \
7e268280 184 nil_method.c \
f05b9d93 185 objc-foreach.c \
fd312537 186 objc-sync.c \
7e268280 187 objects.c \
debfbfee 188 protocols.c \
7e268280
NP
189 sarray.c \
190 selector.c \
191 sendmsg.c \
192 thr.c \
193 exception.c
194
195# Object files to link (when the library is linked with no GC (Garbage Collection))
196OBJS = \
197 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
198 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
199
200# Object files to link (when the library is linked with GC (Garbage Collection))
7b869986 201OBJS_GC = \
7e268280
NP
202 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
203 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
bce1b489 204
bce1b489 205
7e268280
NP
206##
207## The rules to build
208##
bce1b489 209
7e268280
NP
210# Flags to pass to a recursive make.
211FLAGS_TO_PASS = \
212 "AR=$(AR)" \
213 "AR_FLAGS=$(AR_FLAGS)" \
214 "CC=$(CC)" \
215 "CFLAGS=$(CFLAGS)" \
216 "DESTDIR=$(DESTDIR)" \
217 "LIBCFLAGS=$(LIBCFLAGS)" \
218 "EXTRA_OFILES=$(EXTRA_OFILES)" \
219 "HDEFINES=$(HDEFINES)" \
220 "INSTALL=$(INSTALL)" \
221 "INSTALL_DATA=$(INSTALL_DATA)" \
222 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
223 "LDFLAGS=$(LDFLAGS)" \
224 "LIBTOOL=$(LIBTOOL)" \
225 "LOADLIBES=$(LOADLIBES)" \
226 "PICFLAG=$(PICFLAG)" \
227 "RANLIB=$(RANLIB)" \
228 "SHELL=$(SHELL)" \
229 "prefix=$(prefix)" \
230 "exec_prefix=$(exec_prefix)" \
231 "libdir=$(libdir)" \
232 "libsubdir=$(libsubdir)" \
233 "tooldir=$(tooldir)"
bce1b489 234
7e268280
NP
235# The 'all' rule must be the first one so that it is executed if
236# nothing is specified on the command-line.
237all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
238 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
7b869986 239
7e268280
NP
240.SUFFIXES:
241.SUFFIXES: .c .m .lo
bce1b489 242
7e268280
NP
243%.lo: %.c
244 $(LIBTOOL_COMPILE) $(CC) $< -c \
245 $(ALL_CFLAGS) $(INCLUDES) \
246 -o $@
bce1b489 247
7e268280
NP
248%_gc.lo: %.c
249 $(LIBTOOL_COMPILE) $(CC) $< -c \
250 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
251 -o $@
bce1b489 252
7e268280
NP
253%.lo: %.m
254 $(LIBTOOL_COMPILE) $(CC) $< -c \
255 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
256 -o $@
bce1b489 257
7e268280
NP
258%_gc.lo: %.m
259 $(LIBTOOL_COMPILE) $(CC) $< -c \
260 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
261 -o $@
bce1b489 262
7e268280
NP
263# sendmsg has a special rule because it depends on runtime-info.h.
264runtime-info.h:
265 echo "" > tmp-runtime.m
266 echo "/* This file is automatically generated */" > $@
267 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
268 rm -f tmp-runtime.m tmp-runtime.s
bce1b489 269
7e268280
NP
270sendmsg.lo: sendmsg.c runtime-info.h
271 $(LIBTOOL_COMPILE) $(CC) $< -c \
272 $(ALL_CFLAGS) $(INCLUDES) \
273 -o $@
bce1b489 274
7e268280
NP
275sendmsg_gc.lo: sendmsg.c runtime-info.h
276 $(LIBTOOL_COMPILE) $(CC) $< -c \
277 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
278 -o $@
bce1b489 279
7e268280
NP
280# These files have separate rules because they require special
281# compiler flags.
282archive.lo: archive.c
283 $(LIBTOOL_COMPILE) $(CC) $< -c \
284 $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
285 -o $@
bce1b489 286
7e268280
NP
287archive_gc.lo: archive.c
288 $(LIBTOOL_COMPILE) $(CC) $< -c \
289 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
290 -o $@
bce1b489 291
4470254f 292# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
c161c99b 293Object.lo: Object.m
7e268280
NP
294 $(LIBTOOL_COMPILE) $(CC) $< -c \
295 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
296 -o $@
bce1b489 297
4470254f 298# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
c161c99b 299Object_gc.lo: Object.m
7e268280
NP
300 $(LIBTOOL_COMPILE) $(CC) $< -c \
301 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
302 -o $@
bce1b489 303
e30511ed
NP
304# -Wno-deprecated-declarations is to silence warnings from using
305# _objc_unexpected_exception.
a776161b 306exception.lo: exception.c
7e268280
NP
307 $(LIBTOOL_COMPILE) $(CC) $< -c \
308 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
309 -o $@
5520b936
AM
310
311exception_gc.lo: exception.c
7e268280
NP
312 $(LIBTOOL_COMPILE) $(CC) $< -c \
313 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
314 -o $@
a776161b 315
b5422ad7 316doc: info dvi pdf html
bce1b489 317
38593123 318# No install-html or install-pdf support
a0ed5099 319.PHONY: install-html install-pdf install-info
2788992b 320install-html:
38593123 321install-pdf:
a0ed5099 322install-info:
2788992b 323
7afa92c5
JB
324LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
325
45d5f86c 326libobjc$(libsuffix).la: $(OBJS)
b150efee 327 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
1d439e6c 328 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
7afa92c5
JB
329 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
330 $(LTLDFLAGS)
bce1b489 331
45d5f86c 332libobjc_gc$(libsuffix).la: $(OBJS_GC)
785fad0a 333 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
1d439e6c 334 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
7afa92c5
JB
335 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
336 $(LTLDFLAGS)
bce1b489 337
10c179f3
JM
338info:
339dvi:
b5422ad7 340pdf:
10c179f3 341html:
bce1b489
BE
342
343Makefile: Makefile.in config.status
344 $(SHELL) config.status
345
346config.status: configure
347 rm -f config.cache
348 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
349 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
350
6efbd53f
RW
351AUTOCONF = autoconf
352ACLOCAL = aclocal
353ACLOCAL_AMFLAGS = -I ../config -I ..
354aclocal_deps = \
355 $(srcdir)/../config/multi.m4 \
356 $(srcdir)/../config/override.m4 \
357 $(srcdir)/../config/proginstall.m4 \
358 $(srcdir)/../ltoptions.m4 \
359 $(srcdir)/../ltsugar.m4 \
360 $(srcdir)/../ltversion.m4 \
361 $(srcdir)/../lt~obsolete.m4 \
362 $(srcdir)/acinclude.m4
363
364$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
bce1b489 365 rm -f config.cache
6efbd53f
RW
366 cd $(srcdir) && $(AUTOCONF)
367
368$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
369 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
bce1b489 370
b150efee 371install: install-libs install-headers
bce1b489
BE
372
373install-libs: installdirs
5b043f08 374 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
45d5f86c 375 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
c161c99b 376 if [ "$(OBJC_BOEHM_GC)" ]; then \
45d5f86c 377 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
608e1e0c 378 $(DESTDIR)$(toolexeclibdir);\
c161c99b 379 fi
b150efee 380 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
608e1e0c 381 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
bce1b489 382
7e268280 383# Copy Objective-C headers to installation include directory.
b150efee 384install-headers:
5b043f08 385 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
bce1b489 386 for file in $(OBJC_H); do \
789eb4f5 387 realfile=$(srcdir)/objc/$${file}; \
7d34a5a9 388 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
bce1b489 389 done
e976a775
NP
390 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
391 for file in $(OBJC_DEPRECATED_H); do \
392 realfile=$(srcdir)/objc/deprecated/$${file}; \
393 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
394 done
bce1b489
BE
395
396check uninstall install-strip dist installcheck installdirs:
397
398mostlyclean:
45d5f86c 399 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
c161c99b 400 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
b5422ad7 401 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
bce1b489
BE
402 *.toc *.tp *.vr *.html libobj.exp
403 @$(MULTICLEAN) multi-clean DO=mostlyclean
404
405clean: mostlyclean
406 rm -f config.log
407 @$(MULTICLEAN) multi-clean DO=clean
408
409distclean: clean
410 @$(MULTICLEAN) multi-clean DO=distclean
411 rm -f config.cache config.status Makefile configure
412
413maintainer-clean realclean: distclean
414
415.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
416 install-strip dist installcheck installdirs
54b2f310
DJ
417
418# Don't export variables to the environment, in order to not confuse
419# configure.
420.NOEXPORT: