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
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
92 # Define the cc1obj in terms of the CC that is passed on from higher
93 # level make. This is needed to make sure we can create runtime-info.h
94 # when doing canadian cross builds where running ../../gcc/cc1obj
95 # does not make any sense.
97 CC1OBJ
= `$(CC) -print-prog-name=cc1obj`
99 INCLUDES
= -I
$(srcdir)/objc
-I
$(srcdir)/$(MULTISRCTOP
)..
/gcc \
100 -I
$(srcdir)/$(MULTISRCTOP
)..
/gcc
/config
-I
$(MULTIBUILDTOP
)..
/..
/gcc \
101 -I
$(srcdir)/$(MULTISRCTOP
)..
/include
103 OBJC_GCFLAGS
=-DOBJC_WITH_GC
=1
104 OBJC_THREAD_FILE
=thr-objc
105 OBJC_BOEHM_GC
=@OBJC_BOEHM_GC@
111 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
114 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
116 # Flags to pass to a recursive make.
119 "AR_FLAGS=$(AR_FLAGS)" \
122 "DESTDIR=$(DESTDIR)" \
123 "LIBCFLAGS=$(LIBCFLAGS)" \
124 "EXTRA_OFILES=$(EXTRA_OFILES)" \
125 "HDEFINES=$(HDEFINES)" \
126 "INSTALL=$(INSTALL)" \
127 "INSTALL_DATA=$(INSTALL_DATA)" \
128 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
129 "LDFLAGS=$(LDFLAGS)" \
130 "LIBTOOL=$(LIBTOOL)" \
131 "LOADLIBES=$(LOADLIBES)" \
132 "PICFLAG=$(PICFLAG)" \
136 "exec_prefix=$(exec_prefix)" \
138 "libsubdir=$(libsubdir)" \
141 all: libobjc.la
$(OBJC_BOEHM_GC
)
142 : $(MAKE
) ; exec
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
144 # User-visible header files.
146 OBJC_H
= hash.h objc-list.h sarray.h objc.h objc-api.h \
147 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
150 # Modules that comprise the runtime library.
152 OBJS
= archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
153 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
154 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
155 $(OBJC_THREAD_FILE
).lo
157 OBJS_GC
= archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
158 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
159 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
160 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
161 $(OBJC_THREAD_FILE
)_gc.lo
164 echo
"" > tmp-runtime
165 echo
"/* This file is automatically generated */" > $@
166 $(CC1OBJ
) $(MULTIFLAGS
) -print-objc-runtime-info tmp-runtime
>> $@
169 archive_gc.lo
: archive.c
170 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
174 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
177 encoding_gc.lo
: encoding.c
178 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
182 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
185 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
189 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
193 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
196 linking.lo
: linking.m
197 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
200 linking_gc.lo
: linking.m
201 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
202 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
205 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
208 nil_method_gc.lo
: nil_method.c
209 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
212 NXConstStr.lo
: NXConstStr.m
213 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
216 NXConstStr_gc.lo
: NXConstStr.m
217 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
218 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
221 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
224 Object_gc.lo
: Object.m
225 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
226 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
228 objects_gc.lo
: objects.c
229 $(LIBTOOL_COMPILE
) $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$(OBJC_GCFLAGS
) \
232 Protocol.lo
: Protocol.m
233 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
236 Protocol_gc.lo
: Protocol.m
237 $(LIBTOOL_COMPILE
) $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) \
238 $(OBJC_GCFLAGS
) $(INCLUDES
) $<
240 sarray_gc.lo
: sarray.c
241 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
244 selector_gc.lo
: selector.c
245 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
248 sendmsg.lo
: sendmsg.c runtime-info.h
249 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
251 sendmsg_gc.lo
: sendmsg.c runtime-info.h
252 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
256 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
259 $(OBJC_THREAD_FILE
)_gc.lo
: $(OBJC_THREAD_FILE
).c
260 $(LIBTOOL_COMPILE
) $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
266 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS
) \
267 -rpath
$(glibcpp_toolexeclibdir
) \
268 -version-info
$(LIBOBJC_VERSION
)
270 libobjc_gc.la
: $(OBJS_GC
)
271 $(LIBTOOL_LINK
) $(CC
) -o
$@
$(OBJS_GC
) \
272 -rpath
$(glibcpp_toolexeclibdir
) \
273 -version-info
$(LIBOBJC_GC_VERSION
)
276 # FIXME -- The following part does not fit in the libtool context.
277 # Libtool is supposed to [going to] be able to create a win 32 DLL
278 # without extra code but since I don't have a win machine to test
279 # if it already works, I leave the old code here.
281 libobjc_s.a
: libobjc.la
282 mv libobjc.a libobjc_s.a
284 # Create a relocatable DLL
285 libobjc.dll
: libobjc_s.a libobjc_entry.o
286 $(CC
) -mdll
-Wl
,--base-file
-Wl
,libobjc.base \
287 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
288 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
289 --base-file libobjc.base
--output-exp libobjc.exp
290 $(GCC_FOR_TARGET
) -mdll
-Wl
,--base-file libobjc.base libobjc.exp \
291 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
292 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
293 --base-file libobjc.base
--output-exp libobjc.exp
294 $(GCC_FOR_TARGET
) libobjc.exp
-mdll \
295 -o libobjc.dll libobjc_s.a libobjc_entry.o
-lkernel32
296 $(DLLTOOL
) --dllname libobjc.dll
--def
$(srcdir)/libobjc.def \
297 --output-lib libobjc.a
308 Makefile
: Makefile.in config.status
309 $(SHELL
) config.status
311 config.status
: configure
313 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
314 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
316 ${srcdir}/configure
: configure.in
318 cd
${srcdir} && autoconf
320 install: install-libs install-headers
322 install-libs
: installdirs
323 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(glibcpp_toolexeclibdir
)
324 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc.la
$(DESTDIR
)$(glibcpp_toolexeclibdir
);
325 if
[ "$(OBJC_BOEHM_GC)" ]; then \
326 $(LIBTOOL_INSTALL
) $(INSTALL
) libobjc_gc.la \
327 $(DESTDIR
)$(glibcpp_toolexeclibdir
);\
329 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
="$@"
330 @
-$(LIBTOOL
) --mode
=finish
$(DESTDIR
)$(glibcpp_toolexeclibdir
)
332 # Copy Objective C headers to installation include directory.
334 $(SHELL
) $(toplevel_srcdir
)/mkinstalldirs
$(DESTDIR
)$(libsubdir
)/include/objc
335 for file in
$(OBJC_H
); do \
336 realfile
=$(srcdir)/objc
/$${file}; \
337 $(INSTALL_DATA
) $${realfile} $(DESTDIR
)$(libsubdir
)/include/objc
; \
340 check uninstall install-strip
dist installcheck installdirs:
343 -$(LIBTOOL_CLEAN
) rm -f libobjc.la libobjc_gc.la
*.lo
344 -rm -f runtime-info.h tmp-runtime.s
*.o
*.lo libobjc
* xforward \
345 fflags *.aux
*.cp
*.
dvi *.fn
*.
info *.ky
*.log
*.pg \
346 *.toc
*.tp
*.vr
*.html libobj.exp
347 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
351 @
$(MULTICLEAN
) multi-clean DO
=clean
354 @
$(MULTICLEAN
) multi-clean DO
=distclean
355 rm -f config.cache config.status Makefile configure
357 maintainer-clean
realclean: distclean
359 .PHONY
: mostlyclean clean distclean maintainer-clean
all check uninstall \
360 install-strip
dist installcheck installdirs