* cplus-dem.c (demangle_template): Register a new Btype only
[official-gcc.git] / libobjc / Makefile.in
blob858946982228e5fb0ec851d47eb2d0b651c58ecc
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)
10 #any later version.
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
24 #worthless.
26 SHELL = @SHELL@
27 MAKEOVERRIDES=
29 #### Start of system configuration section. ####
31 srcdir = @glibcpp_srcdir@
32 VPATH = @glibcpp_srcdir@
33 prefix = @prefix@
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@
44 top_builddir = .
46 libdir = $(exec_prefix)/lib
47 libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
49 # Multilib support variables.
50 MULTISRCTOP =
51 MULTIBUILDTOP =
52 MULTIDIRS =
53 MULTISUBDIR =
54 MULTIDO = true
55 MULTICLEAN = true
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
59 # target.
60 INSTALL = @INSTALL@
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA = @INSTALL_DATA@
64 AR = @AR@
65 AR_FLAGS = rc
67 RANLIB = @RANLIB@
69 CC = @CC@
70 CFLAGS = @CFLAGS@
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
76 # Libtool
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
80 # numbers.
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
84 LIBTOOL = ./libtool
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@
107 .SUFFIXES:
108 .SUFFIXES: .c .m .lo
110 .c.lo:
111 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
113 .m.lo:
114 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
116 # Flags to pass to a recursive make.
117 FLAGS_TO_PASS = \
118 "AR=$(AR)" \
119 "AR_FLAGS=$(AR_FLAGS)" \
120 "CC=$(CC)" \
121 "CFLAGS=$(CFLAGS)" \
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)" \
133 "RANLIB=$(RANLIB)" \
134 "SHELL=$(SHELL)" \
135 "prefix=$(prefix)" \
136 "exec_prefix=$(exec_prefix)" \
137 "libdir=$(libdir)" \
138 "libsubdir=$(libsubdir)" \
139 "tooldir=$(tooldir)"
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 \
148 thr.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
163 runtime-info.h:
164 echo "" > tmp-runtime
165 echo "/* This file is automatically generated */" > $@
166 $(CC1OBJ) $(MULTIFLAGS) -print-objc-runtime-info tmp-runtime >> $@
167 rm -f tmp-runtime
169 archive_gc.lo: archive.c
170 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
171 $(INCLUDES) $<
173 class_gc.lo: class.c
174 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
175 $(INCLUDES) $<
177 encoding_gc.lo: encoding.c
178 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
179 $(INCLUDES) $<
181 gc.lo: gc.c
182 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
184 gc_gc.lo: gc.c
185 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
186 $(INCLUDES) $<
188 hash_gc.lo: hash.c
189 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
190 $(INCLUDES) $<
192 init_gc.lo: init.c
193 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
194 $(INCLUDES) $<
196 linking.lo: linking.m
197 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
198 $(INCLUDES) $<
200 linking_gc.lo: linking.m
201 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
202 $(OBJC_GCFLAGS) $(INCLUDES) $<
204 misc_gc.lo: misc.c
205 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
206 $(INCLUDES) $<
208 nil_method_gc.lo: nil_method.c
209 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
210 $(INCLUDES) $<
212 NXConstStr.lo: NXConstStr.m
213 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
214 $(INCLUDES) $<
216 NXConstStr_gc.lo: NXConstStr.m
217 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
218 $(OBJC_GCFLAGS) $(INCLUDES) $<
220 Object.lo: Object.m
221 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
222 $(INCLUDES) $<
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) \
230 $(INCLUDES) $<
232 Protocol.lo: Protocol.m
233 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
234 $(INCLUDES) $<
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) \
242 $(INCLUDES) $<
244 selector_gc.lo: selector.c
245 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
246 $(INCLUDES) $<
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) \
253 $(INCLUDES) $<
255 thr_gc.lo: thr.c
256 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
257 $(INCLUDES) $<
259 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
260 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
261 $(INCLUDES) $<
263 doc: info dvi html
265 libobjc.la: $(OBJS)
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
304 info:
305 dvi:
306 html:
308 Makefile: Makefile.in config.status
309 $(SHELL) config.status
311 config.status: configure
312 rm -f config.cache
313 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
314 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
316 ${srcdir}/configure: configure.in
317 rm -f config.cache
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.
333 install-headers:
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; \
338 done
340 check uninstall install-strip dist installcheck installdirs:
342 mostlyclean:
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
349 clean: mostlyclean
350 rm -f config.log
351 @$(MULTICLEAN) multi-clean DO=clean
353 distclean: 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