* config/h8300/h8300.c (notice_update_cc): Use
[official-gcc.git] / libobjc / Makefile.in
blob2faf269f101193c23a2d4cebefe3b490d66277b6
1 #Makefile for GNU Objective C runtime library.
2 #Copyright (C) 1993, 95-98, 1999, 2001 Free Software Foundation, Inc.
4 #This file is part of GNU CC.
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU General Public License for more details.
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING. If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA. */
21 #This was cribbed from the libchill, libiberty and libstdc++
22 #Makefile.in files. Some of this stuff may be unnecessary and
23 #worthless.
25 SHELL = /bin/sh
26 MAKEOVERRIDES=
28 #### Start of system configuration section. ####
30 srcdir = @glibcpp_srcdir@
31 VPATH = @glibcpp_srcdir@
32 prefix = @prefix@
33 exec_prefix = @exec_prefix@
34 target_alias = @target_alias@
35 gcc_version = @gcc_version@
36 gcc_version_trigger = @gcc_version_trigger@
37 top_srcdir = @top_srcdir@
38 toplevel_srcdir = @toplevel_srcdir@
39 toolexecdir = @glibcpp_toolexecdir@
40 glibcpp_toolexecdir = @glibcpp_toolexecdir@
41 glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
43 top_builddir = .
45 libdir = $(exec_prefix)/lib
46 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
48 # Multilib support variables.
49 MULTISRCTOP =
50 MULTIBUILDTOP =
51 MULTIDIRS =
52 MULTISUBDIR =
53 MULTIDO = true
54 MULTICLEAN = true
56 # Not configured per top-level version, since that doesn't get passed
57 # down at configure time, but overrridden by the top-level install
58 # target.
59 INSTALL = @INSTALL@
60 INSTALL_PROGRAM = @INSTALL_PROGRAM@
61 INSTALL_DATA = @INSTALL_DATA@
63 AR = @AR@
64 AR_FLAGS = rc
66 RANLIB = @RANLIB@
68 CC = @CC@
69 CFLAGS = @CFLAGS@
70 GTHREAD_FLAGS=@GTHREAD_FLAGS@
71 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) \
72 $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS
74 # Libtool
75 # The following strings describe the version of the obj-C library
76 # begin compiled and compatibility issues.
77 # Please refer to Libtool documentation about how to manage these
78 # numbers.
79 LIBOBJC_VERSION = 1:0:0
80 LIBOBJC_GC_VERSION = 1:0:0
81 # @LIBTOOL@ does not get it right, so we hack it in - FIXME
82 LIBTOOL = ./libtool
83 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
84 LIBTOOL_LINK = $(LIBTOOL) --mode=link
85 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
86 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
87 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
90 # Define the cc1obj in terms of the CC that is passed on from higher
91 # level make. This is needed to make sure we can create runtime-info.h
92 # when doing canadian cross builds where running ../../gcc/cc1obj
93 # does not make any sense.
95 CC1OBJ = `$(CC) -print-prog-name=cc1obj`
97 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
98 -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
99 -I$(srcdir)/$(MULTISRCTOP)../include
101 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
102 OBJC_THREAD_FILE=thr-objc
103 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
105 .SUFFIXES:
106 .SUFFIXES: .c .m .lo
108 .c.lo:
109 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
111 .m.lo:
112 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
114 # Flags to pass to a recursive make.
115 FLAGS_TO_PASS = \
116 "AR=$(AR)" \
117 "AR_FLAGS=$(AR_FLAGS)" \
118 "CC=$(CC)" \
119 "CFLAGS=$(CFLAGS)" \
120 "LIBCFLAGS=$(LIBCFLAGS)" \
121 "EXTRA_OFILES=$(EXTRA_OFILES)" \
122 "HDEFINES=$(HDEFINES)" \
123 "INSTALL=$(INSTALL)" \
124 "INSTALL_DATA=$(INSTALL_DATA)" \
125 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
126 "LDFLAGS=$(LDFLAGS)" \
127 "LIBTOOL=$(LIBTOOL)" \
128 "LOADLIBES=$(LOADLIBES)" \
129 "PICFLAG=$(PICFLAG)" \
130 "RANLIB=$(RANLIB)" \
131 "SHELL=$(SHELL)" \
132 "prefix=$(prefix)" \
133 "exec_prefix=$(exec_prefix)" \
134 "libdir=$(libdir)" \
135 "libsubdir=$(libsubdir)" \
136 "tooldir=$(tooldir)"
138 all: libobjc.la $(OBJC_BOEHM_GC)
139 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
141 # User-visible header files.
143 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
144 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
145 thr.h
147 # Modules that comprise the runtime library.
149 OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
150 misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
151 Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
152 $(OBJC_THREAD_FILE).lo
154 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
155 init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
156 NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
157 sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
158 $(OBJC_THREAD_FILE)_gc.lo
160 runtime-info.h:
161 echo "" > tmp-runtime
162 echo "/* This file is automatically generated */" > $@
163 $(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
164 rm -f tmp-runtime
166 archive_gc.lo: archive.c
167 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
168 $(INCLUDES) $<
170 class_gc.lo: class.c
171 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
172 $(INCLUDES) $<
174 encoding_gc.lo: encoding.c
175 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
176 $(INCLUDES) $<
178 gc.lo: gc.c
179 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
181 gc_gc.lo: gc.c
182 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
183 $(INCLUDES) $<
185 hash_gc.lo: hash.c
186 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
187 $(INCLUDES) $<
189 init_gc.lo: init.c
190 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
191 $(INCLUDES) $<
193 linking.lo: linking.m
194 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
195 $(INCLUDES) $<
197 linking_gc.lo: linking.m
198 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
199 $(OBJC_GCFLAGS) $(INCLUDES) $<
201 misc_gc.lo: misc.c
202 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
203 $(INCLUDES) $<
205 nil_method_gc.lo: nil_method.c
206 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
207 $(INCLUDES) $<
209 NXConstStr.lo: NXConstStr.m
210 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
211 $(INCLUDES) $<
213 NXConstStr_gc.lo: NXConstStr.m
214 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
215 $(OBJC_GCFLAGS) $(INCLUDES) $<
217 Object.lo: Object.m
218 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
219 $(INCLUDES) $<
221 Object_gc.lo: Object.m
222 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
223 $(OBJC_GCFLAGS) $(INCLUDES) $<
225 objects_gc.lo: objects.c
226 $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
227 $(INCLUDES) $<
229 Protocol.lo: Protocol.m
230 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
231 $(INCLUDES) $<
233 Protocol_gc.lo: Protocol.m
234 $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
235 $(OBJC_GCFLAGS) $(INCLUDES) $<
237 sarray_gc.lo: sarray.c
238 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
239 $(INCLUDES) $<
241 selector_gc.lo: selector.c
242 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
243 $(INCLUDES) $<
245 sendmsg.lo: sendmsg.c runtime-info.h
246 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
248 sendmsg_gc.lo: sendmsg.c runtime-info.h
249 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
250 $(INCLUDES) $<
252 thr_gc.lo: thr.c
253 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
254 $(INCLUDES) $<
256 $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
257 $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
258 $(INCLUDES) $<
260 doc: info dvi html
262 libobjc.la: $(OBJS)
263 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
264 -rpath $(glibcpp_toolexeclibdir) \
265 -version-info $(LIBOBJC_VERSION)
267 libobjc_gc.la: $(OBJS_GC)
268 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
269 -rpath $(glibcpp_toolexeclibdir) \
270 -version-info $(LIBOBJC_GC_VERSION)
273 # FIXME -- The following part does not fit in the libtool context.
274 # Libtool is supposed to [going to] be able to create a win 32 DLL
275 # without extra code but since I don't have a win machine to test
276 # if it already works, I leave the old code here.
278 libobjc_s.a: libobjc.la
279 mv libobjc.a libobjc_s.a
281 # Create a relocatable DLL
282 libobjc.dll: libobjc_s.a libobjc_entry.o
283 $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
284 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
285 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
286 --base-file libobjc.base --output-exp libobjc.exp
287 $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
288 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
289 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
290 --base-file libobjc.base --output-exp libobjc.exp
291 $(GCC_FOR_TARGET) libobjc.exp -mdll \
292 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
293 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
294 --output-lib libobjc.a
301 info:
302 dvi:
303 html:
305 Makefile: Makefile.in config.status
306 $(SHELL) config.status
308 config.status: configure
309 rm -f config.cache
310 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
311 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
313 ${srcdir}/configure: configure.in
314 rm -f config.cache
315 cd ${srcdir} && autoconf
317 install: install-libs install-headers
319 install-libs: installdirs
320 $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(glibcpp_toolexeclibdir)
321 $(LIBTOOL_INSTALL) $(INSTALL) libobjc.la $(glibcpp_toolexeclibdir);
322 if [ "$(OBJC_BOEHM_GC)" ]; then \
323 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc.la \
324 $(glibcpp_toolexeclibdir);\
326 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
327 @-$(LIBTOOL) --mode=finish $(glibcpp_toolexeclibdir)
329 # Copy Objective C headers to installation include directory.
330 install-headers:
331 $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(libsubdir)/include/objc
332 for file in $(OBJC_H); do \
333 realfile=$(srcdir)/objc/$${file}; \
334 $(INSTALL_DATA) $${realfile} $(libsubdir)/include/objc; \
335 done
337 check uninstall install-strip dist installcheck installdirs:
339 mostlyclean:
340 -$(LIBTOOL_CLEAN) rm -f libobjc.la libobjc_gc.la *.lo
341 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
342 fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
343 *.toc *.tp *.vr *.html libobj.exp
344 @$(MULTICLEAN) multi-clean DO=mostlyclean
346 clean: mostlyclean
347 rm -f config.log
348 @$(MULTICLEAN) multi-clean DO=clean
350 distclean: clean
351 @$(MULTICLEAN) multi-clean DO=distclean
352 rm -f config.cache config.status Makefile configure
354 maintainer-clean realclean: distclean
356 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
357 install-strip dist installcheck installdirs