a47f7ea344b17c9f7f058ad9249aa57ff73d273b
[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)/objc -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 .SUFFIXES:
108 .SUFFIXES: .c .m .lo
109
110 .c.lo:
111 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
112
113 .m.lo:
114 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
115
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)"
140
141 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
142 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
143
144 # User-visible header files, from the objc/ directory
145
146 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h objc-exception.h \
147 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
148 thr.h objc-decls.h
149
150 # User-visible header files containing deprecated APIs, from the
151 # objc/deprecated directory
152
153 OBJC_DEPRECATED_H = Object.h objc-unexpected-exception.h \
154 typedstream.h
155
156 # Modules that comprise the runtime library.
157
158 OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
159 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
160 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
161 exception.lo
162
163 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
164 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
165 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
166 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
167 exception_gc.lo
168
169 runtime-info.h:
170 echo "" > tmp-runtime.m
171 echo "/* This file is automatically generated */" > $@
172 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
173 rm -f tmp-runtime.m tmp-runtime.s
174
175 archive_gc.lo: archive.c
176 $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c -o $@ $(ALL_CFLAGS) \
177 $(OBJC_GCFLAGS) $(INCLUDES) $<
178
179 archive.lo: archive.c
180 $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c $(ALL_CFLAGS) \
181 $(INCLUDES) $<
182
183 class_gc.lo: class.c
184 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
185 $(INCLUDES) $<
186
187 encoding_gc.lo: encoding.c
188 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
189 $(INCLUDES) $<
190
191 gc.lo: gc.c
192 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
193
194 gc_gc.lo: gc.c
195 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
196 $(INCLUDES) $<
197
198 hash_gc.lo: hash.c
199 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
200 $(INCLUDES) $<
201
202 init_gc.lo: init.c
203 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
204 $(INCLUDES) $<
205
206 linking.lo: linking.m
207 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
208 $(INCLUDES) $<
209
210 linking_gc.lo: linking.m
211 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
212 $(OBJC_GCFLAGS) $(INCLUDES) $<
213
214 misc_gc.lo: misc.c
215 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
216 $(INCLUDES) $<
217
218 nil_method_gc.lo: nil_method.c
219 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
220 $(INCLUDES) $<
221
222 NXConstStr.lo: NXConstStr.m
223 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
224 $(INCLUDES) $<
225
226 NXConstStr_gc.lo: NXConstStr.m
227 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
228 $(OBJC_GCFLAGS) $(INCLUDES) $<
229
230 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
231 Object.lo: Object.m
232 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
233 -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
234
235 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
236 Object_gc.lo: Object.m
237 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
238 -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
239
240 objects_gc.lo: objects.c
241 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
242 $(INCLUDES) $<
243
244 Protocol.lo: Protocol.m
245 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
246 $(INCLUDES) $<
247
248 Protocol_gc.lo: Protocol.m
249 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
250 $(OBJC_GCFLAGS) $(INCLUDES) $<
251
252 sarray_gc.lo: sarray.c
253 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
254 $(INCLUDES) $<
255
256 selector_gc.lo: selector.c
257 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
258 $(INCLUDES) $<
259
260 sendmsg.lo: sendmsg.c runtime-info.h
261 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
262
263 sendmsg_gc.lo: sendmsg.c runtime-info.h
264 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
265 $(INCLUDES) $<
266
267 thr_gc.lo: thr.c
268 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
269 $(INCLUDES) $<
270
271 # -Wno-deprecated-declarations is to silence warnings from using
272 # _objc_unexpected_exception.
273 exception.lo: exception.c
274 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
275 -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
276
277 exception_gc.lo: exception.c
278 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
279 -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
280
281 doc: info dvi pdf html
282
283 # No install-html or install-pdf support
284 .PHONY: install-html install-pdf install-info
285 install-html:
286 install-pdf:
287 install-info:
288
289 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
290
291 libobjc$(libsuffix).la: $(OBJS)
292 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
293 -rpath $(toolexeclibdir) \
294 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
295 $(LTLDFLAGS)
296
297 libobjc_gc$(libsuffix).la: $(OBJS_GC)
298 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
299 -rpath $(toolexeclibdir) \
300 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
301 $(LTLDFLAGS)
302
303 info:
304 dvi:
305 pdf:
306 html:
307
308 Makefile: Makefile.in config.status
309 $(SHELL) config.status
310
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
315
316 AUTOCONF = autoconf
317 ACLOCAL = aclocal
318 ACLOCAL_AMFLAGS = -I ../config -I ..
319 aclocal_deps = \
320 $(srcdir)/../config/multi.m4 \
321 $(srcdir)/../config/override.m4 \
322 $(srcdir)/../config/proginstall.m4 \
323 $(srcdir)/../ltoptions.m4 \
324 $(srcdir)/../ltsugar.m4 \
325 $(srcdir)/../ltversion.m4 \
326 $(srcdir)/../lt~obsolete.m4 \
327 $(srcdir)/acinclude.m4
328
329 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
330 rm -f config.cache
331 cd $(srcdir) && $(AUTOCONF)
332
333 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
334 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
335
336 install: install-libs install-headers
337
338 install-libs: installdirs
339 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
340 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
341 if [ "$(OBJC_BOEHM_GC)" ]; then \
342 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
343 $(DESTDIR)$(toolexeclibdir);\
344 fi
345 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
346 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
347
348 # Copy Objective C headers to installation include directory.
349 install-headers:
350 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
351 for file in $(OBJC_H); do \
352 realfile=$(srcdir)/objc/$${file}; \
353 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
354 done
355 $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
356 for file in $(OBJC_DEPRECATED_H); do \
357 realfile=$(srcdir)/objc/deprecated/$${file}; \
358 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
359 done
360
361 check uninstall install-strip dist installcheck installdirs:
362
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
369
370 clean: mostlyclean
371 rm -f config.log
372 @$(MULTICLEAN) multi-clean DO=clean
373
374 distclean: clean
375 @$(MULTICLEAN) multi-clean DO=distclean
376 rm -f config.cache config.status Makefile configure
377
378 maintainer-clean realclean: distclean
379
380 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
381 install-strip dist installcheck installdirs
382
383 # Don't export variables to the environment, in order to not confuse
384 # configure.
385 .NOEXPORT: