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 toolexecdir
= @toolexecdir@
40 # Toolexecdir is used only by toolexeclibdir
41 toolexeclibdir
= @toolexeclibdir@
45 libdir = $(exec_prefix)/lib
46 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
48 # Multilib support variables.
56 # Not configured per top-level version, since that doesn't get passed
57 # down at configure time, but overrridden by the top-level install
60 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
61 INSTALL_DATA
= @INSTALL_DATA@
70 WARN_CFLAGS
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
71 GTHREAD_FLAGS
=@GTHREAD_FLAGS@
72 ALL_CFLAGS
= -I.
-I
$(srcdir) $(CPPFLAGS
) $(DEFS
) $(CFLAGS
) $(WARN_CFLAGS
) \
73 $(GTHREAD_FLAGS
) -DIN_GCC
-DIN_TARGET_LIBS
-fno-strict-aliasing
76 # The following strings describe the version of the obj-C library
77 # begin compiled and compatibility issues.
78 # Please refer to Libtool documentation about how to manage these
80 LIBOBJC_VERSION
= @VERSION@
81 LIBOBJC_GC_VERSION
= @VERSION@
82 # @LIBTOOL@ does not get it right, so we hack it in - FIXME
84 LIBTOOL_COMPILE
= $(LIBTOOL
) --mode
=compile
85 LIBTOOL_LINK
= $(LIBTOOL
) --mode
=link
86 LIBTOOL_INSTALL
= $(LIBTOOL
) --mode
=install
87 LIBTOOL_CLEAN
= $(LIBTOOL
) --mode
=clean
88 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
90 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
91 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config
-I
$(MULTIBUILDTOP
)..
/..
/gcc \
92 -I
$(srcdir)/$(MULTISRCTOP
)..
/include
94 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
95 OBJC_THREAD_FILE
=thr-objc
96 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
102 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
105 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
107 # Flags to pass to a recursive make.
110 "AR_FLAGS=$(AR_FLAGS)" \
113 "DESTDIR=$(DESTDIR)" \
114 "LIBCFLAGS=$(LIBCFLAGS)" \
115 "EXTRA_OFILES=$(EXTRA_OFILES)" \
116 "HDEFINES=$(HDEFINES)" \
117 "INSTALL=$(INSTALL)" \
118 "INSTALL_DATA=$(INSTALL_DATA)" \
119 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
120 "LDFLAGS=$(LDFLAGS)" \
121 "LIBTOOL=$(LIBTOOL)" \
122 "LOADLIBES=$(LOADLIBES)" \
123 "PICFLAG=$(PICFLAG)" \
127 "exec_prefix=$(exec_prefix)" \
129 "libsubdir=$(libsubdir)" \
132 all: libobjc.la
$(OBJC_BOEHM_GC
)
133 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
135 # User-visible header files.
137 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
138 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
141 # Modules that comprise the runtime library.
143 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
144 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
145 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
146 $(OBJC_THREAD_FILE
).lo
148 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
149 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
150 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
151 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
152 $(OBJC_THREAD_FILE
)_gc.lo
155 echo
"" > tmp-runtime.m
156 echo
"/* This file is automatically generated */" > $@
157 $(CC
) $(MULTIFLAGS
) -print-objc-runtime-info
-S tmp-runtime.m
>> $@
158 rm -f tmp-runtime.m tmp-runtime.s
160 archive_gc.lo
: archive.c
161 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
165 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
168 encoding_gc.lo
: encoding.c
169 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
173 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
176 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
180 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
184 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
187 linking.lo
: linking.m
188 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
191 linking_gc.lo
: linking.m
192 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
193 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
196 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
199 nil_method_gc.lo
: nil_method.c
200 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
203 NXConstStr.lo
: NXConstStr.m
204 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
207 NXConstStr_gc.lo
: NXConstStr.m
208 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
209 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
212 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
215 Object_gc.lo
: Object.m
216 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
217 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
219 objects_gc.lo
: objects.c
220 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
223 Protocol.lo
: Protocol.m
224 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
227 Protocol_gc.lo
: Protocol.m
228 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
229 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
231 sarray_gc.lo
: sarray.c
232 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
235 selector_gc.lo
: selector.c
236 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
239 sendmsg.lo
: sendmsg.c runtime-info.h
240 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
242 sendmsg_gc.lo
: sendmsg.c runtime-info.h
243 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
247 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
250 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
251 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
257 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
258 -rpath
$(toolexeclibdir
) \
259 -version-info
$(LIBOBJC_VERSION
)
261 libobjc_gc.la
: $(OBJS_GC
)
262 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) \
263 -rpath
$(toolexeclibdir
) \
264 -version-info
$(LIBOBJC_GC_VERSION
)
267 # FIXME -- The following part does not fit in the libtool context.
268 # Libtool is supposed to [going to] be able to create a win 32 DLL
269 # without extra code but since I don't have a win machine to test
270 # if it already works, I leave the old code here.
272 libobjc_s.a
: libobjc.la
273 mv libobjc.a libobjc_s.a
275 # Create a relocatable DLL
276 libobjc.dll
: libobjc_s.a libobjc_entry.o
277 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
278 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
279 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
280 --base-file libobjc.base
--output-exp libobjc.exp
281 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
282 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
283 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
284 --base-file libobjc.base
--output-exp libobjc.exp
285 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
286 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
287 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
288 --output-lib libobjc.a
299 Makefile
: Makefile.in config.status
300 $(SHELL
) config.status
302 config.status
: configure
304 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
305 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
307 ${srcdir}/configure
: configure.ac
309 cd
${srcdir} && autoconf
311 install: install-libs install-headers
313 install-libs
: installdirs
314 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(toolexeclibdir
)
315 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc.la
$(DESTDIR
)$(toolexeclibdir
);
316 if
[ "$(OBJC_BOEHM_GC)" ]; then \
317 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc.la \
318 $(DESTDIR
)$(toolexeclibdir
);\
320 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
321 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(toolexeclibdir
)
323 # Copy Objective C headers to installation include directory.
325 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/include/objc
326 for file in
$(OBJC_H
); do \
327 realfile
=$(srcdir)/objc
/$${file}; \
328 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/include/objc
; \
331 check uninstall install-strip
dist installcheck installdirs:
334 -$(LIBTOOL_CLEAN
) rm -f libobjc.la libobjc_gc.la
*.lo
335 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
336 fflags *.aux
*.cp
*.
dvi *.fn
*.
info *.ky
*.log
*.pg \
337 *.toc
*.tp
*.vr
*.html libobj.exp
338 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
342 @
$(MULTICLEAN
) multi-clean DO
=clean
345 @
$(MULTICLEAN
) multi-clean DO
=distclean
346 rm -f config.cache config.status Makefile configure
348 maintainer-clean
realclean: distclean
350 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
351 install-strip
dist installcheck installdirs