]> git.ipfire.org Git - thirdparty/gcc.git/blob - libobjc/Makefile.in
In libobjc/: 2010-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
[thirdparty/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 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 extra_ldflags_libobjc = @extra_ldflags_libobjc@
47
48 top_builddir = .
49
50 -include ../boehm-gc/threads.mk
51
52 libdir = $(exec_prefix)/lib
53 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
54
55 # Multilib support variables.
56 MULTISRCTOP =
57 MULTIBUILDTOP =
58 MULTIDIRS =
59 MULTISUBDIR =
60 MULTIDO = true
61 MULTICLEAN = true
62
63 # Not configured per top-level version, since that doesn't get passed
64 # down at configure time, but overrridden by the top-level install
65 # target.
66 INSTALL = @INSTALL@
67 INSTALL_PROGRAM = @INSTALL_PROGRAM@
68 INSTALL_DATA = @INSTALL_DATA@
69
70 AR = @AR@
71 AR_FLAGS = rc
72
73 RANLIB = @RANLIB@
74
75 CC = @CC@
76 CFLAGS = @CFLAGS@
77 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
78 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
79 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
80
81 # Libtool
82 # The following strings describe the version of the obj-C library
83 # begin compiled and compatibility issues.
84 # Please refer to Libtool documentation about how to manage these
85 # numbers.
86 LIBOBJC_VERSION = @VERSION@
87 LIBOBJC_GC_VERSION = @VERSION@
88 LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
89 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
90 LIBTOOL_LINK = $(LIBTOOL) --mode=link
91 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
92 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
93 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
94
95 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
96 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
97 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
98 OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
99
100 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
101 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
102 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
103 -I$(srcdir)/$(MULTISRCTOP)../include \
104 $(OBJC_BOEHM_GC_INCLUDES)
105
106 ##
107 ## The list of header/source files
108 ##
109
110 # User-visible header files, from the objc/ directory
111 OBJC_H = \
112 objc.h \
113 objc-exception.h \
114 objc-sync.h \
115 \
116 NXConstStr.h \
117 Object.h \
118 Protocol.h \
119 encoding.h \
120 message.h \
121 objc-api.h \
122 objc-decls.h \
123 runtime.h \
124 thr.h \
125 \
126 hash.h \
127 objc-list.h \
128 sarray.h \
129 typedstream.h
130
131 # User-visible header files containing deprecated APIs, from the
132 # objc/deprecated directory
133 OBJC_DEPRECATED_H = \
134 METHOD_NULL.h \
135 MetaClass.h \
136 Object.h \
137 STR.h \
138 hash.h \
139 objc-list.h \
140 objc_error.h \
141 objc_malloc.h \
142 objc_unexpected_exception.h \
143 objc_valloc.h \
144 sarray.h \
145 struct_objc_class.h \
146 struct_objc_protocol.h \
147 struct_objc_selector.h \
148 typedstream.h
149
150 # Objective-C source files to compile
151 OBJC_SOURCE_FILES = \
152 NXConstStr.m \
153 Object.m \
154 Protocol.m \
155 linking.m
156
157 # C source files to compile
158 C_SOURCE_FILES = \
159 archive.c \
160 class.c \
161 encoding.c \
162 error.c \
163 gc.c \
164 hash.c \
165 init.c \
166 memory.c \
167 nil_method.c \
168 objc-foreach.c \
169 objc-sync.c \
170 objects.c \
171 sarray.c \
172 selector.c \
173 sendmsg.c \
174 thr.c \
175 exception.c
176
177 # Object files to link (when the library is linked with no GC (Garbage Collection))
178 OBJS = \
179 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
180 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
181
182 # Object files to link (when the library is linked with GC (Garbage Collection))
183 OBJS_GC = \
184 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
185 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
186
187
188 ##
189 ## The rules to build
190 ##
191
192 # Flags to pass to a recursive make.
193 FLAGS_TO_PASS = \
194 "AR=$(AR)" \
195 "AR_FLAGS=$(AR_FLAGS)" \
196 "CC=$(CC)" \
197 "CFLAGS=$(CFLAGS)" \
198 "DESTDIR=$(DESTDIR)" \
199 "LIBCFLAGS=$(LIBCFLAGS)" \
200 "EXTRA_OFILES=$(EXTRA_OFILES)" \
201 "HDEFINES=$(HDEFINES)" \
202 "INSTALL=$(INSTALL)" \
203 "INSTALL_DATA=$(INSTALL_DATA)" \
204 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
205 "LDFLAGS=$(LDFLAGS)" \
206 "LIBTOOL=$(LIBTOOL)" \
207 "LOADLIBES=$(LOADLIBES)" \
208 "PICFLAG=$(PICFLAG)" \
209 "RANLIB=$(RANLIB)" \
210 "SHELL=$(SHELL)" \
211 "prefix=$(prefix)" \
212 "exec_prefix=$(exec_prefix)" \
213 "libdir=$(libdir)" \
214 "libsubdir=$(libsubdir)" \
215 "tooldir=$(tooldir)"
216
217 # The 'all' rule must be the first one so that it is executed if
218 # nothing is specified on the command-line.
219 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
220 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
221
222 .SUFFIXES:
223 .SUFFIXES: .c .m .lo
224
225 %.lo: %.c
226 $(LIBTOOL_COMPILE) $(CC) $< -c \
227 $(ALL_CFLAGS) $(INCLUDES) \
228 -o $@
229
230 %_gc.lo: %.c
231 $(LIBTOOL_COMPILE) $(CC) $< -c \
232 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
233 -o $@
234
235 %.lo: %.m
236 $(LIBTOOL_COMPILE) $(CC) $< -c \
237 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
238 -o $@
239
240 %_gc.lo: %.m
241 $(LIBTOOL_COMPILE) $(CC) $< -c \
242 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
243 -o $@
244
245 # sendmsg has a special rule because it depends on runtime-info.h.
246 runtime-info.h:
247 echo "" > tmp-runtime.m
248 echo "/* This file is automatically generated */" > $@
249 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
250 rm -f tmp-runtime.m tmp-runtime.s
251
252 sendmsg.lo: sendmsg.c runtime-info.h
253 $(LIBTOOL_COMPILE) $(CC) $< -c \
254 $(ALL_CFLAGS) $(INCLUDES) \
255 -o $@
256
257 sendmsg_gc.lo: sendmsg.c runtime-info.h
258 $(LIBTOOL_COMPILE) $(CC) $< -c \
259 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
260 -o $@
261
262 # These files have separate rules because they require special
263 # compiler flags.
264 archive.lo: archive.c
265 $(LIBTOOL_COMPILE) $(CC) $< -c \
266 $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
267 -o $@
268
269 archive_gc.lo: archive.c
270 $(LIBTOOL_COMPILE) $(CC) $< -c \
271 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
272 -o $@
273
274 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
275 Object.lo: Object.m
276 $(LIBTOOL_COMPILE) $(CC) $< -c \
277 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
278 -o $@
279
280 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
281 Object_gc.lo: Object.m
282 $(LIBTOOL_COMPILE) $(CC) $< -c \
283 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
284 -o $@
285
286 # -Wno-deprecated-declarations is to silence warnings from using
287 # _objc_unexpected_exception.
288 exception.lo: exception.c
289 $(LIBTOOL_COMPILE) $(CC) $< -c \
290 $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
291 -o $@
292
293 exception_gc.lo: exception.c
294 $(LIBTOOL_COMPILE) $(CC) $< -c \
295 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
296 -o $@
297
298 doc: info dvi pdf html
299
300 # No install-html or install-pdf support
301 .PHONY: install-html install-pdf install-info
302 install-html:
303 install-pdf:
304 install-info:
305
306 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
307
308 libobjc$(libsuffix).la: $(OBJS)
309 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
310 -rpath $(toolexeclibdir) \
311 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
312 $(LTLDFLAGS)
313
314 libobjc_gc$(libsuffix).la: $(OBJS_GC)
315 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
316 -rpath $(toolexeclibdir) \
317 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
318 $(LTLDFLAGS)
319
320 info:
321 dvi:
322 pdf:
323 html:
324
325 Makefile: Makefile.in config.status
326 $(SHELL) config.status
327
328 config.status: configure
329 rm -f config.cache
330 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
331 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
332
333 AUTOCONF = autoconf
334 ACLOCAL = aclocal
335 ACLOCAL_AMFLAGS = -I ../config -I ..
336 aclocal_deps = \
337 $(srcdir)/../config/multi.m4 \
338 $(srcdir)/../config/override.m4 \
339 $(srcdir)/../config/proginstall.m4 \
340 $(srcdir)/../ltoptions.m4 \
341 $(srcdir)/../ltsugar.m4 \
342 $(srcdir)/../ltversion.m4 \
343 $(srcdir)/../lt~obsolete.m4 \
344 $(srcdir)/acinclude.m4
345
346 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
347 rm -f config.cache
348 cd $(srcdir) && $(AUTOCONF)
349
350 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
351 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
352
353 install: install-libs install-headers
354
355 install-libs: installdirs
356 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
357 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
358 if [ "$(OBJC_BOEHM_GC)" ]; then \
359 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
360 $(DESTDIR)$(toolexeclibdir);\
361 fi
362 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
363 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
364
365 # Copy Objective-C headers to installation include directory.
366 install-headers:
367 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
368 for file in $(OBJC_H); do \
369 realfile=$(srcdir)/objc/$${file}; \
370 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
371 done
372 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
373 for file in $(OBJC_DEPRECATED_H); do \
374 realfile=$(srcdir)/objc/deprecated/$${file}; \
375 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
376 done
377
378 check uninstall install-strip dist installcheck installdirs:
379
380 mostlyclean:
381 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
382 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
383 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
384 *.toc *.tp *.vr *.html libobj.exp
385 @$(MULTICLEAN) multi-clean DO=mostlyclean
386
387 clean: mostlyclean
388 rm -f config.log
389 @$(MULTICLEAN) multi-clean DO=clean
390
391 distclean: clean
392 @$(MULTICLEAN) multi-clean DO=distclean
393 rm -f config.cache config.status Makefile configure
394
395 maintainer-clean realclean: distclean
396
397 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
398 install-strip dist installcheck installdirs
399
400 # Don't export variables to the environment, in order to not confuse
401 # configure.
402 .NOEXPORT: