* maintainer-addresses: New script.
[official-gcc.git] / libobjc / Makefile.in
blob1e6c337a6e04bc21af7da14ad5338b55b4579b16
1 # Makefile for GNU Objective C runtime library.
2 # Copyright (C) 1993, 95-98, 1999, 2001, 2002, 2003
3 # Free Software Foundation, Inc.
5 #This file is part of GCC.
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.
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.
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. */
22 #This was cribbed from the libchill, libiberty and libstdc++
23 #Makefile.in files. Some of this stuff may be unnecessary and
24 #worthless.
26 SHELL = @SHELL@
27 MAKEOVERRIDES=
29 #### Start of system configuration section. ####
31 srcdir = @glibcpp_srcdir@
32 VPATH = @glibcpp_srcdir@
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35 target_alias = @target_alias@
36 gcc_version = @gcc_version@
37 gcc_version_trigger = @gcc_version_trigger@
38 top_srcdir = @top_srcdir@
39 toplevel_srcdir = @toplevel_srcdir@
40 toolexecdir = @glibcpp_toolexecdir@
41 glibcpp_toolexecdir = @glibcpp_toolexecdir@
42 glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
44 top_builddir = .
46 libdir = $(exec_prefix)/lib
47 libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
49 # Multilib support variables.
50 MULTISRCTOP =
51 MULTIBUILDTOP =
52 MULTIDIRS =
53 MULTISUBDIR =
54 MULTIDO = true
55 MULTICLEAN = true
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.
60 INSTALL = @INSTALL@
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA = @INSTALL_DATA@
64 AR = @AR@
65 AR_FLAGS = rc
67 RANLIB = @RANLIB@
69 CC = @CC@
70 CFLAGS = @CFLAGS@
71 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
72 GTHREAD_FLAGS=@GTHREAD_FLAGS@
73 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
74 $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS
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.
81 LIBOBJC_VERSION = 1:0:0
82 LIBOBJC_GC_VERSION = 1:0:0
83 # @LIBTOOL@ does not get it right, so we hack it in - FIXME
84 LIBTOOL = ./libtool
85 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
86 LIBTOOL_LINK = $(LIBTOOL) --mode=link
87 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
88 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
89 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
91 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
92 -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
93 -I$(srcdir)/$(MULTISRCTOP)../include
95 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
96 OBJC_THREAD_FILE=thr-objc
97 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
99 .SUFFIXES:
100 .SUFFIXES: .c .m .lo
102 .c.lo:
103 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
105 .m.lo:
106 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
108 # Flags to pass to a recursive make.
109 FLAGS_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)"
133 all: libobjc.la $(OBJC_BOEHM_GC)
134 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
136 # User-visible header files.
138 OBJC_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
142 # Modules that comprise the runtime library.
144 OBJS = 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
149 OBJS_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
155 runtime-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
161 archive_gc.lo: archive.c
162 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
163 $(INCLUDES) $<
165 class_gc.lo: class.c
166 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
167 $(INCLUDES) $<
169 encoding_gc.lo: encoding.c
170 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
171 $(INCLUDES) $<
173 gc.lo: gc.c
174 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
176 gc_gc.lo: gc.c
177 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
178 $(INCLUDES) $<
180 hash_gc.lo: hash.c
181 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
182 $(INCLUDES) $<
184 init_gc.lo: init.c
185 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
186 $(INCLUDES) $<
188 linking.lo: linking.m
189 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
190 $(INCLUDES) $<
192 linking_gc.lo: linking.m
193 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
194 $(OBJC_GCFLAGS) $(INCLUDES) $<
196 misc_gc.lo: misc.c
197 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
198 $(INCLUDES) $<
200 nil_method_gc.lo: nil_method.c
201 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
202 $(INCLUDES) $<
204 NXConstStr.lo: NXConstStr.m
205 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
206 $(INCLUDES) $<
208 NXConstStr_gc.lo: NXConstStr.m
209 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
210 $(OBJC_GCFLAGS) $(INCLUDES) $<
212 Object.lo: Object.m
213 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
214 $(INCLUDES) $<
216 Object_gc.lo: Object.m
217 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
218 $(OBJC_GCFLAGS) $(INCLUDES) $<
220 objects_gc.lo: objects.c
221 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
222 $(INCLUDES) $<
224 Protocol.lo: Protocol.m
225 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
226 $(INCLUDES) $<
228 Protocol_gc.lo: Protocol.m
229 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
230 $(OBJC_GCFLAGS) $(INCLUDES) $<
232 sarray_gc.lo: sarray.c
233 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
234 $(INCLUDES) $<
236 selector_gc.lo: selector.c
237 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
238 $(INCLUDES) $<
240 sendmsg.lo: sendmsg.c runtime-info.h
241 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
243 sendmsg_gc.lo: sendmsg.c runtime-info.h
244 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
245 $(INCLUDES) $<
247 thr_gc.lo: thr.c
248 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
249 $(INCLUDES) $<
251 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
252 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
253 $(INCLUDES) $<
255 doc: info dvi html
257 libobjc.la: $(OBJS)
258 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
259 -rpath $(glibcpp_toolexeclibdir) \
260 -version-info $(LIBOBJC_VERSION)
262 libobjc_gc.la: $(OBJS_GC)
263 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
264 -rpath $(glibcpp_toolexeclibdir) \
265 -version-info $(LIBOBJC_GC_VERSION)
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.
273 libobjc_s.a: libobjc.la
274 mv libobjc.a libobjc_s.a
276 # Create a relocatable DLL
277 libobjc.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
296 info:
297 dvi:
298 html:
300 Makefile: Makefile.in config.status
301 $(SHELL) config.status
303 config.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
308 ${srcdir}/configure: configure.in
309 rm -f config.cache
310 cd ${srcdir} && autoconf
312 install: install-libs install-headers
314 install-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);\
321 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
322 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(glibcpp_toolexeclibdir)
324 # Copy Objective C headers to installation include directory.
325 install-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
332 check uninstall install-strip dist installcheck installdirs:
334 mostlyclean:
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
341 clean: mostlyclean
342 rm -f config.log
343 @$(MULTICLEAN) multi-clean DO=clean
345 distclean: clean
346 @$(MULTICLEAN) multi-clean DO=distclean
347 rm -f config.cache config.status Makefile configure
349 maintainer-clean realclean: distclean
351 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
352 install-strip dist installcheck installdirs