1 # Makefile for GNU Objective C runtime library.
2 # Copyright (C) 1993, 95-98, 1999, 2001, 2002, 2003
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_alias
= @target_alias@
36 gcc_version
= @gcc_version@
37 gcc_version_trigger
= @gcc_version_trigger@
38 top_srcdir
= @top_srcdir@
39 toplevel_srcdir
= @toplevel_srcdir@
40 toolexecdir
= @glibcpp_toolexecdir@
41 glibcpp_toolexecdir
= @glibcpp_toolexecdir@
42 glibcpp_toolexeclibdir
= @glibcpp_toolexeclibdir@
46 libdir = $(exec_prefix)/lib
47 libsubdir
= $(libdir)/gcc
/$(target_alias
)/$(gcc_version
)
49 # Multilib support variables.
57 # Not configured per top-level version, since that doesn't get passed
58 # down at configure time, but overrridden by the top-level install
61 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
62 INSTALL_DATA
= @INSTALL_DATA@
71 WARN_CFLAGS
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
72 GTHREAD_FLAGS
=@GTHREAD_FLAGS@
73 ALL_CFLAGS
= -I.
-I
$(srcdir) $(CPPFLAGS
) $(DEFS
) $(CFLAGS
) $(WARN_CFLAGS
) \
74 $(GTHREAD_FLAGS
) -DIN_GCC
-DIN_TARGET_LIBS
-fno-strict-aliasing
77 # The following strings describe the version of the obj-C library
78 # begin compiled and compatibility issues.
79 # Please refer to Libtool documentation about how to manage these
81 LIBOBJC_VERSION
= 1:0:0
82 LIBOBJC_GC_VERSION
= 1:0:0
83 # @LIBTOOL@ does not get it right, so we hack it in - FIXME
85 LIBTOOL_COMPILE
= $(LIBTOOL
) --mode
=compile
86 LIBTOOL_LINK
= $(LIBTOOL
) --mode
=link
87 LIBTOOL_INSTALL
= $(LIBTOOL
) --mode
=install
88 LIBTOOL_CLEAN
= $(LIBTOOL
) --mode
=clean
89 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
91 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
92 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config
-I
$(MULTIBUILDTOP
)..
/..
/gcc \
93 -I
$(srcdir)/$(MULTISRCTOP
)..
/include
95 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
96 OBJC_THREAD_FILE
=thr-objc
97 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
103 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
106 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
108 # Flags to pass to a recursive make.
111 "AR_FLAGS=$(AR_FLAGS)" \
114 "DESTDIR=$(DESTDIR)" \
115 "LIBCFLAGS=$(LIBCFLAGS)" \
116 "EXTRA_OFILES=$(EXTRA_OFILES)" \
117 "HDEFINES=$(HDEFINES)" \
118 "INSTALL=$(INSTALL)" \
119 "INSTALL_DATA=$(INSTALL_DATA)" \
120 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
121 "LDFLAGS=$(LDFLAGS)" \
122 "LIBTOOL=$(LIBTOOL)" \
123 "LOADLIBES=$(LOADLIBES)" \
124 "PICFLAG=$(PICFLAG)" \
128 "exec_prefix=$(exec_prefix)" \
130 "libsubdir=$(libsubdir)" \
133 all: libobjc.la
$(OBJC_BOEHM_GC
)
134 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
136 # User-visible header files.
138 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
139 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
142 # Modules that comprise the runtime library.
144 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
145 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
146 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
147 $(OBJC_THREAD_FILE
).lo
149 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
150 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
151 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
152 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
153 $(OBJC_THREAD_FILE
)_gc.lo
156 echo
"" > tmp-runtime.m
157 echo
"/* This file is automatically generated */" > $@
158 $(CC
) $(MULTIFLAGS
) -print-objc-runtime-info
-S tmp-runtime.m
>> $@
159 rm -f tmp-runtime.m tmp-runtime.s
161 archive_gc.lo
: archive.c
162 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
166 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
169 encoding_gc.lo
: encoding.c
170 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
174 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
177 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
181 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
185 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
188 linking.lo
: linking.m
189 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
192 linking_gc.lo
: linking.m
193 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
194 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
197 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
200 nil_method_gc.lo
: nil_method.c
201 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
204 NXConstStr.lo
: NXConstStr.m
205 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
208 NXConstStr_gc.lo
: NXConstStr.m
209 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
210 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
213 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
216 Object_gc.lo
: Object.m
217 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
218 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
220 objects_gc.lo
: objects.c
221 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
224 Protocol.lo
: Protocol.m
225 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
228 Protocol_gc.lo
: Protocol.m
229 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
230 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
232 sarray_gc.lo
: sarray.c
233 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
236 selector_gc.lo
: selector.c
237 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
240 sendmsg.lo
: sendmsg.c runtime-info.h
241 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
243 sendmsg_gc.lo
: sendmsg.c runtime-info.h
244 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
248 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
251 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
252 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
258 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
259 -rpath
$(glibcpp_toolexeclibdir
) \
260 -version-info
$(LIBOBJC_VERSION
)
262 libobjc_gc.la
: $(OBJS_GC
)
263 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) \
264 -rpath
$(glibcpp_toolexeclibdir
) \
265 -version-info
$(LIBOBJC_GC_VERSION
)
268 # FIXME -- The following part does not fit in the libtool context.
269 # Libtool is supposed to [going to] be able to create a win 32 DLL
270 # without extra code but since I don't have a win machine to test
271 # if it already works, I leave the old code here.
273 libobjc_s.a
: libobjc.la
274 mv libobjc.a libobjc_s.a
276 # Create a relocatable DLL
277 libobjc.dll
: libobjc_s.a libobjc_entry.o
278 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
279 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
280 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
281 --base-file libobjc.base
--output-exp libobjc.exp
282 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
283 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
284 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
285 --base-file libobjc.base
--output-exp libobjc.exp
286 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
287 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
288 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
289 --output-lib libobjc.a
300 Makefile
: Makefile.in config.status
301 $(SHELL
) config.status
303 config.status
: configure
305 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
306 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
308 ${srcdir}/configure
: configure.in
310 cd
${srcdir} && autoconf
312 install: install-libs install-headers
314 install-libs
: installdirs
315 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(glibcpp_toolexeclibdir
)
316 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc.la
$(DESTDIR
)$(glibcpp_toolexeclibdir
);
317 if
[ "$(OBJC_BOEHM_GC)" ]; then \
318 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc.la \
319 $(DESTDIR
)$(glibcpp_toolexeclibdir
);\
321 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
322 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(glibcpp_toolexeclibdir
)
324 # Copy Objective C headers to installation include directory.
326 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/include/objc
327 for file in
$(OBJC_H
); do \
328 realfile
=$(srcdir)/objc
/$${file}; \
329 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/include/objc
; \
332 check uninstall install-strip
dist installcheck installdirs:
335 -$(LIBTOOL_CLEAN
) rm -f libobjc.la libobjc_gc.la
*.lo
336 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
337 fflags *.aux
*.cp
*.
dvi *.fn
*.
info *.ky
*.log
*.pg \
338 *.toc
*.tp
*.vr
*.html libobj.exp
339 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
343 @
$(MULTICLEAN
) multi-clean DO
=clean
346 @
$(MULTICLEAN
) multi-clean DO
=distclean
347 rm -f config.cache config.status Makefile configure
349 maintainer-clean
realclean: distclean
351 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
352 install-strip
dist installcheck installdirs