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