OSDN Git Service

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