* sh.md (mulsi3): Don't add a no-op move at the end.
[official-gcc.git] / libobjc / Makefile.in
blob3bc11dc9427b5f00da10e87c55e9ad4d4bddd1b6
1 #Makefile for GNU Objective C runtime library.
2 #Copyright (C) 1993, 95-97, 1998 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
27 #### Start of system configuration section. ####
29 srcdir = @srcdir@
30 VPATH = @srcdir@
31 prefix = @prefix@
32 exec_prefix = @exec_prefix@
33 target_alias = @target_alias@
34 gcc_version = @gcc_version@
35 gcc_version_trigger = @gcc_version_trigger@
37 libdir = $(exec_prefix)/lib
38 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
39 incinstalldir = $(libsubdir)/include
41 # Multilib support variables.
42 MULTISRCTOP =
43 MULTIBUILDTOP =
44 MULTIDIRS =
45 MULTISUBDIR =
46 MULTIDO = true
47 MULTICLEAN = true
49 # Not configured per top-level version, since that doesn't get passed
50 # down at configure time, but overrridden by the top-level install
51 # target.
52 INSTALL = @INSTALL@
53 INSTALL_PROGRAM = @INSTALL_PROGRAM@
54 INSTALL_DATA = @INSTALL_DATA@
56 AR = @AR@
57 AR_FLAGS = rc
59 RANLIB = @RANLIB@
61 CC = @CC@
62 CFLAGS = @CFLAGS@
63 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) -DIN_GCC
66 # Define the cc1obj in terms of the CC that is passed on from higher
67 # level make. This is needed to make sure we can create runtime-info.h
68 # when doing canadian cross builds where running ../../gcc/cc1obj
69 # does not make any sense.
71 CC1OBJ = `$(CC) -print-prog-name=cc1obj`
73 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
74 -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
75 -I$(srcdir)/$(MULTISRCTOP)../include
77 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
78 OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@
80 .SUFFIXES:
81 .SUFFIXES: .c .m .o
83 .c.o:
84 $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
86 .m.o:
87 $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
89 # Flags to pass to a recursive make.
90 FLAGS_TO_PASS = \
91 "AR=$(AR)" \
92 "AR_FLAGS=$(AR_FLAGS)" \
93 "CC=$(CC)" \
94 "CFLAGS=$(CFLAGS)" \
95 "LIBCFLAGS=$(LIBCFLAGS)" \
96 "EXTRA_OFILES=$(EXTRA_OFILES)" \
97 "HDEFINES=$(HDEFINES)" \
98 "INSTALL=$(INSTALL)" \
99 "INSTALL_DATA=$(INSTALL_DATA)" \
100 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
101 "LDFLAGS=$(LDFLAGS)" \
102 "LOADLIBES=$(LOADLIBES)" \
103 "PICFLAG=$(PICFLAG)" \
104 "RANLIB=$(RANLIB)" \
105 "SHELL=$(SHELL)"
107 all: libobjc.a @OBJC_BOEHM_GC@
108 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
110 # User-visible header files.
112 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
113 NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
114 thr.h
116 # Modules that comprise the runtime library.
118 OBJS = archive.o class.o encoding.o gc.o hash.o init.o linking.o \
119 misc.o nil_method.o NXConstStr.o Object.o objects.o \
120 Protocol.o sarray.o selector.o sendmsg.o thr.o \
121 $(OBJC_THREAD_FILE).o
123 OBJS_GC = archive_gc.o class_gc.o encoding_gc.o gc_gc.o hash_gc.o \
124 init_gc.o linking_gc.o misc_gc.o nil_method_gc.o \
125 NXConstStr_gc.o Object_gc.o objects_gc.o Protocol_gc.o \
126 sarray_gc.o selector_gc.o sendmsg_gc.o thr_gc.o \
127 $(OBJC_THREAD_FILE)_gc.o
129 runtime-info.h:
130 echo "" > tmp-runtime
131 echo "/* This file is automatically generated */" > $@
132 $(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
133 rm -f tmp-runtime
135 archive_gc.o: archive.c
136 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
138 class_gc.o: class.c
139 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
141 encoding_gc.o: encoding.c
142 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
144 gc.o: gc.c
145 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
147 gc_gc.o: gc.c
148 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
149 $(INCLUDES) $<
151 hash_gc.o: hash.c
152 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
154 init_gc.o: init.c
155 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
157 linking.o: linking.m
158 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
160 linking_gc.o: linking.m
161 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
162 $(INCLUDES) $<
164 misc_gc.o: misc.c
165 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
167 nil_method_gc.o: nil_method.c
168 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
170 NXConstStr.o: NXConstStr.m
171 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
173 NXConstStr_gc.o: NXConstStr.m
174 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
175 $(INCLUDES) $<
177 Object.o: Object.m
178 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
180 Object_gc.o: Object.m
181 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
182 $(INCLUDES) $<
184 objects_gc.o: objects.c
185 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
187 Protocol.o: Protocol.m
188 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
190 Protocol_gc.o: Protocol.m
191 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
192 $(INCLUDES) $<
194 sarray_gc.o: sarray.c
195 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
197 selector_gc.o: selector.c
198 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
200 sendmsg.o: sendmsg.c runtime-info.h
201 $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
203 sendmsg_gc.o: sendmsg.c runtime-info.h
204 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
206 thr_gc.o: thr.c
207 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
209 $(OBJC_THREAD_FILE)_gc.o: $(OBJC_THREAD_FILE).c
210 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
212 doc: info dvi html
214 libobjc.a: $(OBJS)
215 $(AR) $(AR_FLAGS) $@ $(OBJS)
216 $(RANLIB) $@
218 libobjc_gc.a: $(OBJS_GC)
219 $(AR) $(AR_FLAGS) $@ $(OBJS_GC)
220 $(RANLIB) $@
222 libobjc_s.a: libobjc.a
223 mv libobjc.a libobjc_s.a
225 # Create a relocatable DLL
226 libobjc.dll: libobjc_s.a libobjc_entry.o
227 $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
228 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
229 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
230 --base-file libobjc.base --output-exp libobjc.exp
231 $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
232 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
233 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
234 --base-file libobjc.base --output-exp libobjc.exp
235 $(GCC_FOR_TARGET) libobjc.exp -mdll \
236 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
237 $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
238 --output-lib libobjc.a
240 info: objc-features.info
241 dvi: objc-features.dvi
242 html: objc-features_toc.html
244 objc-features.info: $(srcdir)/objc-features.texi
245 makeinfo $(srcdir)/objc-features.texi
247 objc-features.dvi: $(srcdir)/objc-features.texi
248 texi2dvi $(srcdir)/objc-features.texi
250 objc-features_toc.html: objc-features.texi
251 texi2html -split_node $(srcdir)/objc-features.texi
253 Makefile: Makefile.in config.status
254 $(SHELL) config.status
256 config.status: configure
257 rm -f config.cache
258 CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
259 CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
261 ${srcdir}/configure: configure.in
262 rm -f config.cache
263 cd ${srcdir} && autoconf
265 install: install-libs copy-headers
267 install-libs: installdirs
268 -if test -f libobjc.a ; then \
269 rm -f $(libsubdir)/libobjc.a; \
270 $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
271 chmod a-x $(libsubdir)/libobjc.a; \
272 else true; fi
273 -if test -f libobjc_gc.a ; then \
274 rm -f $(libsubdir)/libobjc_gc.a; \
275 $(INSTALL_DATA) libobjc_gc.a $(libsubdir)/libobjc_gc.a; \
276 chmod a-x $(libsubdir)/libobjc_gc.a; \
277 else true; fi
278 -if test -f libobjc_s.a ; then \
279 rm -f $(libsubdir)/libobjc_s.a; \
280 $(INSTALL_DATA) libobjc_s.a $(libsubdir)/libobjc_s.a; \
281 chmod a-x $(libsubdir)/libobjc_s.a; \
282 else true; fi
283 -if test -f libobjc.dll ; then \
284 rm -f $(bindir)/libobjc.dll; \
285 $(INSTALL_DATA) libobjc.dll $(bindir)/libobjc.dll; \
286 else true; fi
288 # Copy Objective C headers to installation include directory.
289 copy-headers:
290 -rm -rf $(incinstalldir)/objc
291 -mkdir $(incinstalldir)/objc
292 for file in $(OBJC_H); do \
293 realfile=$(srcdir)/objc/$${file}; \
294 cp $${realfile} $(incinstalldir)/objc; \
295 chmod a+r $(incinstalldir)/objc/$${file}; \
296 done
298 check uninstall install-strip dist installcheck installdirs:
300 mostlyclean:
301 -rm -f runtime-info.h tmp-runtime.s *.o libobjc* xforward \
302 fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
303 *.toc *.tp *.vr *.html libobj.exp
304 @$(MULTICLEAN) multi-clean DO=mostlyclean
306 clean: mostlyclean
307 rm -f config.log
308 @$(MULTICLEAN) multi-clean DO=clean
310 distclean: clean
311 @$(MULTICLEAN) multi-clean DO=distclean
312 rm -f config.cache config.status Makefile configure
314 maintainer-clean realclean: distclean
316 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
317 install-strip dist installcheck installdirs