OSDN Git Service

2005-05-25 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.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 GTHREAD_FLAGS=@GTHREAD_FLAGS@
76 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
77         $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing
78
79 # Libtool
80 # The following strings describe the version of the obj-C library 
81 # begin compiled and compatibility issues.
82 # Please refer to Libtool documentation about how to manage these 
83 # numbers.
84 LIBOBJC_VERSION = @VERSION@
85 LIBOBJC_GC_VERSION = @VERSION@
86 LIBTOOL = @LIBTOOL@
87 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
88 LIBTOOL_LINK    = $(LIBTOOL) --mode=link 
89 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
90 LIBTOOL_CLEAN   = $(LIBTOOL) --mode=clean
91 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
92
93 INCLUDES = -I$(srcdir)/objc  -I$(srcdir)/$(MULTISRCTOP)../gcc \
94   -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
95   -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
96   -I$(srcdir)/$(MULTISRCTOP)../include
97
98 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
99 OBJC_THREAD_FILE=thr-objc
100 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
101
102 .SUFFIXES:
103 .SUFFIXES: .c .m .lo
104
105 .c.lo:
106         $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
107
108 .m.lo:
109         $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
110
111 # Flags to pass to a recursive make.
112 FLAGS_TO_PASS = \
113         "AR=$(AR)" \
114         "AR_FLAGS=$(AR_FLAGS)" \
115         "CC=$(CC)" \
116         "CFLAGS=$(CFLAGS)" \
117         "DESTDIR=$(DESTDIR)" \
118         "LIBCFLAGS=$(LIBCFLAGS)" \
119         "EXTRA_OFILES=$(EXTRA_OFILES)" \
120         "HDEFINES=$(HDEFINES)" \
121         "INSTALL=$(INSTALL)" \
122         "INSTALL_DATA=$(INSTALL_DATA)" \
123         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
124         "LDFLAGS=$(LDFLAGS)" \
125         "LIBTOOL=$(LIBTOOL)" \
126         "LOADLIBES=$(LOADLIBES)" \
127         "PICFLAG=$(PICFLAG)" \
128         "RANLIB=$(RANLIB)" \
129         "SHELL=$(SHELL)" \
130         "prefix=$(prefix)" \
131         "exec_prefix=$(exec_prefix)" \
132         "libdir=$(libdir)" \
133         "libsubdir=$(libsubdir)" \
134         "tooldir=$(tooldir)"
135
136 all: libobjc$(libext).la $(OBJC_BOEHM_GC)
137         : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
138
139 # User-visible header files.
140
141 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
142          NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
143          thr.h objc-decls.h
144
145 # Modules that comprise the runtime library.
146
147 OBJS =    archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
148           misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
149           Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
150           $(OBJC_THREAD_FILE).lo exception.lo
151
152 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
153           init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
154           NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
155           sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
156           $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
157
158 runtime-info.h: 
159         echo "" > tmp-runtime.m
160         echo "/* This file is automatically generated */" > $@
161         $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
162         rm -f tmp-runtime.m tmp-runtime.s
163
164 archive_gc.lo: archive.c
165         $(LIBTOOL_COMPILE) $(CC) -c  -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
166                 $(INCLUDES) $<
167
168 class_gc.lo: class.c
169         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
170                 $(INCLUDES) $<
171
172 encoding_gc.lo: encoding.c
173         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
174                 $(INCLUDES) $<
175
176 gc.lo: gc.c
177         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
178
179 gc_gc.lo: gc.c
180         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
181                 $(INCLUDES) $<
182
183 hash_gc.lo: hash.c
184         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
185                 $(INCLUDES) $<
186
187 init_gc.lo: init.c
188         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
189                 $(INCLUDES) $<
190
191 linking.lo: linking.m
192         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
193                 $(INCLUDES) $<
194
195 linking_gc.lo: linking.m
196         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
197                 $(OBJC_GCFLAGS) $(INCLUDES) $<
198
199 misc_gc.lo: misc.c
200         $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
201                 $(INCLUDES) $<
202
203 nil_method_gc.lo: nil_method.c
204         $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
205                 $(INCLUDES) $<
206
207 NXConstStr.lo: NXConstStr.m
208         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
209                 $(INCLUDES) $<
210
211 NXConstStr_gc.lo: NXConstStr.m
212         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
213                 $(OBJC_GCFLAGS) $(INCLUDES) $<
214
215 Object.lo: Object.m
216         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
217                 $(INCLUDES) $<
218
219 Object_gc.lo: Object.m
220         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
221                 $(OBJC_GCFLAGS) $(INCLUDES) $<
222
223 objects_gc.lo: objects.c
224         $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
225                 $(INCLUDES) $<
226
227 Protocol.lo: Protocol.m
228         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
229                 $(INCLUDES) $<
230
231 Protocol_gc.lo: Protocol.m
232         $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
233                 $(OBJC_GCFLAGS) $(INCLUDES) $<
234
235 sarray_gc.lo: sarray.c
236         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
237                 $(INCLUDES) $<
238
239 selector_gc.lo: selector.c
240         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
241                 $(INCLUDES) $<
242
243 sendmsg.lo: sendmsg.c runtime-info.h
244         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
245
246 sendmsg_gc.lo: sendmsg.c runtime-info.h
247         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
248                 $(INCLUDES) $<
249
250 thr_gc.lo: thr.c
251         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
252                 $(INCLUDES) $<
253
254 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
255         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
256                 $(INCLUDES) $<
257
258 exception.lo: exception.c
259         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
260                 -fexceptions $(INCLUDES) $<
261
262 exception_gc.lo: exception.c
263         $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
264                 -fexceptions $(INCLUDES) $<
265
266 doc: info dvi html
267
268 libobjc$(libext).la: $(OBJS)
269         $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
270                 -rpath $(toolexeclibdir) \
271                 -version-info $(LIBOBJC_VERSION)
272
273 libobjc_gc$(libext).la: $(OBJS_GC)
274         $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
275                 -rpath $(toolexeclibdir) \
276                 -version-info $(LIBOBJC_GC_VERSION)
277
278 #
279 # FIXME -- The following part does not fit in the libtool context. 
280 # Libtool is supposed to [going to] be able to create a win 32 DLL 
281 # without extra code but since I don't have a win machine to test 
282 # if it already works, I leave the old code here.
283 #
284 libobjc_s.a: libobjc.la
285         mv libobjc.a libobjc_s.a
286
287 # Create a relocatable DLL
288 libobjc.dll: libobjc_s.a libobjc_entry.o
289         $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
290                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
291         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
292                 --base-file libobjc.base --output-exp libobjc.exp
293         $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
294                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
295         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
296                 --base-file libobjc.base --output-exp libobjc.exp
297         $(GCC_FOR_TARGET) libobjc.exp -mdll \
298                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
299         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
300                 --output-lib libobjc.a
301 #
302 #
303 #
304 #
305 #
306
307 info:
308 dvi:
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 ${srcdir}/configure: @MAINT@ configure.ac
320         rm -f config.cache
321         cd ${srcdir} && autoconf
322
323 install: install-libs install-headers
324
325 install-libs: installdirs
326         $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
327         $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
328         if [ "$(OBJC_BOEHM_GC)" ]; then \
329           $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
330                                 $(DESTDIR)$(toolexeclibdir);\
331         fi
332         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
333         @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
334
335 # Copy Objective C headers to installation include directory.
336 install-headers:
337         $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
338         for file in $(OBJC_H); do \
339           realfile=$(srcdir)/objc/$${file}; \
340           $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
341         done
342
343 check uninstall install-strip dist installcheck installdirs:
344
345 mostlyclean:
346         -$(LIBTOOL_CLEAN) rm -f libobjc$(libext).la libobjc_gc$(libext).la *.lo
347         -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
348                 fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
349                 *.toc *.tp *.vr *.html libobj.exp
350         @$(MULTICLEAN) multi-clean DO=mostlyclean
351
352 clean: mostlyclean
353         rm -f config.log
354         @$(MULTICLEAN) multi-clean DO=clean
355
356 distclean: clean
357         @$(MULTICLEAN) multi-clean DO=distclean
358         rm -f config.cache config.status Makefile configure
359
360 maintainer-clean realclean: distclean
361
362 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
363         install-strip dist installcheck installdirs 
364
365 # Don't export variables to the environment, in order to not confuse
366 # configure.
367 .NOEXPORT: