PR c++/5247
[official-gcc.git] / libobjc / Makefile.in
blobbfddff2d24d270bababf68c4c9603271508cab53
1 # Makefile for GNU Objective C runtime library.
2 # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
3 # 2005, 2006 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, 51 Franklin Street, Fifth Floor,
20 #Boston, MA 02110-1301, 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_noncanonical = @target_noncanonical@
36 gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
37 host_subdir = @host_subdir@
38 top_srcdir = @top_srcdir@
39 multi_basedir = @multi_basedir@
40 toolexecdir = @toolexecdir@
41 # Toolexecdir is used only by toolexeclibdir
42 toolexeclibdir = @toolexeclibdir@
44 includedirname = @includedirname@
45 libsuffix = @libsuffix@
47 extra_ldflags_libobjc = @extra_ldflags_libobjc@
49 top_builddir = .
51 libdir = $(exec_prefix)/lib
52 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
54 # Multilib support variables.
55 MULTISRCTOP =
56 MULTIBUILDTOP =
57 MULTIDIRS =
58 MULTISUBDIR =
59 MULTIDO = true
60 MULTICLEAN = true
62 # Not configured per top-level version, since that doesn't get passed
63 # down at configure time, but overrridden by the top-level install
64 # target.
65 INSTALL = @INSTALL@
66 INSTALL_PROGRAM = @INSTALL_PROGRAM@
67 INSTALL_DATA = @INSTALL_DATA@
69 AR = @AR@
70 AR_FLAGS = rc
72 RANLIB = @RANLIB@
74 CC = @CC@
75 CFLAGS = @CFLAGS@
76 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
77 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
78 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
80 # Libtool
81 # The following strings describe the version of the obj-C library
82 # begin compiled and compatibility issues.
83 # Please refer to Libtool documentation about how to manage these
84 # numbers.
85 LIBOBJC_VERSION = @VERSION@
86 LIBOBJC_GC_VERSION = @VERSION@
87 LIBTOOL = @LIBTOOL@
88 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
89 LIBTOOL_LINK = $(LIBTOOL) --mode=link
90 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
91 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
92 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
94 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
95 OBJC_THREAD_FILE=thr-objc
96 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
97 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
99 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
100 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
101 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
102 -I$(srcdir)/$(MULTISRCTOP)../include \
103 $(OBJC_BOEHM_GC_INCLUDES)
106 .SUFFIXES:
107 .SUFFIXES: .c .m .lo
109 .c.lo:
110 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
112 .m.lo:
113 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
115 # Flags to pass to a recursive make.
116 FLAGS_TO_PASS = \
117 "AR=$(AR)" \
118 "AR_FLAGS=$(AR_FLAGS)" \
119 "CC=$(CC)" \
120 "CFLAGS=$(CFLAGS)" \
121 "DESTDIR=$(DESTDIR)" \
122 "LIBCFLAGS=$(LIBCFLAGS)" \
123 "EXTRA_OFILES=$(EXTRA_OFILES)" \
124 "HDEFINES=$(HDEFINES)" \
125 "INSTALL=$(INSTALL)" \
126 "INSTALL_DATA=$(INSTALL_DATA)" \
127 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
128 "LDFLAGS=$(LDFLAGS)" \
129 "LIBTOOL=$(LIBTOOL)" \
130 "LOADLIBES=$(LOADLIBES)" \
131 "PICFLAG=$(PICFLAG)" \
132 "RANLIB=$(RANLIB)" \
133 "SHELL=$(SHELL)" \
134 "prefix=$(prefix)" \
135 "exec_prefix=$(exec_prefix)" \
136 "libdir=$(libdir)" \
137 "libsubdir=$(libsubdir)" \
138 "tooldir=$(tooldir)"
140 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
141 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
143 # User-visible header files.
145 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
146 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
147 thr.h objc-decls.h
149 # Modules that comprise the runtime library.
151 OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
152 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
153 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
154 $(OBJC_THREAD_FILE).lo exception.lo
156 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
157 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
158 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
159 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
160 $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
162 runtime-info.h:
163 echo "" > tmp-runtime.m
164 echo "/* This file is automatically generated */" > $@
165 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
166 rm -f tmp-runtime.m tmp-runtime.s
168 archive_gc.lo: archive.c
169 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
170 $(INCLUDES) $<
172 class_gc.lo: class.c
173 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
174 $(INCLUDES) $<
176 encoding_gc.lo: encoding.c
177 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
178 $(INCLUDES) $<
180 gc.lo: gc.c
181 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
183 gc_gc.lo: gc.c
184 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
185 $(INCLUDES) $<
187 hash_gc.lo: hash.c
188 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
189 $(INCLUDES) $<
191 init_gc.lo: init.c
192 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
193 $(INCLUDES) $<
195 linking.lo: linking.m
196 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
197 $(INCLUDES) $<
199 linking_gc.lo: linking.m
200 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
201 $(OBJC_GCFLAGS) $(INCLUDES) $<
203 misc_gc.lo: misc.c
204 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
205 $(INCLUDES) $<
207 nil_method_gc.lo: nil_method.c
208 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
209 $(INCLUDES) $<
211 NXConstStr.lo: NXConstStr.m
212 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
213 $(INCLUDES) $<
215 NXConstStr_gc.lo: NXConstStr.m
216 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
217 $(OBJC_GCFLAGS) $(INCLUDES) $<
219 Object.lo: Object.m
220 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
221 $(INCLUDES) $<
223 Object_gc.lo: Object.m
224 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
225 $(OBJC_GCFLAGS) $(INCLUDES) $<
227 objects_gc.lo: objects.c
228 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
229 $(INCLUDES) $<
231 Protocol.lo: Protocol.m
232 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
233 $(INCLUDES) $<
235 Protocol_gc.lo: Protocol.m
236 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
237 $(OBJC_GCFLAGS) $(INCLUDES) $<
239 sarray_gc.lo: sarray.c
240 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
241 $(INCLUDES) $<
243 selector_gc.lo: selector.c
244 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
245 $(INCLUDES) $<
247 sendmsg.lo: sendmsg.c runtime-info.h
248 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
250 sendmsg_gc.lo: sendmsg.c runtime-info.h
251 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
252 $(INCLUDES) $<
254 thr_gc.lo: thr.c
255 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
256 $(INCLUDES) $<
258 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
259 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
260 $(INCLUDES) $<
262 exception.lo: exception.c
263 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
264 -fexceptions $(INCLUDES) $<
266 exception_gc.lo: exception.c
267 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
268 -fexceptions $(INCLUDES) $<
270 doc: info dvi pdf html
272 # No install-html or install-pdf support
273 .PHONY: install-html install-pdf
274 install-html:
275 install-pdf:
277 libobjc$(libsuffix).la: $(OBJS)
278 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
279 -rpath $(toolexeclibdir) \
280 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc)
282 libobjc_gc$(libsuffix).la: $(OBJS_GC)
283 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
284 -rpath $(toolexeclibdir) \
285 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc)
288 # FIXME -- The following part does not fit in the libtool context.
289 # Libtool is supposed to [going to] be able to create a win 32 DLL
290 # without extra code but since I don't have a win machine to test
291 # if it already works, I leave the old code here.
293 libobjc_s.a: libobjc.la
294 mv libobjc.a libobjc_s.a
296 # Create a relocatable DLL
297 libobjc.dll: libobjc_s.a libobjc_entry.o
298 $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
299 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
300 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
301 --base-file libobjc.base --output-exp libobjc.exp
302 $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
303 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
304 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
305 --base-file libobjc.base --output-exp libobjc.exp
306 $(GCC_FOR_TARGET) libobjc.exp -mdll \
307 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
308 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
309 --output-lib libobjc.a
316 info:
317 dvi:
318 pdf:
319 html:
321 Makefile: Makefile.in config.status
322 $(SHELL) config.status
324 config.status: configure
325 rm -f config.cache
326 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
327 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
329 ${srcdir}/configure: @MAINT@ configure.ac
330 rm -f config.cache
331 cd ${srcdir} && autoconf
333 install: install-libs install-headers
335 install-libs: installdirs
336 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
337 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
338 if [ "$(OBJC_BOEHM_GC)" ]; then \
339 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
340 $(DESTDIR)$(toolexeclibdir);\
342 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
343 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
345 # Copy Objective C headers to installation include directory.
346 install-headers:
347 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
348 for file in $(OBJC_H); do \
349 realfile=$(srcdir)/objc/$${file}; \
350 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
351 done
353 check uninstall install-strip dist installcheck installdirs:
355 mostlyclean:
356 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
357 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
358 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
359 *.toc *.tp *.vr *.html libobj.exp
360 @$(MULTICLEAN) multi-clean DO=mostlyclean
362 clean: mostlyclean
363 rm -f config.log
364 @$(MULTICLEAN) multi-clean DO=clean
366 distclean: clean
367 @$(MULTICLEAN) multi-clean DO=distclean
368 rm -f config.cache config.status Makefile configure
370 maintainer-clean realclean: distclean
372 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
373 install-strip dist installcheck installdirs
375 # Don't export variables to the environment, in order to not confuse
376 # configure.
377 .NOEXPORT: