source: trunk/third/gcc/libobjc/Makefile.in @ 21206

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