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