2017-11-04 Thomas Koenig <tkoenig@gcc.gnu.org>
[official-gcc.git] / libobjc / Makefile.in
blobfebc92d4b3cc449a71156af57ad1aa051f559d0c
1 # Makefile for GNU Objective C runtime library.
2 # Copyright (C) 1993-2017 Free Software Foundation, Inc.
4 #This file is part of GCC.
6 #GCC 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 3, or (at your option)
9 #any later version.
11 #GCC 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 GCC; see the file COPYING3. If not see
18 #<http://www.gnu.org/licenses/>.
20 #This was cribbed from the libchill, libiberty and libstdc++
21 #Makefile.in files. Some of this stuff may be unnecessary and
22 #worthless.
24 SHELL = @SHELL@
25 MAKEOVERRIDES=
27 #### Start of system configuration section. ####
29 srcdir = @glibcpp_srcdir@
30 VPATH = @glibcpp_srcdir@
31 prefix = @prefix@
32 exec_prefix = @exec_prefix@
33 target_noncanonical = @target_noncanonical@
34 gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
35 host_subdir = @host_subdir@
36 top_srcdir = @top_srcdir@
37 multi_basedir = @multi_basedir@
38 toolexecdir = @toolexecdir@
39 # Toolexecdir is used only by toolexeclibdir
40 toolexeclibdir = @toolexeclibdir@
42 includedirname = @includedirname@
43 libsuffix = @libsuffix@
45 lt_host_flags = @lt_host_flags@
46 extra_ldflags_libobjc = @extra_ldflags_libobjc@
48 top_builddir = .
50 libdir = $(exec_prefix)/lib
51 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
53 # Multilib support variables.
54 MULTISRCTOP =
55 MULTIBUILDTOP =
56 MULTIDIRS =
57 MULTISUBDIR =
58 MULTIDO = true
59 MULTICLEAN = true
61 # Not configured per top-level version, since that doesn't get passed
62 # down at configure time, but overrridden by the top-level install
63 # target.
64 INSTALL = @INSTALL@
65 INSTALL_PROGRAM = @INSTALL_PROGRAM@
66 INSTALL_DATA = @INSTALL_DATA@
68 AR = @AR@
69 AR_FLAGS = rc
71 RANLIB = @RANLIB@
73 CC = @CC@
74 CFLAGS = @CFLAGS@
75 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
76 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
77 -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
79 # Libtool
80 # The following strings describe the version of the obj-C library
81 # begin compiled and compatibility issues.
82 # Please refer to Libtool documentation about how to manage these
83 # numbers.
84 LIBOBJC_VERSION = @VERSION@
85 LIBOBJC_GC_VERSION = @VERSION@
86 LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
87 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
88 LIBTOOL_LINK = $(LIBTOOL) --mode=link
89 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
90 LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
91 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
93 OBJC_GCFLAGS=@OBJC_GCFLAGS@
94 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
95 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
96 OBJC_BOEHM_GC_LIBS=@OBJC_BOEHM_GC_LIBS@
98 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
99 -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
100 -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
101 -I$(srcdir)/$(MULTISRCTOP)../libgcc \
102 -I$(MULTIBUILDTOP)../libgcc \
103 -I$(srcdir)/$(MULTISRCTOP)../include \
104 $(OBJC_BOEHM_GC_INCLUDES)
107 ## The list of header/source files
110 # User-visible header files, from the objc/ directory
111 OBJC_H = \
112 objc.h \
113 objc-exception.h \
114 objc-sync.h \
116 NXConstStr.h \
117 Object.h \
118 Protocol.h \
119 message.h \
120 objc-decls.h \
121 runtime.h \
122 thr.h
124 # Objective-C source files to compile
125 OBJC_SOURCE_FILES = \
126 NXConstStr.m \
127 Object.m \
128 Protocol.m \
129 accessors.m \
130 linking.m
132 # C source files to compile
133 C_SOURCE_FILES = \
134 class.c \
135 encoding.c \
136 error.c \
137 gc.c \
138 hash.c \
139 init.c \
140 ivars.c \
141 memory.c \
142 methods.c \
143 nil_method.c \
144 objc-foreach.c \
145 objc-sync.c \
146 objects.c \
147 protocols.c \
148 sarray.c \
149 selector.c \
150 sendmsg.c \
151 thr.c \
152 exception.c
154 # Object files to link (when the library is linked with no GC (Garbage Collection))
155 OBJS = \
156 $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
157 $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
159 # Object files to link (when the library is linked with GC (Garbage Collection))
160 OBJS_GC = \
161 $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
162 $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
166 ## The rules to build
169 # Flags to pass to a recursive make.
170 FLAGS_TO_PASS = \
171 "AR=$(AR)" \
172 "AR_FLAGS=$(AR_FLAGS)" \
173 "CC=$(CC)" \
174 "CFLAGS=$(CFLAGS)" \
175 "DESTDIR=$(DESTDIR)" \
176 "LIBCFLAGS=$(LIBCFLAGS)" \
177 "EXTRA_OFILES=$(EXTRA_OFILES)" \
178 "HDEFINES=$(HDEFINES)" \
179 "INSTALL=$(INSTALL)" \
180 "INSTALL_DATA=$(INSTALL_DATA)" \
181 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
182 "LDFLAGS=$(LDFLAGS)" \
183 "LIBTOOL=$(LIBTOOL)" \
184 "LOADLIBES=$(LOADLIBES)" \
185 "PICFLAG=$(PICFLAG)" \
186 "RANLIB=$(RANLIB)" \
187 "SHELL=$(SHELL)" \
188 "prefix=$(prefix)" \
189 "exec_prefix=$(exec_prefix)" \
190 "libdir=$(libdir)" \
191 "libsubdir=$(libsubdir)" \
192 "tooldir=$(tooldir)"
194 # The 'all' rule must be the first one so that it is executed if
195 # nothing is specified on the command-line.
196 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
197 : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
199 .SUFFIXES:
200 .SUFFIXES: .c .m .lo
202 %.lo: %.c
203 $(LIBTOOL_COMPILE) $(CC) $< -c \
204 $(ALL_CFLAGS) $(INCLUDES) \
205 -o $@
207 %_gc.lo: %.c
208 $(LIBTOOL_COMPILE) $(CC) $< -c \
209 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
210 -o $@
212 %.lo: %.m
213 $(LIBTOOL_COMPILE) $(CC) $< -c \
214 $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
215 -o $@
217 %_gc.lo: %.m
218 $(LIBTOOL_COMPILE) $(CC) $< -c \
219 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
220 -o $@
222 # sendmsg has a special rule because it depends on runtime-info.h.
223 runtime-info.h:
224 echo "" > tmp-runtime.m
225 echo "/* This file is automatically generated */" > $@
226 $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
227 rm -f tmp-runtime.m tmp-runtime.s
229 sendmsg.lo: sendmsg.c runtime-info.h
230 $(LIBTOOL_COMPILE) $(CC) $< -c \
231 $(ALL_CFLAGS) $(INCLUDES) \
232 -o $@
234 sendmsg_gc.lo: sendmsg.c runtime-info.h
235 $(LIBTOOL_COMPILE) $(CC) $< -c \
236 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
237 -o $@
239 # These files have separate rules because they require special
240 # compiler flags.
242 exception.lo: exception.c
243 $(LIBTOOL_COMPILE) $(CC) $< -c \
244 $(ALL_CFLAGS) $(INCLUDES) -fexceptions \
245 -o $@
247 exception_gc.lo: exception.c
248 $(LIBTOOL_COMPILE) $(CC) $< -c \
249 $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \
250 -o $@
252 doc: info dvi pdf html
254 # No install-html or install-pdf support
255 .PHONY: install-html install-pdf install-info
256 install-html:
257 install-pdf:
258 install-info:
260 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
262 libobjc$(libsuffix).la: $(OBJS)
263 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
264 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
265 -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
266 $(LTLDFLAGS)
268 libobjc_gc$(libsuffix).la: $(OBJS_GC)
269 $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
270 -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
271 -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
272 $(LTLDFLAGS)
274 info:
275 dvi:
276 pdf:
277 html:
279 Makefile: Makefile.in config.status
280 $(SHELL) config.status
282 config.status: configure
283 rm -f config.cache
284 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
285 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
287 AUTOCONF = autoconf
288 ACLOCAL = aclocal
289 ACLOCAL_AMFLAGS = -I ../config -I ..
290 aclocal_deps = \
291 $(srcdir)/../config/multi.m4 \
292 $(srcdir)/../config/override.m4 \
293 $(srcdir)/../config/proginstall.m4 \
294 $(srcdir)/../ltoptions.m4 \
295 $(srcdir)/../ltsugar.m4 \
296 $(srcdir)/../ltversion.m4 \
297 $(srcdir)/../lt~obsolete.m4 \
298 $(srcdir)/acinclude.m4
300 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
301 rm -f config.cache
302 cd $(srcdir) && $(AUTOCONF)
304 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
305 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
307 install: install-libs install-headers
309 install-libs: installdirs
310 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
311 $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
312 if [ "$(OBJC_BOEHM_GC)" ]; then \
313 $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
314 $(DESTDIR)$(toolexeclibdir);\
316 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
317 @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
319 # Copy Objective-C headers to installation include directory.
320 install-headers:
321 $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
322 for file in $(OBJC_H); do \
323 realfile=$(srcdir)/objc/$${file}; \
324 $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
325 done
327 check uninstall install-strip dist installcheck installdirs:
329 mostlyclean:
330 -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
331 -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
332 fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
333 *.toc *.tp *.vr *.html libobj.exp
334 @$(MULTICLEAN) multi-clean DO=mostlyclean
336 clean: mostlyclean
337 rm -f config.log
338 @$(MULTICLEAN) multi-clean DO=clean
340 distclean: clean
341 @$(MULTICLEAN) multi-clean DO=distclean
342 rm -f config.cache config.status Makefile configure
344 maintainer-clean realclean: distclean
346 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
347 install-strip dist installcheck installdirs
349 # Don't export variables to the environment, in order to not confuse
350 # configure.
351 .NOEXPORT: