In libobjc/: 2011-06-03 Nicola Pero <nicola.pero@meta-innovation.com>
[gcc.git] / libobjc / Makefile.in
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, 2009, 2010 Free Software Foundation, Inc.
4
5 #This file is part of GCC.
6
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 3, or (at your option)
10 #any later version.
11
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.
16
17 #You should have received a copy of the GNU General Public License
18 #along with GCC; see the file COPYING3. If not see
19 #<http://www.gnu.org/licenses/>.
20
21 #This was cribbed from the libchill, libiberty and libstdc++
22 #Makefile.in files. Some of this stuff may be unnecessary and
23 #worthless.
24
25 SHELL = @SHELL@
26 MAKEOVERRIDES=
27
28 #### Start of system configuration section. ####
29
30 srcdir = @glibcpp_srcdir@
31 VPATH = @glibcpp_srcdir@
32 prefix = @prefix@
33 exec_prefix = @exec_prefix@
34 target_noncanonical = @target_noncanonical@
35 gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
36 host_subdir = @host_subdir@
37 top_srcdir = @top_srcdir@
38 multi_basedir = @multi_basedir@
39 toolexecdir = @toolexecdir@
40 # Toolexecdir is used only by toolexeclibdir
41 toolexeclibdir = @toolexeclibdir@
42
43 includedirname = @includedirname@
44 libsuffix = @libsuffix@
45
46 lt_host_flags = @lt_host_flags@
47 extra_ldflags_libobjc = @extra_ldflags_libobjc@
48
49 top_builddir = .
50
51 -include ../boehm-gc/threads.mk
52
53 libdir = $(exec_prefix)/lib
54 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
55
56 # Multilib support variables.
57 MULTISRCTOP =
58 MULTIBUILDTOP =
59 MULTIDIRS =
60 MULTISUBDIR =
61 MULTIDO = true
62 MULTICLEAN = true
63
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@
70
71 AR = @AR@
72 AR_FLAGS = rc
73
74 RANLIB = @RANLIB@
75
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
81
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@ $(LIBTOOLFLAGS)
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
95
96 OBJC_GCFLAGS=@OBJC_GCFLAGS@
97 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
98 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
99 OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
100
101 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
102 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
103 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
104 -I$(srcdir)/$(MULTISRCTOP)../include \
105 $(OBJC_BOEHM_GC_INCLUDES)
106
107 ##
108 ## The list of header/source files
109 ##
110
111 # User-visible header files, from the objc/ directory
112 OBJC_H = \
113 objc.h \
114 objc-exception.h \
115 objc-sync.h \
116 \
117 NXConstStr.h \
118 Object.h \
119 Protocol.h \
120 encoding.h \
121 message.h \
122 objc-api.h \
123 objc-decls.h \
124 runtime.h \
125 thr.h
126
127 # User-visible header files containing deprecated APIs, from the
128 # objc/deprecated directory
129 OBJC_DEPRECATED_H = \
130 METHOD_NULL.h \
131 MetaClass.h \
132 Object.h \
133 Protocol.h \
134 STR.h \
135 objc_get_uninstalled_dtable.h \
136 objc_malloc.h \
137 objc_msg_sendv.h \
138 objc_object_alloc.h \
139 objc_unexpected_exception.h \
140 objc_valloc.h \
141 struct_objc_category.h \
142 struct_objc_class.h \
143 struct_objc_ivar.h \
144 struct_objc_ivar_list.h \
145 struct_objc_method.h \
146 struct_objc_method_list.h \
147 struct_objc_module.h \
148 struct_objc_protocol.h \
149 struct_objc_protocol_list.h \
150 struct_objc_selector.h \
151 struct_objc_static_instances.h \
152 struct_objc_symtab.h
153
154 # Objective-C source files to compile
155 OBJC_SOURCE_FILES = \
156 NXConstStr.m \
157 Object.m \
158 Protocol.m \
159 accessors.m \
160 linking.m
161
162 # C source files to compile
163 C_SOURCE_FILES = \
164 class.c \
165 encoding.c \
166 error.c \
167 gc.c \
168 hash.c \
169 init.c \
170 ivars.c \
171 memory.c \
172 methods.c \
173 nil_method.c \
174 objc-foreach.c \
175 objc-sync.c \
176 objects.c \
177 protocols.c \
178 sarray.c \
179 selector.c \
180 sendmsg.c \
181 thr.c \
182 exception.c
183
184 # Object files to link (when the library is linked with no GC (Garbage Collection))
185 OBJS = \
186 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
187 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
188
189 # Object files to link (when the library is linked with GC (Garbage Collection))
190 OBJS_GC = \
191 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
192 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
193
194
195 ##
196 ## The rules to build
197 ##
198
199 # Flags to pass to a recursive make.
200 FLAGS_TO_PASS = \
201 "AR=$(AR)" \
202 "AR_FLAGS=$(AR_FLAGS)" \
203 "CC=$(CC)" \
204 "CFLAGS=$(CFLAGS)" \
205 "DESTDIR=$(DESTDIR)" \
206 "LIBCFLAGS=$(LIBCFLAGS)" \
207 "EXTRA_OFILES=$(EXTRA_OFILES)" \
208 "HDEFINES=$(HDEFINES)" \
209 "INSTALL=$(INSTALL)" \
210 "INSTALL_DATA=$(INSTALL_DATA)" \
211 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
212 "LDFLAGS=$(LDFLAGS)" \
213 "LIBTOOL=$(LIBTOOL)" \
214 "LOADLIBES=$(LOADLIBES)" \
215 "PICFLAG=$(PICFLAG)" \
216 "RANLIB=$(RANLIB)" \
217 "SHELL=$(SHELL)" \
218 "prefix=$(prefix)" \
219 "exec_prefix=$(exec_prefix)" \
220 "libdir=$(libdir)" \
221 "libsubdir=$(libsubdir)" \
222 "tooldir=$(tooldir)"
223
224 # The 'all' rule must be the first one so that it is executed if
225 # nothing is specified on the command-line.
226 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
227 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
228
229 .SUFFIXES:
230 .SUFFIXES: .c .m .lo
231
232 %.lo: %.c
233 $(LIBTOOL_COMPILE) $(CC) $< -c \
234 $(ALL_CFLAGS) $(INCLUDES) \
235 -o $@
236
237 %_gc.lo: %.c
238 $(LIBTOOL_COMPILE) $(CC) $< -c \
239 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
240 -o $@
241
242 %.lo: %.m
243 $(LIBTOOL_COMPILE) $(CC) $< -c \
244 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
245 -o $@
246
247 %_gc.lo: %.m
248 $(LIBTOOL_COMPILE) $(CC) $< -c \
249 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
250 -o $@
251
252 # sendmsg has a special rule because it depends on runtime-info.h.
253 runtime-info.h:
254 echo "" > tmp-runtime.m
255 echo "/* This file is automatically generated */" > $@
256 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
257 rm -f tmp-runtime.m tmp-runtime.s
258
259 sendmsg.lo: sendmsg.c runtime-info.h
260 $(LIBTOOL_COMPILE) $(CC) $< -c \
261 $(ALL_CFLAGS) $(INCLUDES) \
262 -o $@
263
264 sendmsg_gc.lo: sendmsg.c runtime-info.h
265 $(LIBTOOL_COMPILE) $(CC) $< -c \
266 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
267 -o $@
268
269 # These files have separate rules because they require special
270 # compiler flags.
271
272 # -Wno-deprecated-declarations is to silence warnings from using
273 # _objc_unexpected_exception.
274 exception.lo: exception.c
275 $(LIBTOOL_COMPILE) $(CC) $< -c \
276 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
277 -o $@
278
279 exception_gc.lo: exception.c
280 $(LIBTOOL_COMPILE) $(CC) $< -c \
281 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
282 -o $@
283
284 doc: info dvi pdf html
285
286 # No install-html or install-pdf support
287 .PHONY: install-html install-pdf install-info
288 install-html:
289 install-pdf:
290 install-info:
291
292 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
293
294 libobjc$(libsuffix).la: $(OBJS)
295 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
296 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
297 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
298 $(LTLDFLAGS)
299
300 libobjc_gc$(libsuffix).la: $(OBJS_GC)
301 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
302 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
303 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
304 $(LTLDFLAGS)
305
306 info:
307 dvi:
308 pdf:
309 html:
310
311 Makefile: Makefile.in config.status
312 $(SHELL) config.status
313
314 config.status: configure
315 rm -f config.cache
316 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
317 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
318
319 AUTOCONF = autoconf
320 ACLOCAL = aclocal
321 ACLOCAL_AMFLAGS = -I ../config -I ..
322 aclocal_deps = \
323 $(srcdir)/../config/multi.m4 \
324 $(srcdir)/../config/override.m4 \
325 $(srcdir)/../config/proginstall.m4 \
326 $(srcdir)/../ltoptions.m4 \
327 $(srcdir)/../ltsugar.m4 \
328 $(srcdir)/../ltversion.m4 \
329 $(srcdir)/../lt~obsolete.m4 \
330 $(srcdir)/acinclude.m4
331
332 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
333 rm -f config.cache
334 cd $(srcdir) && $(AUTOCONF)
335
336 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
337 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
338
339 install: install-libs install-headers
340
341 install-libs: installdirs
342 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
343 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
344 if [ "$(OBJC_BOEHM_GC)" ]; then \
345 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
346 $(DESTDIR)$(toolexeclibdir);\
347 fi
348 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
349 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
350
351 # Copy Objective-C headers to installation include directory.
352 install-headers:
353 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
354 for file in $(OBJC_H); do \
355 realfile=$(srcdir)/objc/$${file}; \
356 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
357 done
358 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
359 for file in $(OBJC_DEPRECATED_H); do \
360 realfile=$(srcdir)/objc/deprecated/$${file}; \
361 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
362 done
363
364 check uninstall install-strip dist installcheck installdirs:
365
366 mostlyclean:
367 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
368 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
369 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
370 *.toc *.tp *.vr *.html libobj.exp
371 @$(MULTICLEAN) multi-clean DO=mostlyclean
372
373 clean: mostlyclean
374 rm -f config.log
375 @$(MULTICLEAN) multi-clean DO=clean
376
377 distclean: clean
378 @$(MULTICLEAN) multi-clean DO=distclean
379 rm -f config.cache config.status Makefile configure
380
381 maintainer-clean realclean: distclean
382
383 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
384 install-strip dist installcheck installdirs
385
386 # Don't export variables to the environment, in order to not confuse
387 # configure.
388 .NOEXPORT: