xref: /netbsd-src/external/gpl3/gcc/dist/libobjc/Makefile.in (revision 7788a0781fe6ff2cce37368b4578a7ade0850cb1)
1# Makefile for GNU Objective C runtime library.
2# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
3# 2005, 2006, 2007, 2008, 2009 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 3, 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 COPYING3.  If not see
19#<http://www.gnu.org/licenses/>.
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
25SHELL = @SHELL@
26MAKEOVERRIDES=
27
28#### Start of system configuration section. ####
29
30srcdir = @glibcpp_srcdir@
31VPATH = @glibcpp_srcdir@
32prefix = @prefix@
33exec_prefix = @exec_prefix@
34target_noncanonical = @target_noncanonical@
35gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
36host_subdir = @host_subdir@
37top_srcdir = @top_srcdir@
38multi_basedir = @multi_basedir@
39toolexecdir = @toolexecdir@
40# Toolexecdir is used only by toolexeclibdir
41toolexeclibdir = @toolexeclibdir@
42
43includedirname = @includedirname@
44libsuffix = @libsuffix@
45
46extra_ldflags_libobjc = @extra_ldflags_libobjc@
47
48top_builddir = .
49
50-include ../boehm-gc/threads.mk
51
52libdir = $(exec_prefix)/lib
53libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
54
55# Multilib support variables.
56MULTISRCTOP =
57MULTIBUILDTOP =
58MULTIDIRS =
59MULTISUBDIR =
60MULTIDO = true
61MULTICLEAN = true
62
63# Not configured per top-level version, since that doesn't get passed
64# down at configure time, but overrridden by the top-level install
65# target.
66INSTALL = @INSTALL@
67INSTALL_PROGRAM = @INSTALL_PROGRAM@
68INSTALL_DATA = @INSTALL_DATA@
69
70AR = @AR@
71AR_FLAGS = rc
72
73RANLIB = @RANLIB@
74
75CC = @CC@
76CFLAGS = @CFLAGS@
77WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
78ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
79	-DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
80
81# Libtool
82# The following strings describe the version of the obj-C library
83# begin compiled and compatibility issues.
84# Please refer to Libtool documentation about how to manage these
85# numbers.
86LIBOBJC_VERSION = @VERSION@
87LIBOBJC_GC_VERSION = @VERSION@
88LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
89LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
90LIBTOOL_LINK    = $(LIBTOOL) --mode=link
91LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
92LIBTOOL_CLEAN   = $(LIBTOOL) --mode=clean
93#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
94
95OBJC_GCFLAGS=-DOBJC_WITH_GC=1
96OBJC_THREAD_FILE=thr-objc
97OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
98OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
99OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
100
101INCLUDES = -I$(srcdir)/objc  -I$(srcdir)/$(MULTISRCTOP)../gcc \
102  -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
103  -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
104  -I$(srcdir)/$(MULTISRCTOP)../include \
105  $(OBJC_BOEHM_GC_INCLUDES)
106
107
108.SUFFIXES:
109.SUFFIXES: .c .m .lo
110
111.c.lo:
112	$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
113
114.m.lo:
115	$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
116
117# Flags to pass to a recursive make.
118FLAGS_TO_PASS = \
119	"AR=$(AR)" \
120	"AR_FLAGS=$(AR_FLAGS)" \
121	"CC=$(CC)" \
122	"CFLAGS=$(CFLAGS)" \
123	"DESTDIR=$(DESTDIR)" \
124	"LIBCFLAGS=$(LIBCFLAGS)" \
125	"EXTRA_OFILES=$(EXTRA_OFILES)" \
126	"HDEFINES=$(HDEFINES)" \
127	"INSTALL=$(INSTALL)" \
128	"INSTALL_DATA=$(INSTALL_DATA)" \
129	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
130	"LDFLAGS=$(LDFLAGS)" \
131	"LIBTOOL=$(LIBTOOL)" \
132	"LOADLIBES=$(LOADLIBES)" \
133	"PICFLAG=$(PICFLAG)" \
134	"RANLIB=$(RANLIB)" \
135	"SHELL=$(SHELL)" \
136	"prefix=$(prefix)" \
137	"exec_prefix=$(exec_prefix)" \
138	"libdir=$(libdir)" \
139	"libsubdir=$(libsubdir)" \
140	"tooldir=$(tooldir)"
141
142all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
143	: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
144
145# User-visible header files.
146
147OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
148	 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
149	 thr.h objc-decls.h
150
151# Modules that comprise the runtime library.
152
153OBJS =    archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
154	  misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
155	  Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
156	  $(OBJC_THREAD_FILE).lo exception.lo
157
158OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
159	  init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
160	  NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
161	  sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
162	  $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
163
164runtime-info.h:
165	echo "" > tmp-runtime.m
166	echo "/* This file is automatically generated */" > $@
167	$(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
168	rm -f tmp-runtime.m tmp-runtime.s
169
170archive_gc.lo: archive.c
171	$(LIBTOOL_COMPILE) $(CC) -c  -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
172		$(INCLUDES) $<
173
174class_gc.lo: class.c
175	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
176		$(INCLUDES) $<
177
178encoding_gc.lo: encoding.c
179	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
180		$(INCLUDES) $<
181
182gc.lo: gc.c
183	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
184
185gc_gc.lo: gc.c
186	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
187		$(INCLUDES) $<
188
189hash_gc.lo: hash.c
190	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
191		$(INCLUDES) $<
192
193init_gc.lo: init.c
194	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
195		$(INCLUDES) $<
196
197linking.lo: linking.m
198	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
199		$(INCLUDES) $<
200
201linking_gc.lo: linking.m
202	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
203		$(OBJC_GCFLAGS) $(INCLUDES) $<
204
205misc_gc.lo: misc.c
206	$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
207		$(INCLUDES) $<
208
209nil_method_gc.lo: nil_method.c
210	$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
211		$(INCLUDES) $<
212
213NXConstStr.lo: NXConstStr.m
214	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
215		$(INCLUDES) $<
216
217NXConstStr_gc.lo: NXConstStr.m
218	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
219		$(OBJC_GCFLAGS) $(INCLUDES) $<
220
221Object.lo: Object.m
222	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
223		$(INCLUDES) $<
224
225Object_gc.lo: Object.m
226	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
227		$(OBJC_GCFLAGS) $(INCLUDES) $<
228
229objects_gc.lo: objects.c
230	$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
231		$(INCLUDES) $<
232
233Protocol.lo: Protocol.m
234	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
235		$(INCLUDES) $<
236
237Protocol_gc.lo: Protocol.m
238	$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
239		$(OBJC_GCFLAGS) $(INCLUDES) $<
240
241sarray_gc.lo: sarray.c
242	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
243		$(INCLUDES) $<
244
245selector_gc.lo: selector.c
246	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
247		$(INCLUDES) $<
248
249sendmsg.lo: sendmsg.c runtime-info.h
250	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
251
252sendmsg_gc.lo: sendmsg.c runtime-info.h
253	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
254		$(INCLUDES) $<
255
256thr_gc.lo: thr.c
257	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
258		$(INCLUDES) $<
259
260$(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
261	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
262		$(INCLUDES) $<
263
264exception.lo: exception.c
265	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
266		-fexceptions $(INCLUDES) $<
267
268exception_gc.lo: exception.c
269	$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
270		-fexceptions $(INCLUDES) $<
271
272doc: info dvi pdf html
273
274# No install-html or install-pdf support
275.PHONY: install-html install-pdf install-info
276install-html:
277install-pdf:
278install-info:
279
280LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
281
282libobjc$(libsuffix).la: $(OBJS)
283	$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
284		-rpath $(toolexeclibdir) \
285		-version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
286		$(LTLDFLAGS)
287
288libobjc_gc$(libsuffix).la: $(OBJS_GC)
289	$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
290		-rpath $(toolexeclibdir) \
291		-version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
292		$(LTLDFLAGS)
293
294info:
295dvi:
296pdf:
297html:
298
299Makefile: Makefile.in config.status
300	$(SHELL) config.status
301
302config.status: configure
303	rm -f config.cache
304	CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
305	CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
306
307AUTOCONF = autoconf
308ACLOCAL = aclocal
309ACLOCAL_AMFLAGS = -I ../config -I ..
310aclocal_deps = \
311	$(srcdir)/../config/multi.m4 \
312	$(srcdir)/../config/override.m4 \
313	$(srcdir)/../config/proginstall.m4 \
314	$(srcdir)/../ltoptions.m4 \
315	$(srcdir)/../ltsugar.m4 \
316	$(srcdir)/../ltversion.m4 \
317	$(srcdir)/../lt~obsolete.m4 \
318	$(srcdir)/acinclude.m4
319
320$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
321	rm -f config.cache
322	cd $(srcdir) && $(AUTOCONF)
323
324$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
325	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
326
327install: install-libs install-headers
328
329install-libs: installdirs
330	$(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
331	$(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
332	if [ "$(OBJC_BOEHM_GC)" ]; then \
333	  $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
334				$(DESTDIR)$(toolexeclibdir);\
335	fi
336	$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
337	@-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
338
339# Copy Objective C headers to installation include directory.
340install-headers:
341	$(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
342	for file in $(OBJC_H); do \
343	  realfile=$(srcdir)/objc/$${file}; \
344	  $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
345	done
346
347check uninstall install-strip dist installcheck installdirs:
348
349mostlyclean:
350	-$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
351	-rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
352		fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
353		*.toc *.tp *.vr *.html libobj.exp
354	@$(MULTICLEAN) multi-clean DO=mostlyclean
355
356clean: mostlyclean
357	rm -f config.log
358	@$(MULTICLEAN) multi-clean DO=clean
359
360distclean: clean
361	@$(MULTICLEAN) multi-clean DO=distclean
362	rm -f config.cache config.status Makefile configure
363
364maintainer-clean realclean: distclean
365
366.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
367	install-strip dist installcheck installdirs
368
369# Don't export variables to the environment, in order to not confuse
370# configure.
371.NOEXPORT:
372