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 host_subdir
= @host_subdir@
38 top_srcdir
= @top_srcdir@
39 toplevel_srcdir
= @toplevel_srcdir@
40 toolexecdir
= @toolexecdir@
41 # Toolexecdir is used only by toolexeclibdir
42 toolexeclibdir
= @toolexeclibdir@
44 includedirname
= @includedirname@
49 libdir = $(exec_prefix)/lib
50 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
52 # Multilib support variables.
60 # Not configured per top-level version, since that doesn't get passed
61 # down at configure time, but overrridden by the top-level install
64 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
65 INSTALL_DATA
= @INSTALL_DATA@
74 WARN_CFLAGS
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
75 ALL_CFLAGS
= -I.
-I
$(srcdir) $(CPPFLAGS
) $(DEFS
) $(CFLAGS
) $(WARN_CFLAGS
) \
76 -DIN_GCC
-DIN_TARGET_LIBS
-fno-strict-aliasing
79 # The following strings describe the version of the obj-C library
80 # begin compiled and compatibility issues.
81 # Please refer to Libtool documentation about how to manage these
83 LIBOBJC_VERSION
= @VERSION@
84 LIBOBJC_GC_VERSION
= @VERSION@
86 LIBTOOL_COMPILE
= $(LIBTOOL
) --mode
=compile
87 LIBTOOL_LINK
= $(LIBTOOL
) --mode
=link
88 LIBTOOL_INSTALL
= $(LIBTOOL
) --mode
=install
89 LIBTOOL_CLEAN
= $(LIBTOOL
) --mode
=clean
90 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
92 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
93 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config \
94 -I
$(MULTIBUILDTOP
)..
/..
/$(host_subdir
)/gcc \
95 -I
$(srcdir)/$(MULTISRCTOP
)..
/include
97 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
98 OBJC_THREAD_FILE
=thr-objc
99 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
105 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
108 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
110 # Flags to pass to a recursive make.
113 "AR_FLAGS=$(AR_FLAGS)" \
116 "DESTDIR=$(DESTDIR)" \
117 "LIBCFLAGS=$(LIBCFLAGS)" \
118 "EXTRA_OFILES=$(EXTRA_OFILES)" \
119 "HDEFINES=$(HDEFINES)" \
120 "INSTALL=$(INSTALL)" \
121 "INSTALL_DATA=$(INSTALL_DATA)" \
122 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
123 "LDFLAGS=$(LDFLAGS)" \
124 "LIBTOOL=$(LIBTOOL)" \
125 "LOADLIBES=$(LOADLIBES)" \
126 "PICFLAG=$(PICFLAG)" \
130 "exec_prefix=$(exec_prefix)" \
132 "libsubdir=$(libsubdir)" \
135 all: libobjc
$(libext
).la
$(OBJC_BOEHM_GC
)
136 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
138 # User-visible header files.
140 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
141 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
144 # Modules that comprise the runtime library.
146 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
147 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
148 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
149 $(OBJC_THREAD_FILE
).lo exception.lo
151 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
152 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
153 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
154 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
155 $(OBJC_THREAD_FILE
)_gc.lo exception_gc.lo
158 echo
"" > tmp-runtime.m
159 echo
"/* This file is automatically generated */" > $@
160 $(CC
) $(MULTIFLAGS
) -print-objc-runtime-info
-S tmp-runtime.m
>> $@
161 rm -f tmp-runtime.m tmp-runtime.s
163 archive_gc.lo
: archive.c
164 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
168 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
171 encoding_gc.lo
: encoding.c
172 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
176 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
179 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
183 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
187 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
190 linking.lo
: linking.m
191 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
194 linking_gc.lo
: linking.m
195 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
196 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
199 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
202 nil_method_gc.lo
: nil_method.c
203 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
206 NXConstStr.lo
: NXConstStr.m
207 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
210 NXConstStr_gc.lo
: NXConstStr.m
211 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
212 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
215 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
218 Object_gc.lo
: Object.m
219 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
220 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
222 objects_gc.lo
: objects.c
223 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
226 Protocol.lo
: Protocol.m
227 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
230 Protocol_gc.lo
: Protocol.m
231 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
232 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
234 sarray_gc.lo
: sarray.c
235 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
238 selector_gc.lo
: selector.c
239 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
242 sendmsg.lo
: sendmsg.c runtime-info.h
243 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
245 sendmsg_gc.lo
: sendmsg.c runtime-info.h
246 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
250 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
253 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
254 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
257 exception.lo
: exception.c
258 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) \
259 -fexceptions
$(INCLUDES
) $<
261 exception_gc.lo
: exception.c
262 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
263 -fexceptions
$(INCLUDES
) $<
267 libobjc
$(libext
).la
: $(OBJS
)
268 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
269 -rpath
$(toolexeclibdir
) \
270 -version-info
$(LIBOBJC_VERSION
)
272 libobjc_gc
$(libext
).la
: $(OBJS_GC
)
273 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) \
274 -rpath
$(toolexeclibdir
) \
275 -version-info
$(LIBOBJC_GC_VERSION
)
278 # FIXME -- The following part does not fit in the libtool context.
279 # Libtool is supposed to [going to] be able to create a win 32 DLL
280 # without extra code but since I don't have a win machine to test
281 # if it already works, I leave the old code here.
283 libobjc_s.a
: libobjc.la
284 mv libobjc.a libobjc_s.a
286 # Create a relocatable DLL
287 libobjc.dll
: libobjc_s.a libobjc_entry.o
288 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
289 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
290 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
291 --base-file libobjc.base
--output-exp libobjc.exp
292 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
293 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
294 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
295 --base-file libobjc.base
--output-exp libobjc.exp
296 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
297 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
298 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
299 --output-lib libobjc.a
310 Makefile
: Makefile.in config.status
311 $(SHELL
) config.status
313 config.status
: configure
315 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
316 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
318 ${srcdir}/configure
: @MAINT@ configure.ac
320 cd
${srcdir} && autoconf
322 install: install-libs install-headers
324 install-libs
: installdirs
325 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(toolexeclibdir
)
326 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc
$(libext
).la
$(DESTDIR
)$(toolexeclibdir
);
327 if
[ "$(OBJC_BOEHM_GC)" ]; then \
328 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc
$(libext
).la \
329 $(DESTDIR
)$(toolexeclibdir
);\
331 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
332 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(toolexeclibdir
)
334 # Copy Objective C headers to installation include directory.
336 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
337 for file in
$(OBJC_H
); do \
338 realfile
=$(srcdir)/objc
/$${file}; \
339 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/$(includedirname
)/objc
; \
342 check uninstall install-strip
dist installcheck installdirs:
345 -$(LIBTOOL_CLEAN
) rm -f libobjc
$(libext
).la libobjc_gc
$(libext
).la
*.lo
346 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
347 fflags *.aux
*.cp
*.
dvi *.fn
*.
info *.ky
*.log
*.pg \
348 *.toc
*.tp
*.vr
*.html libobj.exp
349 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
353 @
$(MULTICLEAN
) multi-clean DO
=clean
356 @
$(MULTICLEAN
) multi-clean DO
=distclean
357 rm -f config.cache config.status Makefile configure
359 maintainer-clean
realclean: distclean
361 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
362 install-strip
dist installcheck installdirs
364 # Don't export variables to the environment, in order to not confuse