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 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 2, 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 COPYING. If not, write to
19 #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 #Boston, MA 02110-1301, USA. */
22 #This was cribbed from the libchill, libiberty and libstdc++
23 #Makefile.in files. Some of this stuff may be unnecessary and
29 #### Start of system configuration section. ####
31 srcdir = @glibcpp_srcdir@
32 VPATH
= @glibcpp_srcdir@
34 exec_prefix = @
exec_prefix@
35 target_noncanonical
= @target_noncanonical@
36 gcc_version
:= $(shell cat
$(srcdir)/..
/gcc
/BASE-VER
)
37 host_subdir
= @host_subdir@
38 top_srcdir
= @top_srcdir@
39 multi_basedir
= @multi_basedir@
40 toolexecdir
= @toolexecdir@
41 # Toolexecdir is used only by toolexeclibdir
42 toolexeclibdir
= @toolexeclibdir@
44 includedirname
= @includedirname@
45 libsuffix
= @libsuffix@
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@
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
=-DOBJC_WITH_GC
=1
97 OBJC_THREAD_FILE
=thr-objc
98 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
99 OBJC_BOEHM_GC_INCLUDES
=@OBJC_BOEHM_GC_INCLUDES@
100 OBJC_BOEHM_GC_LIBS
=..
/boehm-gc
/libgcjgc_convenience.la
$(thread_libs_and_flags
)
102 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
103 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config \
104 -I
$(MULTIBUILDTOP
)..
/..
/$(host_subdir
)/gcc \
105 -I
$(srcdir)/$(MULTISRCTOP
)..
/include \
106 $(OBJC_BOEHM_GC_INCLUDES
)
113 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
116 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
118 # Flags to pass to a recursive make.
121 "AR_FLAGS=$(AR_FLAGS)" \
124 "DESTDIR=$(DESTDIR)" \
125 "LIBCFLAGS=$(LIBCFLAGS)" \
126 "EXTRA_OFILES=$(EXTRA_OFILES)" \
127 "HDEFINES=$(HDEFINES)" \
128 "INSTALL=$(INSTALL)" \
129 "INSTALL_DATA=$(INSTALL_DATA)" \
130 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
131 "LDFLAGS=$(LDFLAGS)" \
132 "LIBTOOL=$(LIBTOOL)" \
133 "LOADLIBES=$(LOADLIBES)" \
134 "PICFLAG=$(PICFLAG)" \
138 "exec_prefix=$(exec_prefix)" \
140 "libsubdir=$(libsubdir)" \
143 all: libobjc
$(libsuffix
).la
$(OBJC_BOEHM_GC
)
144 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
146 # User-visible header files.
148 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
149 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
152 # Modules that comprise the runtime library.
154 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
155 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
156 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
157 $(OBJC_THREAD_FILE
).lo exception.lo
159 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
160 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
161 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
162 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
163 $(OBJC_THREAD_FILE
)_gc.lo exception_gc.lo
166 echo
"" > tmp-runtime.m
167 echo
"/* This file is automatically generated */" > $@
168 $(CC
) $(MULTIFLAGS
) -print-objc-runtime-info
-S tmp-runtime.m
>> $@
169 rm -f tmp-runtime.m tmp-runtime.s
171 archive_gc.lo
: archive.c
172 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
176 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
179 encoding_gc.lo
: encoding.c
180 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
184 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
187 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
191 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
195 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
198 linking.lo
: linking.m
199 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
202 linking_gc.lo
: linking.m
203 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
204 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
207 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
210 nil_method_gc.lo
: nil_method.c
211 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
214 NXConstStr.lo
: NXConstStr.m
215 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
218 NXConstStr_gc.lo
: NXConstStr.m
219 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
220 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
223 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
226 Object_gc.lo
: Object.m
227 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
228 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
230 objects_gc.lo
: objects.c
231 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
234 Protocol.lo
: Protocol.m
235 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
238 Protocol_gc.lo
: Protocol.m
239 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
240 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
242 sarray_gc.lo
: sarray.c
243 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
246 selector_gc.lo
: selector.c
247 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
250 sendmsg.lo
: sendmsg.c runtime-info.h
251 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
253 sendmsg_gc.lo
: sendmsg.c runtime-info.h
254 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
258 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
261 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
262 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
265 exception.lo
: exception.c
266 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) \
267 -fexceptions
$(INCLUDES
) $<
269 exception_gc.lo
: exception.c
270 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
271 -fexceptions
$(INCLUDES
) $<
273 doc
: info dvi pdf html
275 # No install-html or install-pdf support
276 .PHONY
: install-html install-pdf install-info
281 LTLDFLAGS
= $(shell $(SHELL
) $(top_srcdir
)/..
/libtool-ldflags
$(LDFLAGS
))
283 libobjc
$(libsuffix
).la
: $(OBJS
)
284 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
285 -rpath
$(toolexeclibdir
) \
286 -version-info
$(LIBOBJC_VERSION
) $(extra_ldflags_libobjc
) \
289 libobjc_gc
$(libsuffix
).la
: $(OBJS_GC
)
290 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) $(OBJC_BOEHM_GC_LIBS
) \
291 -rpath
$(toolexeclibdir
) \
292 -version-info
$(LIBOBJC_GC_VERSION
) $(extra_ldflags_libobjc
) \
296 # FIXME -- The following part does not fit in the libtool context.
297 # Libtool is supposed to [going to] be able to create a win 32 DLL
298 # without extra code but since I don't have a win machine to test
299 # if it already works, I leave the old code here.
301 libobjc_s.a
: libobjc.la
302 mv libobjc.a libobjc_s.a
304 # Create a relocatable DLL
305 libobjc.dll
: libobjc_s.a libobjc_entry.o
306 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
307 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
308 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
309 --base-file libobjc.base
--output-exp libobjc.exp
310 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
311 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
312 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
313 --base-file libobjc.base
--output-exp libobjc.exp
314 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
315 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
316 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
317 --output-lib libobjc.a
329 Makefile
: Makefile.in config.status
330 $(SHELL
) config.status
332 config.status
: configure
334 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
335 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
337 ${srcdir}/configure
: @MAINT@ configure.ac
339 cd
${srcdir} && autoconf
341 install: install-libs install-headers
343 install-libs
: installdirs
344 $(SHELL
) $(multi_basedir
)/mkinstalldirs
$(DESTDIR
)$(toolexeclibdir
)
345 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc
$(libsuffix
).la
$(DESTDIR
)$(toolexeclibdir
);
346 if
[ "$(OBJC_BOEHM_GC)" ]; then \
347 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc
$(libsuffix
).la \
348 $(DESTDIR
)$(toolexeclibdir
);\
350 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
351 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(toolexeclibdir
)
353 # Copy Objective C headers to installation include directory.
355 $(SHELL
) $(multi_basedir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
356 for file in
$(OBJC_H
); do \
357 realfile
=$(srcdir)/objc
/$${file}; \
358 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
; \
361 check uninstall install-strip
dist installcheck installdirs:
364 -$(LIBTOOL_CLEAN
) rm -f libobjc
$(libsuffix
).la libobjc_gc
$(libsuffix
).la
*.lo
365 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
366 fflags *.aux
*.cp
*.
dvi *.pdf
*.fn
*.
info *.ky
*.log
*.pg \
367 *.toc
*.tp
*.vr
*.html libobj.exp
368 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
372 @
$(MULTICLEAN
) multi-clean DO
=clean
375 @
$(MULTICLEAN
) multi-clean DO
=distclean
376 rm -f config.cache config.status Makefile configure
378 maintainer-clean
realclean: distclean
380 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
381 install-strip
dist installcheck installdirs
383 # Don't export variables to the environment, in order to not confuse