1 # Makefile for GNU Objective C runtime library.
2 # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 #This file is part of GCC.
7 #GCC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 3, or (at your option)
12 #GCC is distributed in the hope that it will be useful,
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.
17 #You should have received a copy of the GNU General Public License
18 #along with GCC; see the file COPYING3. If not see
19 #<http://www.gnu.org/licenses/>.
21 #This was cribbed from the libchill, libiberty and libstdc++
22 #Makefile.in files. Some of this stuff may be unnecessary and
28 #### Start of system configuration section. ####
30 srcdir = @glibcpp_srcdir@
31 VPATH = @glibcpp_srcdir@
33 exec_prefix = @exec_prefix@
34 target_noncanonical = @target_noncanonical@
35 gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
36 host_subdir = @host_subdir@
37 top_srcdir = @top_srcdir@
38 multi_basedir = @multi_basedir@
39 toolexecdir = @toolexecdir@
40 # Toolexecdir is used only by toolexeclibdir
41 toolexeclibdir = @toolexeclibdir@
43 includedirname = @includedirname@
44 libsuffix = @libsuffix@
46 lt_host_flags = @lt_host_flags@
47 extra_ldflags_libobjc = @extra_ldflags_libobjc@
51 -include ../boehm-gc/threads.mk
53 libdir = $(exec_prefix)/lib
54 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
56 # Multilib support variables.
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
68 INSTALL_PROGRAM = @INSTALL_PROGRAM@
69 INSTALL_DATA = @INSTALL_DATA@
78 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
79 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
80 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
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
87 LIBOBJC_VERSION = @VERSION@
88 LIBOBJC_GC_VERSION = @VERSION@
89 LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
90 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
91 LIBTOOL_LINK = $(LIBTOOL) --mode=link
92 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
93 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
94 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
96 OBJC_GCFLAGS=@OBJC_GCFLAGS@
97 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
98 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
99 OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
101 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
102 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
103 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
104 -I$(srcdir)/$(MULTISRCTOP)../include \
105 $(OBJC_BOEHM_GC_INCLUDES)
108 ## The list of header/source files
111 # User-visible header files, from the objc/ directory
130 # User-visible header files containing deprecated APIs, from the
131 # objc/deprecated directory
132 OBJC_DEPRECATED_H = \
139 objc_get_uninstalled_dtable.h \
142 objc_object_alloc.h \
143 objc_unexpected_exception.h \
146 struct_objc_category.h \
147 struct_objc_class.h \
149 struct_objc_ivar_list.h \
150 struct_objc_method.h \
151 struct_objc_method_list.h \
152 struct_objc_module.h \
153 struct_objc_protocol.h \
154 struct_objc_protocol_list.h \
155 struct_objc_selector.h \
156 struct_objc_static_instances.h \
159 # Objective-C source files to compile
160 OBJC_SOURCE_FILES = \
167 # C source files to compile
189 # Object files to link (when the library is linked with no GC (Garbage Collection))
191 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
192 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
194 # Object files to link (when the library is linked with GC (Garbage Collection))
196 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
197 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
201 ## The rules to build
204 # Flags to pass to a recursive make.
207 "AR_FLAGS=$(AR_FLAGS)" \
210 "DESTDIR=$(DESTDIR)" \
211 "LIBCFLAGS=$(LIBCFLAGS)" \
212 "EXTRA_OFILES=$(EXTRA_OFILES)" \
213 "HDEFINES=$(HDEFINES)" \
214 "INSTALL=$(INSTALL)" \
215 "INSTALL_DATA=$(INSTALL_DATA)" \
216 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
217 "LDFLAGS=$(LDFLAGS)" \
218 "LIBTOOL=$(LIBTOOL)" \
219 "LOADLIBES=$(LOADLIBES)" \
220 "PICFLAG=$(PICFLAG)" \
224 "exec_prefix=$(exec_prefix)" \
226 "libsubdir=$(libsubdir)" \
229 # The 'all' rule must be the first one so that it is executed if
230 # nothing is specified on the command-line.
231 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
232 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
238 $(LIBTOOL_COMPILE) $(CC) $< -c \
239 $(ALL_CFLAGS) $(INCLUDES) \
243 $(LIBTOOL_COMPILE) $(CC) $< -c \
244 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
248 $(LIBTOOL_COMPILE) $(CC) $< -c \
249 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
253 $(LIBTOOL_COMPILE) $(CC) $< -c \
254 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
257 # sendmsg has a special rule because it depends on runtime-info.h.
259 echo "" > tmp-runtime.m
260 echo "/* This file is automatically generated */" > $@
261 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
262 rm -f tmp-runtime.m tmp-runtime.s
264 sendmsg.lo: sendmsg.c runtime-info.h
265 $(LIBTOOL_COMPILE) $(CC) $< -c \
266 $(ALL_CFLAGS) $(INCLUDES) \
269 sendmsg_gc.lo: sendmsg.c runtime-info.h
270 $(LIBTOOL_COMPILE) $(CC) $< -c \
271 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
274 # These files have separate rules because they require special
277 # -Wno-deprecated-declarations is to silence warnings from using
278 # _objc_unexpected_exception.
279 exception.lo: exception.c
280 $(LIBTOOL_COMPILE) $(CC) $< -c \
281 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
284 exception_gc.lo: exception.c
285 $(LIBTOOL_COMPILE) $(CC) $< -c \
286 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
289 doc: info dvi pdf html
291 # No install-html or install-pdf support
292 .PHONY: install-html install-pdf install-info
297 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
299 libobjc$(libsuffix).la: $(OBJS)
300 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
301 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
302 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
305 libobjc_gc$(libsuffix).la: $(OBJS_GC)
306 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
307 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
308 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
316 Makefile: Makefile.in config.status
317 $(SHELL) config.status
319 config.status: configure
321 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
322 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
326 ACLOCAL_AMFLAGS = -I ../config -I ..
328 $(srcdir)/../config/multi.m4 \
329 $(srcdir)/../config/override.m4 \
330 $(srcdir)/../config/proginstall.m4 \
331 $(srcdir)/../ltoptions.m4 \
332 $(srcdir)/../ltsugar.m4 \
333 $(srcdir)/../ltversion.m4 \
334 $(srcdir)/../lt~obsolete.m4 \
335 $(srcdir)/acinclude.m4
337 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
339 cd $(srcdir) && $(AUTOCONF)
341 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
342 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
344 install: install-libs install-headers
346 install-libs: installdirs
347 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
348 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
349 if [ "$(OBJC_BOEHM_GC)" ]; then \
350 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
351 $(DESTDIR)$(toolexeclibdir);\
353 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
354 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
356 # Copy Objective-C headers to installation include directory.
358 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
359 for file in $(OBJC_H); do \
360 realfile=$(srcdir)/objc/$${file}; \
361 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
363 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
364 for file in $(OBJC_DEPRECATED_H); do \
365 realfile=$(srcdir)/objc/deprecated/$${file}; \
366 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
369 check uninstall install-strip dist installcheck installdirs:
372 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
373 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
374 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
375 *.toc *.tp *.vr *.html libobj.exp
376 @$(MULTICLEAN) multi-clean DO=mostlyclean
380 @$(MULTICLEAN) multi-clean DO=clean
383 @$(MULTICLEAN) multi-clean DO=distclean
384 rm -f config.cache config.status Makefile configure
386 maintainer-clean realclean: distclean
388 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
389 install-strip dist installcheck installdirs
391 # Don't export variables to the environment, in order to not confuse