re PR libobjc/20252 (Libobjc build broken)
[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 # 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 2, 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 COPYING. If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, USA. */
21
22 #This was cribbed from the libchill, libiberty and libstdc++
23 #Makefile.in files. Some of this stuff may be unnecessary and
24 #worthless.
25
26 SHELL = @SHELL@
27 MAKEOVERRIDES=
28
29 #### Start of system configuration section. ####
30
31 srcdir = @glibcpp_srcdir@
32 VPATH = @glibcpp_srcdir@
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35 target_noncanonical = @target_noncanonical@
36 gcc_version = @gcc_version@
37 host_subdir = @host_subdir@
38 top_srcdir = @top_srcdir@
39 toplevel_srcdir = @toplevel_srcdir@
40 toolexecdir = @toolexecdir@
41 # Toolexecdir is used only by toolexeclibdir
42 toolexeclibdir = @toolexeclibdir@
43
44 includedirname = @includedirname@
45 libext = @libext@
46
47 top_builddir = .
48
49 libdir = $(exec_prefix)/lib
50 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
51
52 # Multilib support variables.
53 MULTISRCTOP =
54 MULTIBUILDTOP =
55 MULTIDIRS =
56 MULTISUBDIR =
57 MULTIDO = true
58 MULTICLEAN = true
59
60 # Not configured per top-level version, since that doesn't get passed
61 # down at configure time, but overrridden by the top-level install
62 # target.
63 INSTALL = @INSTALL@
64 INSTALL_PROGRAM = @INSTALL_PROGRAM@
65 INSTALL_DATA = @INSTALL_DATA@
66
67 AR = @AR@
68 AR_FLAGS = rc
69
70 RANLIB = @RANLIB@
71
72 CC = @CC@
73 CFLAGS = @CFLAGS@
74 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
75 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
76 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing
77
78 # Libtool
79 # The following strings describe the version of the obj-C library
80 # begin compiled and compatibility issues.
81 # Please refer to Libtool documentation about how to manage these
82 # numbers.
83 LIBOBJC_VERSION = @VERSION@
84 LIBOBJC_GC_VERSION = @VERSION@
85 LIBTOOL = @LIBTOOL@
86 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
87 LIBTOOL_LINK = $(LIBTOOL) --mode=link
88 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
89 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
90 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
91
92 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
93 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
94 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
95 -I$(srcdir)/$(MULTISRCTOP)../include
96
97 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
98 OBJC_THREAD_FILE=thr-objc
99 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
100
101 .SUFFIXES:
102 .SUFFIXES: .c .m .lo
103
104 .c.lo:
105 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
106
107 .m.lo:
108 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
109
110 # Flags to pass to a recursive make.
111 FLAGS_TO_PASS = \
112 "AR=$(AR)" \
113 "AR_FLAGS=$(AR_FLAGS)" \
114 "CC=$(CC)" \
115 "CFLAGS=$(CFLAGS)" \
116 "DESTDIR=$(DESTDIR)" \
117 "LIBCFLAGS=$(LIBCFLAGS)" \
118 "EXTRA_OFILES=$(EXTRA_OFILES)" \
119 "HDEFINES=$(HDEFINES)" \
120 "INSTALL=$(INSTALL)" \
121 "INSTALL_DATA=$(INSTALL_DATA)" \
122 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
123 "LDFLAGS=$(LDFLAGS)" \
124 "LIBTOOL=$(LIBTOOL)" \
125 "LOADLIBES=$(LOADLIBES)" \
126 "PICFLAG=$(PICFLAG)" \
127 "RANLIB=$(RANLIB)" \
128 "SHELL=$(SHELL)" \
129 "prefix=$(prefix)" \
130 "exec_prefix=$(exec_prefix)" \
131 "libdir=$(libdir)" \
132 "libsubdir=$(libsubdir)" \
133 "tooldir=$(tooldir)"
134
135 all: libobjc$(libext).la $(OBJC_BOEHM_GC)
136 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
137
138 # User-visible header files.
139
140 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
141 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
142 thr.h objc-decls.h
143
144 # Modules that comprise the runtime library.
145
146 OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
147 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
148 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
149 $(OBJC_THREAD_FILE).lo exception.lo
150
151 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
152 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
153 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
154 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
155 $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
156
157 runtime-info.h:
158 echo "" > tmp-runtime.m
159 echo "/* This file is automatically generated */" > $@
160 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
161 rm -f tmp-runtime.m tmp-runtime.s
162
163 archive_gc.lo: archive.c
164 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
165 $(INCLUDES) $<
166
167 class_gc.lo: class.c
168 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
169 $(INCLUDES) $<
170
171 encoding_gc.lo: encoding.c
172 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
173 $(INCLUDES) $<
174
175 gc.lo: gc.c
176 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
177
178 gc_gc.lo: gc.c
179 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
180 $(INCLUDES) $<
181
182 hash_gc.lo: hash.c
183 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
184 $(INCLUDES) $<
185
186 init_gc.lo: init.c
187 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
188 $(INCLUDES) $<
189
190 linking.lo: linking.m
191 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
192 $(INCLUDES) $<
193
194 linking_gc.lo: linking.m
195 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
196 $(OBJC_GCFLAGS) $(INCLUDES) $<
197
198 misc_gc.lo: misc.c
199 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
200 $(INCLUDES) $<
201
202 nil_method_gc.lo: nil_method.c
203 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
204 $(INCLUDES) $<
205
206 NXConstStr.lo: NXConstStr.m
207 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
208 $(INCLUDES) $<
209
210 NXConstStr_gc.lo: NXConstStr.m
211 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
212 $(OBJC_GCFLAGS) $(INCLUDES) $<
213
214 Object.lo: Object.m
215 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
216 $(INCLUDES) $<
217
218 Object_gc.lo: Object.m
219 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
220 $(OBJC_GCFLAGS) $(INCLUDES) $<
221
222 objects_gc.lo: objects.c
223 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
224 $(INCLUDES) $<
225
226 Protocol.lo: Protocol.m
227 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
228 $(INCLUDES) $<
229
230 Protocol_gc.lo: Protocol.m
231 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
232 $(OBJC_GCFLAGS) $(INCLUDES) $<
233
234 sarray_gc.lo: sarray.c
235 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
236 $(INCLUDES) $<
237
238 selector_gc.lo: selector.c
239 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
240 $(INCLUDES) $<
241
242 sendmsg.lo: sendmsg.c runtime-info.h
243 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
244
245 sendmsg_gc.lo: sendmsg.c runtime-info.h
246 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
247 $(INCLUDES) $<
248
249 thr_gc.lo: thr.c
250 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
251 $(INCLUDES) $<
252
253 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
254 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
255 $(INCLUDES) $<
256
257 exception.lo: exception.c
258 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
259 -fexceptions $(INCLUDES) $<
260
261 exception_gc.lo: exception.c
262 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
263 -fexceptions $(INCLUDES) $<
264
265 doc: info dvi html
266
267 libobjc$(libext).la: $(OBJS)
268 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
269 -rpath $(toolexeclibdir) \
270 -version-info $(LIBOBJC_VERSION)
271
272 libobjc_gc$(libext).la: $(OBJS_GC)
273 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
274 -rpath $(toolexeclibdir) \
275 -version-info $(LIBOBJC_GC_VERSION)
276
277 #
278 # FIXME -- The following part does not fit in the libtool context.
279 # Libtool is supposed to [going to] be able to create a win 32 DLL
280 # without extra code but since I don't have a win machine to test
281 # if it already works, I leave the old code here.
282 #
283 libobjc_s.a: libobjc.la
284 mv libobjc.a libobjc_s.a
285
286 # Create a relocatable DLL
287 libobjc.dll: libobjc_s.a libobjc_entry.o
288 $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
289 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
290 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
291 --base-file libobjc.base --output-exp libobjc.exp
292 $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
293 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
294 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
295 --base-file libobjc.base --output-exp libobjc.exp
296 $(GCC_FOR_TARGET) libobjc.exp -mdll \
297 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
298 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
299 --output-lib libobjc.a
300 #
301 #
302 #
303 #
304 #
305
306 info:
307 dvi:
308 html:
309
310 Makefile: Makefile.in config.status
311 $(SHELL) config.status
312
313 config.status: configure
314 rm -f config.cache
315 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
316 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
317
318 ${srcdir}/configure: @MAINT@ configure.ac
319 rm -f config.cache
320 cd ${srcdir} && autoconf
321
322 install: install-libs install-headers
323
324 install-libs: installdirs
325 $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
326 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
327 if [ "$(OBJC_BOEHM_GC)" ]; then \
328 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
329 $(DESTDIR)$(toolexeclibdir);\
330 fi
331 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
332 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
333
334 # Copy Objective C headers to installation include directory.
335 install-headers:
336 $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
337 for file in $(OBJC_H); do \
338 realfile=$(srcdir)/objc/$${file}; \
339 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
340 done
341
342 check uninstall install-strip dist installcheck installdirs:
343
344 mostlyclean:
345 -$(LIBTOOL_CLEAN) rm -f libobjc$(libext).la libobjc_gc$(libext).la *.lo
346 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
347 fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
348 *.toc *.tp *.vr *.html libobj.exp
349 @$(MULTICLEAN) multi-clean DO=mostlyclean
350
351 clean: mostlyclean
352 rm -f config.log
353 @$(MULTICLEAN) multi-clean DO=clean
354
355 distclean: clean
356 @$(MULTICLEAN) multi-clean DO=distclean
357 rm -f config.cache config.status Makefile configure
358
359 maintainer-clean realclean: distclean
360
361 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
362 install-strip dist installcheck installdirs
363
364 # Don't export variables to the environment, in order to not confuse
365 # configure.
366 .NOEXPORT: