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 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 extra_ldflags_libobjc
= @extra_ldflags_libobjc@
50 -include ..
/boehm-gc
/threads.mk
52 libdir = $(exec_prefix)/lib
53 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
55 # Multilib support variables.
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
67 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
68 INSTALL_DATA
= @INSTALL_DATA@
77 WARN_CFLAGS
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
78 ALL_CFLAGS
= -I.
-I
$(srcdir) $(CPPFLAGS
) $(DEFS
) $(CFLAGS
) $(WARN_CFLAGS
) \
79 -DIN_GCC
-DIN_TARGET_LIBS
-fno-strict-aliasing
-fexceptions
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
86 LIBOBJC_VERSION
= @VERSION@
87 LIBOBJC_GC_VERSION
= @VERSION@
88 LIBTOOL
= @LIBTOOL@
$(LIBTOOLFLAGS
)
89 LIBTOOL_COMPILE
= $(LIBTOOL
) --mode
=compile
90 LIBTOOL_LINK
= $(LIBTOOL
) --mode
=link
91 LIBTOOL_INSTALL
= $(LIBTOOL
) --mode
=install
92 LIBTOOL_CLEAN
= $(LIBTOOL
) --mode
=clean
93 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
95 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
96 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
97 OBJC_BOEHM_GC_INCLUDES
=@OBJC_BOEHM_GC_INCLUDES@
98 OBJC_BOEHM_GC_LIBS
=..
/boehm-gc
/libgcjgc_convenience.la
$(thread_libs_and_flags
)
100 INCLUDES
= -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
101 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config \
102 -I
$(MULTIBUILDTOP
)..
/..
/$(host_subdir
)/gcc \
103 -I
$(srcdir)/$(MULTISRCTOP
)..
/include \
104 $(OBJC_BOEHM_GC_INCLUDES
)
107 ## The list of header/source files
110 # User-visible header files, from the objc/ directory
131 # User-visible header files containing deprecated APIs, from the
132 # objc/deprecated directory
133 OBJC_DEPRECATED_H
= \
142 objc_unexpected_exception.h \
145 struct_objc_category.h \
146 struct_objc_class.h \
148 struct_objc_ivar_list.h \
149 struct_objc_method.h \
150 struct_objc_method_list.h \
151 struct_objc_module.h \
152 struct_objc_protocol.h \
153 struct_objc_protocol_list.h \
154 struct_objc_selector.h \
155 struct_objc_symtab.h \
158 # Objective-C source files to compile
159 OBJC_SOURCE_FILES
= \
165 # C source files to compile
186 # Object files to link (when the library is linked with no GC (Garbage Collection))
188 $(patsubst %.m
,%.lo
,$(OBJC_SOURCE_FILES
)) \
189 $(patsubst %.c
,%.lo
,$(C_SOURCE_FILES
))
191 # Object files to link (when the library is linked with GC (Garbage Collection))
193 $(patsubst %.m
,%_gc.lo
,$(OBJC_SOURCE_FILES
)) \
194 $(patsubst %.c
,%_gc.lo
,$(C_SOURCE_FILES
))
198 ## The rules to build
201 # Flags to pass to a recursive make.
204 "AR_FLAGS=$(AR_FLAGS)" \
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)" \
221 "exec_prefix=$(exec_prefix)" \
223 "libsubdir=$(libsubdir)" \
226 # The 'all' rule must be the first one so that it is executed if
227 # nothing is specified on the command-line.
228 all: libobjc
$(libsuffix
).la
$(OBJC_BOEHM_GC
)
229 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
235 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
236 $(ALL_CFLAGS
) $(INCLUDES
) \
240 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
241 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) \
245 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
246 $(ALL_CFLAGS
) $(INCLUDES
) -fgnu-runtime \
250 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
251 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) -fgnu-runtime \
254 # sendmsg has a special rule because it depends on runtime-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
261 sendmsg.lo
: sendmsg.c runtime-info.h
262 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
263 $(ALL_CFLAGS
) $(INCLUDES
) \
266 sendmsg_gc.lo
: sendmsg.c runtime-info.h
267 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
268 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) \
271 # These files have separate rules because they require special
273 archive.lo
: archive.c
274 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
275 $(ALL_CFLAGS
) $(INCLUDES
) -Wno-deprecated-declarations \
278 archive_gc.lo
: archive.c
279 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
280 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) -Wno-deprecated-declarations \
283 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
285 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
286 $(ALL_CFLAGS
) $(INCLUDES
) -fgnu-runtime
-Wno-deprecated-declarations \
289 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
290 Object_gc.lo
: Object.m
291 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
292 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) -fgnu-runtime
-Wno-deprecated-declarations \
295 # -Wno-deprecated-declarations is to silence warnings from using
296 # _objc_unexpected_exception.
297 exception.lo
: exception.c
298 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
299 $(ALL_CFLAGS
) $(INCLUDES
) -fexceptions
-Wno-deprecated-declarations \
302 exception_gc.lo
: exception.c
303 $(LIBTOOL_COMPILE
) $(CC
) $< -c \
304 $(ALL_CFLAGS
) $(INCLUDES
) $(OBJC_GCFLAGS
) -fexceptions
-Wno-deprecated-declarations \
307 doc
: info dvi pdf html
309 # No install-html or install-pdf support
310 .PHONY
: install-html install-pdf install-info
315 LTLDFLAGS
= $(shell $(SHELL
) $(top_srcdir
)/..
/libtool-ldflags
$(LDFLAGS
))
317 libobjc
$(libsuffix
).la
: $(OBJS
)
318 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
319 -rpath
$(toolexeclibdir
) \
320 -version-info
$(LIBOBJC_VERSION
) $(extra_ldflags_libobjc
) \
323 libobjc_gc
$(libsuffix
).la
: $(OBJS_GC
)
324 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) $(OBJC_BOEHM_GC_LIBS
) \
325 -rpath
$(toolexeclibdir
) \
326 -version-info
$(LIBOBJC_GC_VERSION
) $(extra_ldflags_libobjc
) \
334 Makefile
: Makefile.in config.status
335 $(SHELL
) config.status
337 config.status
: configure
339 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
340 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
344 ACLOCAL_AMFLAGS
= -I ..
/config
-I ..
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
355 $(srcdir)/configure
: @MAINT@ configure.ac
$(srcdir)/aclocal.m4
357 cd
$(srcdir) && $(AUTOCONF
)
359 $(srcdir)/aclocal.m4
: @MAINT@
$(aclocal_deps
)
360 cd
$(srcdir) && $(ACLOCAL
) $(ACLOCAL_AMFLAGS
)
362 install: install-libs install-headers
364 install-libs
: installdirs
365 $(SHELL
) $(multi_basedir
)/mkinstalldirs
$(DESTDIR
)$(toolexeclibdir
)
366 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc
$(libsuffix
).la
$(DESTDIR
)$(toolexeclibdir
);
367 if
[ "$(OBJC_BOEHM_GC)" ]; then \
368 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc
$(libsuffix
).la \
369 $(DESTDIR
)$(toolexeclibdir
);\
371 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
372 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(toolexeclibdir
)
374 # Copy Objective-C headers to installation include directory.
376 $(SHELL
) $(multi_basedir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
377 for file in
$(OBJC_H
); do \
378 realfile
=$(srcdir)/objc
/$${file}; \
379 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
; \
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
; \
387 check uninstall install-strip
dist installcheck installdirs:
390 -$(LIBTOOL_CLEAN
) rm -f libobjc
$(libsuffix
).la libobjc_gc
$(libsuffix
).la
*.lo
391 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
392 fflags *.aux
*.cp
*.
dvi *.pdf
*.fn
*.
info *.ky
*.log
*.pg \
393 *.toc
*.tp
*.vr
*.html libobj.exp
394 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
398 @
$(MULTICLEAN
) multi-clean DO
=clean
401 @
$(MULTICLEAN
) multi-clean DO
=distclean
402 rm -f config.cache config.status Makefile configure
404 maintainer-clean
realclean: distclean
406 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
407 install-strip
dist installcheck installdirs
409 # Don't export variables to the environment, in order to not confuse