1 # Makefile for GNU Objective C runtime library.
2 # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
3 # 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, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, 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
= @gcc_version@
37 top_srcdir
= @top_srcdir@
38 toplevel_srcdir
= @toplevel_srcdir@
39 toolexeclibdir
= @toolexeclibdir@
43 libdir = $(exec_prefix)/lib
44 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
46 # Multilib support variables.
54 # Not configured per top-level version, since that doesn't get passed
55 # down at configure time, but overrridden by the top-level install
58 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
59 INSTALL_DATA
= @INSTALL_DATA@
68 WARN_CFLAGS
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
69 GTHREAD_FLAGS
=@GTHREAD_FLAGS@
70 ALL_CFLAGS
= -I.
-I
$(srcdir) $(CPPFLAGS
) $(DEFS
) $(CFLAGS
) $(WARN_CFLAGS
) \
71 $(GTHREAD_FLAGS
) -DIN_GCC
-DIN_TARGET_LIBS
-fno-strict-aliasing
74 # The following strings describe the version of the obj-C library
75 # begin compiled and compatibility issues.
76 # Please refer to Libtool documentation about how to manage these
78 LIBOBJC_VERSION
= @VERSION@
79 LIBOBJC_GC_VERSION
= @VERSION@
80 # @LIBTOOL@ does not get it right, so we hack it in - FIXME
82 LIBTOOL_COMPILE
= $(LIBTOOL
) --mode
=compile
83 LIBTOOL_LINK
= $(LIBTOOL
) --mode
=link
84 LIBTOOL_INSTALL
= $(LIBTOOL
) --mode
=install
85 LIBTOOL_CLEAN
= $(LIBTOOL
) --mode
=clean
86 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
88 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
89 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config
-I
$(MULTIBUILDTOP
)..
/..
/gcc \
90 -I
$(srcdir)/$(MULTISRCTOP
)..
/include
92 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
93 OBJC_THREAD_FILE
=thr-objc
94 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
100 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
103 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
105 # Flags to pass to a recursive make.
108 "AR_FLAGS=$(AR_FLAGS)" \
111 "DESTDIR=$(DESTDIR)" \
112 "LIBCFLAGS=$(LIBCFLAGS)" \
113 "EXTRA_OFILES=$(EXTRA_OFILES)" \
114 "HDEFINES=$(HDEFINES)" \
115 "INSTALL=$(INSTALL)" \
116 "INSTALL_DATA=$(INSTALL_DATA)" \
117 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
118 "LDFLAGS=$(LDFLAGS)" \
119 "LIBTOOL=$(LIBTOOL)" \
120 "LOADLIBES=$(LOADLIBES)" \
121 "PICFLAG=$(PICFLAG)" \
125 "exec_prefix=$(exec_prefix)" \
127 "libsubdir=$(libsubdir)" \
130 all: libobjc.la
$(OBJC_BOEHM_GC
)
131 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
133 # User-visible header files.
135 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
136 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
139 # Modules that comprise the runtime library.
141 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
142 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
143 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
144 $(OBJC_THREAD_FILE
).lo
146 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
147 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
148 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
149 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
150 $(OBJC_THREAD_FILE
)_gc.lo
153 echo
"" > tmp-runtime.m
154 echo
"/* This file is automatically generated */" > $@
155 $(CC
) $(MULTIFLAGS
) -print-objc-runtime-info
-S tmp-runtime.m
>> $@
156 rm -f tmp-runtime.m tmp-runtime.s
158 archive_gc.lo
: archive.c
159 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
163 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
166 encoding_gc.lo
: encoding.c
167 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
171 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
174 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
178 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
182 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
185 linking.lo
: linking.m
186 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
189 linking_gc.lo
: linking.m
190 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
191 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
194 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
197 nil_method_gc.lo
: nil_method.c
198 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
201 NXConstStr.lo
: NXConstStr.m
202 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
205 NXConstStr_gc.lo
: NXConstStr.m
206 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
207 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
210 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
213 Object_gc.lo
: Object.m
214 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
215 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
217 objects_gc.lo
: objects.c
218 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
221 Protocol.lo
: Protocol.m
222 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
225 Protocol_gc.lo
: Protocol.m
226 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
227 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
229 sarray_gc.lo
: sarray.c
230 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
233 selector_gc.lo
: selector.c
234 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
237 sendmsg.lo
: sendmsg.c runtime-info.h
238 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
240 sendmsg_gc.lo
: sendmsg.c runtime-info.h
241 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
245 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
248 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
249 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
255 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
256 -rpath
$(toolexeclibdir
) \
257 -version-info
$(LIBOBJC_VERSION
)
259 libobjc_gc.la
: $(OBJS_GC
)
260 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) \
261 -rpath
$(toolexeclibdir
) \
262 -version-info
$(LIBOBJC_GC_VERSION
)
265 # FIXME -- The following part does not fit in the libtool context.
266 # Libtool is supposed to [going to] be able to create a win 32 DLL
267 # without extra code but since I don't have a win machine to test
268 # if it already works, I leave the old code here.
270 libobjc_s.a
: libobjc.la
271 mv libobjc.a libobjc_s.a
273 # Create a relocatable DLL
274 libobjc.dll
: libobjc_s.a libobjc_entry.o
275 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
276 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
277 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
278 --base-file libobjc.base
--output-exp libobjc.exp
279 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
280 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
281 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
282 --base-file libobjc.base
--output-exp libobjc.exp
283 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
284 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
285 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
286 --output-lib libobjc.a
297 Makefile
: Makefile.in config.status
298 $(SHELL
) config.status
300 config.status
: configure
302 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
303 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
305 ${srcdir}/configure
: configure.in
307 cd
${srcdir} && autoconf
309 install: install-libs install-headers
311 install-libs
: installdirs
312 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(toolexeclibdir
)
313 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc.la
$(DESTDIR
)$(toolexeclibdir
);
314 if
[ "$(OBJC_BOEHM_GC)" ]; then \
315 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc.la \
316 $(DESTDIR
)$(toolexeclibdir
);\
318 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
319 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(toolexeclibdir
)
321 # Copy Objective C headers to installation include directory.
323 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/include/objc
324 for file in
$(OBJC_H
); do \
325 realfile
=$(srcdir)/objc
/$${file}; \
326 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/include/objc
; \
329 check uninstall install-strip
dist installcheck installdirs:
332 -$(LIBTOOL_CLEAN
) rm -f libobjc.la libobjc_gc.la
*.lo
333 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
334 fflags *.aux
*.cp
*.
dvi *.fn
*.
info *.ky
*.log
*.pg \
335 *.toc
*.tp
*.vr
*.html libobj.exp
336 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
340 @
$(MULTICLEAN
) multi-clean DO
=clean
343 @
$(MULTICLEAN
) multi-clean DO
=distclean
344 rm -f config.cache config.status Makefile configure
346 maintainer-clean
realclean: distclean
348 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
349 install-strip
dist installcheck installdirs