2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc.git] / libobjc / Makefile.in
blob0cd77d37bc1df71a63b549e71f35366d7d5635fe
1 # Makefile for GNU Objective C runtime library.
2 # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008 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 -include ../boehm-gc/threads.mk
53 libdir = $(exec_prefix)/lib
54 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
56 # Multilib support variables.
57 MULTISRCTOP =
58 MULTIBUILDTOP =
59 MULTIDIRS =
60 MULTISUBDIR =
61 MULTIDO = true
62 MULTICLEAN = true
64 # Not configured per top-level version, since that doesn't get passed
65 # down at configure time, but overrridden by the top-level install
66 # target.
67 INSTALL = @INSTALL@
68 INSTALL_PROGRAM = @INSTALL_PROGRAM@
69 INSTALL_DATA = @INSTALL_DATA@
71 AR = @AR@
72 AR_FLAGS = rc
74 RANLIB = @RANLIB@
76 CC = @CC@
77 CFLAGS = @CFLAGS@
78 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
79 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
80 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
82 # Libtool
83 # The following strings describe the version of the obj-C library
84 # begin compiled and compatibility issues.
85 # Please refer to Libtool documentation about how to manage these
86 # numbers.
87 LIBOBJC_VERSION = @VERSION@
88 LIBOBJC_GC_VERSION = @VERSION@
89 LIBTOOL = @LIBTOOL@
90 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
91 LIBTOOL_LINK = $(LIBTOOL) --mode=link
92 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
93 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
94 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
96 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
97 OBJC_THREAD_FILE=thr-objc
98 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
99 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
100 OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
102 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
103 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
104 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
105 -I$(srcdir)/$(MULTISRCTOP)../include \
106 $(OBJC_BOEHM_GC_INCLUDES)
109 .SUFFIXES:
110 .SUFFIXES: .c .m .lo
112 .c.lo:
113 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
115 .m.lo:
116 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
118 # Flags to pass to a recursive make.
119 FLAGS_TO_PASS = \
120 "AR=$(AR)" \
121 "AR_FLAGS=$(AR_FLAGS)" \
122 "CC=$(CC)" \
123 "CFLAGS=$(CFLAGS)" \
124 "DESTDIR=$(DESTDIR)" \
125 "LIBCFLAGS=$(LIBCFLAGS)" \
126 "EXTRA_OFILES=$(EXTRA_OFILES)" \
127 "HDEFINES=$(HDEFINES)" \
128 "INSTALL=$(INSTALL)" \
129 "INSTALL_DATA=$(INSTALL_DATA)" \
130 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
131 "LDFLAGS=$(LDFLAGS)" \
132 "LIBTOOL=$(LIBTOOL)" \
133 "LOADLIBES=$(LOADLIBES)" \
134 "PICFLAG=$(PICFLAG)" \
135 "RANLIB=$(RANLIB)" \
136 "SHELL=$(SHELL)" \
137 "prefix=$(prefix)" \
138 "exec_prefix=$(exec_prefix)" \
139 "libdir=$(libdir)" \
140 "libsubdir=$(libsubdir)" \
141 "tooldir=$(tooldir)"
143 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
144 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
146 # User-visible header files.
148 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
149 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
150 thr.h objc-decls.h
152 # Modules that comprise the runtime library.
154 OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
155 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
156 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
157 $(OBJC_THREAD_FILE).lo exception.lo
159 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
160 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
161 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
162 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
163 $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
165 runtime-info.h:
166 echo "" > tmp-runtime.m
167 echo "/* This file is automatically generated */" > $@
168 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
169 rm -f tmp-runtime.m tmp-runtime.s
171 archive_gc.lo: archive.c
172 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
173 $(INCLUDES) $<
175 class_gc.lo: class.c
176 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
177 $(INCLUDES) $<
179 encoding_gc.lo: encoding.c
180 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
181 $(INCLUDES) $<
183 gc.lo: gc.c
184 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
186 gc_gc.lo: gc.c
187 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
188 $(INCLUDES) $<
190 hash_gc.lo: hash.c
191 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
192 $(INCLUDES) $<
194 init_gc.lo: init.c
195 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
196 $(INCLUDES) $<
198 linking.lo: linking.m
199 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
200 $(INCLUDES) $<
202 linking_gc.lo: linking.m
203 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
204 $(OBJC_GCFLAGS) $(INCLUDES) $<
206 misc_gc.lo: misc.c
207 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
208 $(INCLUDES) $<
210 nil_method_gc.lo: nil_method.c
211 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
212 $(INCLUDES) $<
214 NXConstStr.lo: NXConstStr.m
215 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
216 $(INCLUDES) $<
218 NXConstStr_gc.lo: NXConstStr.m
219 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
220 $(OBJC_GCFLAGS) $(INCLUDES) $<
222 Object.lo: Object.m
223 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
224 $(INCLUDES) $<
226 Object_gc.lo: Object.m
227 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
228 $(OBJC_GCFLAGS) $(INCLUDES) $<
230 objects_gc.lo: objects.c
231 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
232 $(INCLUDES) $<
234 Protocol.lo: Protocol.m
235 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
236 $(INCLUDES) $<
238 Protocol_gc.lo: Protocol.m
239 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
240 $(OBJC_GCFLAGS) $(INCLUDES) $<
242 sarray_gc.lo: sarray.c
243 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
244 $(INCLUDES) $<
246 selector_gc.lo: selector.c
247 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
248 $(INCLUDES) $<
250 sendmsg.lo: sendmsg.c runtime-info.h
251 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
253 sendmsg_gc.lo: sendmsg.c runtime-info.h
254 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
255 $(INCLUDES) $<
257 thr_gc.lo: thr.c
258 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
259 $(INCLUDES) $<
261 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
262 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
263 $(INCLUDES) $<
265 exception.lo: exception.c
266 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
267 -fexceptions $(INCLUDES) $<
269 exception_gc.lo: exception.c
270 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
271 -fexceptions $(INCLUDES) $<
273 doc: info dvi pdf html
275 # No install-html or install-pdf support
276 .PHONY: install-html install-pdf install-info
277 install-html:
278 install-pdf:
279 install-info:
281 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
283 libobjc$(libsuffix).la: $(OBJS)
284 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
285 -rpath $(toolexeclibdir) \
286 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
287 $(LTLDFLAGS)
289 libobjc_gc$(libsuffix).la: $(OBJS_GC)
290 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
291 -rpath $(toolexeclibdir) \
292 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
293 $(LTLDFLAGS)
296 # FIXME -- The following part does not fit in the libtool context.
297 # Libtool is supposed to [going to] be able to create a win 32 DLL
298 # without extra code but since I don't have a win machine to test
299 # if it already works, I leave the old code here.
301 libobjc_s.a: libobjc.la
302 mv libobjc.a libobjc_s.a
304 # Create a relocatable DLL
305 libobjc.dll: libobjc_s.a libobjc_entry.o
306 $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
307 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
308 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
309 --base-file libobjc.base --output-exp libobjc.exp
310 $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
311 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
312 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
313 --base-file libobjc.base --output-exp libobjc.exp
314 $(GCC_FOR_TARGET) libobjc.exp -mdll \
315 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
316 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
317 --output-lib libobjc.a
324 info:
325 dvi:
326 pdf:
327 html:
329 Makefile: Makefile.in config.status
330 $(SHELL) config.status
332 config.status: configure
333 rm -f config.cache
334 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
335 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
337 ${srcdir}/configure: @MAINT@ configure.ac
338 rm -f config.cache
339 cd ${srcdir} && autoconf
341 install: install-libs install-headers
343 install-libs: installdirs
344 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
345 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
346 if [ "$(OBJC_BOEHM_GC)" ]; then \
347 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
348 $(DESTDIR)$(toolexeclibdir);\
350 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
351 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
353 # Copy Objective C headers to installation include directory.
354 install-headers:
355 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
356 for file in $(OBJC_H); do \
357 realfile=$(srcdir)/objc/$${file}; \
358 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
359 done
361 check uninstall install-strip dist installcheck installdirs:
363 mostlyclean:
364 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
365 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
366 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
367 *.toc *.tp *.vr *.html libobj.exp
368 @$(MULTICLEAN) multi-clean DO=mostlyclean
370 clean: mostlyclean
371 rm -f config.log
372 @$(MULTICLEAN) multi-clean DO=clean
374 distclean: clean
375 @$(MULTICLEAN) multi-clean DO=distclean
376 rm -f config.cache config.status Makefile configure
378 maintainer-clean realclean: distclean
380 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
381 install-strip dist installcheck installdirs
383 # Don't export variables to the environment, in order to not confuse
384 # configure.
385 .NOEXPORT: