]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/Makefile.in
PR middle-end/45567
[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 \
114 \
344bfd09 115 NXConstStr.h \
116 Object.h \
117 Protocol.h \
118 encoding.h \
c3a945cd 119 hash.h \
120 message.h \
121 objc-api.h \
122 objc-decls.h \
123 objc-list.h \
124 sarray.h \
344bfd09 125 thr.h \
db7e3326 126 \
c3a945cd 127 typedstream.h
265ab036 128
01eb761e 129# User-visible header files containing deprecated APIs, from the
130# objc/deprecated directory
344bfd09 131OBJC_DEPRECATED_H = \
132 MetaClass.h \
133 Object.h \
134 STR.h \
c3a945cd 135 objc_error.h \
bb882a43 136 objc_malloc.h \
344bfd09 137 objc_unexpected_exception.h \
bb882a43 138 objc_valloc.h \
344bfd09 139 struct_objc_class.h \
140 struct_objc_protocol.h \
141 struct_objc_selector.h \
142 typedstream.h
01eb761e 143
db7e3326 144# Objective-C source files to compile
145OBJC_SOURCE_FILES = \
146 NXConstStr.m \
147 Object.m \
148 Protocol.m \
149 linking.m
150
151# C source files to compile
152C_SOURCE_FILES = \
153 archive.c \
154 class.c \
155 encoding.c \
156 error.c \
157 gc.c \
158 hash.c \
159 init.c \
160 memory.c \
161 nil_method.c \
162 objects.c \
163 sarray.c \
164 selector.c \
165 sendmsg.c \
166 thr.c \
167 exception.c
168
169# Object files to link (when the library is linked with no GC (Garbage Collection))
170OBJS = \
171 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
172 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
173
174# Object files to link (when the library is linked with GC (Garbage Collection))
c3a945cd 175OBJS_GC = \
db7e3326 176 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
177 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
265ab036 178
265ab036 179
db7e3326 180##
181## The rules to build
182##
265ab036 183
db7e3326 184# Flags to pass to a recursive make.
185FLAGS_TO_PASS = \
186 "AR=$(AR)" \
187 "AR_FLAGS=$(AR_FLAGS)" \
188 "CC=$(CC)" \
189 "CFLAGS=$(CFLAGS)" \
190 "DESTDIR=$(DESTDIR)" \
191 "LIBCFLAGS=$(LIBCFLAGS)" \
192 "EXTRA_OFILES=$(EXTRA_OFILES)" \
193 "HDEFINES=$(HDEFINES)" \
194 "INSTALL=$(INSTALL)" \
195 "INSTALL_DATA=$(INSTALL_DATA)" \
196 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
197 "LDFLAGS=$(LDFLAGS)" \
198 "LIBTOOL=$(LIBTOOL)" \
199 "LOADLIBES=$(LOADLIBES)" \
200 "PICFLAG=$(PICFLAG)" \
201 "RANLIB=$(RANLIB)" \
202 "SHELL=$(SHELL)" \
203 "prefix=$(prefix)" \
204 "exec_prefix=$(exec_prefix)" \
205 "libdir=$(libdir)" \
206 "libsubdir=$(libsubdir)" \
207 "tooldir=$(tooldir)"
265ab036 208
db7e3326 209# The 'all' rule must be the first one so that it is executed if
210# nothing is specified on the command-line.
211all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
212 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
c3a945cd 213
db7e3326 214.SUFFIXES:
215.SUFFIXES: .c .m .lo
265ab036 216
db7e3326 217%.lo: %.c
218 $(LIBTOOL_COMPILE) $(CC) $< -c \
219 $(ALL_CFLAGS) $(INCLUDES) \
220 -o $@
265ab036 221
db7e3326 222%_gc.lo: %.c
223 $(LIBTOOL_COMPILE) $(CC) $< -c \
224 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
225 -o $@
265ab036 226
db7e3326 227%.lo: %.m
228 $(LIBTOOL_COMPILE) $(CC) $< -c \
229 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
230 -o $@
265ab036 231
db7e3326 232%_gc.lo: %.m
233 $(LIBTOOL_COMPILE) $(CC) $< -c \
234 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
235 -o $@
265ab036 236
db7e3326 237# sendmsg has a special rule because it depends on runtime-info.h.
238runtime-info.h:
239 echo "" > tmp-runtime.m
240 echo "/* This file is automatically generated */" > $@
241 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
242 rm -f tmp-runtime.m tmp-runtime.s
265ab036 243
db7e3326 244sendmsg.lo: sendmsg.c runtime-info.h
245 $(LIBTOOL_COMPILE) $(CC) $< -c \
246 $(ALL_CFLAGS) $(INCLUDES) \
247 -o $@
265ab036 248
db7e3326 249sendmsg_gc.lo: sendmsg.c runtime-info.h
250 $(LIBTOOL_COMPILE) $(CC) $< -c \
251 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
252 -o $@
265ab036 253
db7e3326 254# These files have separate rules because they require special
255# compiler flags.
256archive.lo: archive.c
257 $(LIBTOOL_COMPILE) $(CC) $< -c \
258 $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
259 -o $@
265ab036 260
db7e3326 261archive_gc.lo: archive.c
262 $(LIBTOOL_COMPILE) $(CC) $< -c \
263 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
264 -o $@
265ab036 265
aaba593f 266# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
0f72a548 267Object.lo: Object.m
db7e3326 268 $(LIBTOOL_COMPILE) $(CC) $< -c \
269 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
270 -o $@
265ab036 271
aaba593f 272# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
0f72a548 273Object_gc.lo: Object.m
db7e3326 274 $(LIBTOOL_COMPILE) $(CC) $< -c \
275 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
276 -o $@
265ab036 277
a5974a58 278# -Wno-deprecated-declarations is to silence warnings from using
279# _objc_unexpected_exception.
2c5cfd29 280exception.lo: exception.c
db7e3326 281 $(LIBTOOL_COMPILE) $(CC) $< -c \
282 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
283 -o $@
98fde024 284
285exception_gc.lo: exception.c
db7e3326 286 $(LIBTOOL_COMPILE) $(CC) $< -c \
287 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
288 -o $@
2c5cfd29 289
51f93521 290doc: info dvi pdf html
265ab036 291
cbb90fc8 292# No install-html or install-pdf support
e0f44d87 293.PHONY: install-html install-pdf install-info
ba0c10ab 294install-html:
cbb90fc8 295install-pdf:
e0f44d87 296install-info:
ba0c10ab 297
ac051731 298LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
299
f90c9f0e 300libobjc$(libsuffix).la: $(OBJS)
6ed57656 301 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
7fc7cb73 302 -rpath $(toolexeclibdir) \
ac051731 303 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
304 $(LTLDFLAGS)
265ab036 305
f90c9f0e 306libobjc_gc$(libsuffix).la: $(OBJS_GC)
7170e5e2 307 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
7fc7cb73 308 -rpath $(toolexeclibdir) \
ac051731 309 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
310 $(LTLDFLAGS)
265ab036 311
6b515411 312info:
313dvi:
51f93521 314pdf:
6b515411 315html:
265ab036 316
317Makefile: Makefile.in config.status
318 $(SHELL) config.status
319
320config.status: configure
321 rm -f config.cache
322 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
323 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
324
a2655af1 325AUTOCONF = autoconf
326ACLOCAL = aclocal
327ACLOCAL_AMFLAGS = -I ../config -I ..
328aclocal_deps = \
329 $(srcdir)/../config/multi.m4 \
330 $(srcdir)/../config/override.m4 \
331 $(srcdir)/../config/proginstall.m4 \
332 $(srcdir)/../ltoptions.m4 \
333 $(srcdir)/../ltsugar.m4 \
334 $(srcdir)/../ltversion.m4 \
335 $(srcdir)/../lt~obsolete.m4 \
336 $(srcdir)/acinclude.m4
337
338$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
265ab036 339 rm -f config.cache
a2655af1 340 cd $(srcdir) && $(AUTOCONF)
341
342$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
343 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
265ab036 344
6ed57656 345install: install-libs install-headers
265ab036 346
347install-libs: installdirs
ff434425 348 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
f90c9f0e 349 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
0f72a548 350 if [ "$(OBJC_BOEHM_GC)" ]; then \
f90c9f0e 351 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
7fc7cb73 352 $(DESTDIR)$(toolexeclibdir);\
0f72a548 353 fi
6ed57656 354 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
7fc7cb73 355 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
265ab036 356
db7e3326 357# Copy Objective-C headers to installation include directory.
6ed57656 358install-headers:
ff434425 359 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
265ab036 360 for file in $(OBJC_H); do \
3c3646e7 361 realfile=$(srcdir)/objc/$${file}; \
ce716239 362 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
265ab036 363 done
01eb761e 364 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
365 for file in $(OBJC_DEPRECATED_H); do \
366 realfile=$(srcdir)/objc/deprecated/$${file}; \
367 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
368 done
265ab036 369
370check uninstall install-strip dist installcheck installdirs:
371
372mostlyclean:
f90c9f0e 373 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
0f72a548 374 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
51f93521 375 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
265ab036 376 *.toc *.tp *.vr *.html libobj.exp
377 @$(MULTICLEAN) multi-clean DO=mostlyclean
378
379clean: mostlyclean
380 rm -f config.log
381 @$(MULTICLEAN) multi-clean DO=clean
382
383distclean: clean
384 @$(MULTICLEAN) multi-clean DO=distclean
385 rm -f config.cache config.status Makefile configure
386
387maintainer-clean realclean: distclean
388
389.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
390 install-strip dist installcheck installdirs
428b4753 391
392# Don't export variables to the environment, in order to not confuse
393# configure.
394.NOEXPORT: