OSDN Git Service

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