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)
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
27 #### Start of system configuration section. ####
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.
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
53 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
54 INSTALL_DATA
= @INSTALL_DATA@
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@
84 $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
87 $(CC
) -c
$(ALL_CFLAGS
) $(INCLUDES
) $<
89 # Flags to pass to a recursive make.
92 "AR_FLAGS=$(AR_FLAGS)" \
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)" \
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 \
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
130 echo
"" > tmp-runtime
131 echo
"/* This file is automatically generated */" > $@
132 $(CC1OBJ
) -print-objc-runtime-info tmp-runtime
>> $@
135 archive_gc.o
: archive.c
136 $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) $(INCLUDES
) $<
139 $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) $(INCLUDES
) $<
141 encoding_gc.o
: encoding.c
142 $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) $(INCLUDES
) $<
145 $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) $(INCLUDES
) $<
148 $(CC
) -fgnu-runtime
-c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) \
152 $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) $(INCLUDES
) $<
155 $(CC
) -c
-o
$@
$(ALL_CFLAGS
) $(OBJC_GCFLAGS
) $(INCLUDES
) $<
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
) \
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
) \
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
) \
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
) \
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
) $<
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
) $<
215 $(AR
) $(AR_FLAGS
) $@
$(OBJS
)
218 libobjc_gc.a
: $(OBJS_GC
)
219 $(AR
) $(AR_FLAGS
) $@
$(OBJS_GC
)
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
258 CONFIG_SITE
=no-such-file CC
='$(CC)' AR
='$(AR)' CFLAGS
='$(CFLAGS)' \
259 CPPFLAGS
='$(CPPFLAGS)' $(SHELL
) config.status
--recheck
261 ${srcdir}/configure
: configure.in
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
; \
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
; \
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
; \
283 -if
test -f libobjc.dll
; then \
284 rm -f
$(bindir)/libobjc.dll
; \
285 $(INSTALL_DATA
) libobjc.dll
$(bindir)/libobjc.dll
; \
288 # Copy Objective C headers to installation include directory.
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}; \
298 check uninstall install-strip
dist installcheck installdirs:
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
308 @
$(MULTICLEAN
) multi-clean DO
=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