OSDN Git Service

* All .h files pushed down into the objc/ subdirectory.
[pf3gnuchains/gcc-fork.git] / libobjc / Makefile.in
1 #Makefile for GNU Objective C runtime library.
2 #Copyright (C) 1993, 95-97, 1998 Free Software Foundation, Inc.
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
18 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 #This was cribbed from the libchill, libiberty and libstdc++
21 #Makefile.in files.  Some of this stuff may be unnecessary and
22 #worthless.
23
24 SHELL = /bin/sh
25
26 #### Start of system configuration section. ####
27
28 srcdir = @srcdir@
29 VPATH = @srcdir@
30 prefix = @prefix@
31 exec_prefix = @exec_prefix@
32 target_alias = @target_alias@
33 gcc_version = @gcc_version@
34 gcc_version_trigger = @gcc_version_trigger@
35
36 libdir = $(exec_prefix)/lib
37 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
38 incinstalldir = $(libsubdir)/include
39
40 # Multilib support variables.
41 MULTISRCTOP =
42 MULTIBUILDTOP =
43 MULTIDIRS =
44 MULTISUBDIR =
45 MULTIDO = true
46 MULTICLEAN = true
47
48 # Not configured per top-level version, since that doesn't get passed
49 # down at configure time, but overrridden by the top-level install
50 # target.
51 INSTALL = @INSTALL@
52 INSTALL_PROGRAM = @INSTALL_PROGRAM@
53 INSTALL_DATA = @INSTALL_DATA@
54
55 AR = @AR@
56 AR_FLAGS = rc
57
58 RANLIB = @RANLIB@
59
60 CC = @CC@
61 CFLAGS = @CFLAGS@
62 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS)
63
64 INCLUDES = -I$(srcdir)/objc -I$(srcdir)/../gcc/config -I../../gcc
65
66 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
67 OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@
68
69 .SUFFIXES:
70 .SUFFIXES: .c .m .o
71
72 .c.o:
73         $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
74
75 .m.o:
76         $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
77
78 all: libobjc.a @OBJC_BOEHM_GC@
79         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
80
81 # User-visible header files.
82
83 OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
84          NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
85          thr.h
86
87 # Modules that comprise the runtime library.
88
89 OBJS =    archive.o class.o encoding.o gc.o hash.o init.o linking.o \
90           misc.o nil_method.o NXConstStr.o Object.o objects.o \
91           Protocol.o sarray.o selector.o sendmsg.o thr.o \
92           $(OBJC_THREAD_FILE).o
93
94 OBJS_GC = archive_gc.o class_gc.o encoding_gc.o gc_gc.o hash_gc.o \
95           init_gc.o linking_gc.o misc_gc.o nil_method_gc.o \
96           NXConstStr_gc.o Object_gc.o objects_gc.o Protocol_gc.o \
97           sarray_gc.o selector_gc.o sendmsg_gc.o thr_gc.o \
98           $(OBJC_THREAD_FILE)_gc.o
99
100 runtime-info.h: ../../gcc/cc1obj
101                 echo "" > tmp-runtime
102                 echo "/* This file is automatically generated */" > $@
103                 $< -print-objc-runtime-info tmp-runtime >> $@
104                 rm -f tmp-runtime
105
106 archive_gc.o:   archive.c
107                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
108
109 class_gc.o:     class.c
110                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
111
112 encoding_gc.o:  encoding.c
113                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
114
115 gc.o:           gc.c
116                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
117
118 gc_gc.o:        gc.c
119                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
120                         $(INCLUDES) $<
121
122 hash_gc.o:      hash.c
123                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
124
125 init_gc.o:      init.c
126                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
127
128 linking.o:      linking.m
129                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
130
131 linking_gc.o:   linking.m
132                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
133                         $(INCLUDES) $<
134
135 misc_gc.o:      misc.c
136                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
137
138 nil_method_gc.o: nil_method.c
139                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
140
141 NXConstStr.o:   NXConstStr.m
142                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
143
144 NXConstStr_gc.o: NXConstStr.m
145                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
146                         $(INCLUDES) $<
147
148 Object.o:       Object.m
149                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
150
151 Object_gc.o:    Object.m
152                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
153                         $(INCLUDES) $<
154
155 objects_gc.o:   objects.c
156                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
157
158 Protocol.o:     Protocol.m
159                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
160
161 Protocol_gc.o:  Protocol.m
162                 $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
163                         $(INCLUDES) $<
164
165 sarray_gc.o:    sarray.c
166                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
167
168 selector_gc.o:  selector.c
169                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
170
171 sendmsg.o:      sendmsg.c runtime-info.h
172                 $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
173
174 sendmsg_gc.o:   sendmsg.c runtime-info.h
175                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
176
177 thr_gc.o:       thr.c
178                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
179
180 $(OBJC_THREAD_FILE)_gc.o: $(OBJC_THREAD_FILE).c
181                 $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
182
183 doc: info dvi html
184
185 libobjc.a: $(OBJS)
186         $(AR) $(AR_FLAGS) $@ $(OBJS)
187         $(RANLIB) $@
188
189 libobjc_gc.a: $(OBJS_GC)
190         $(AR) $(AR_FLAGS) $@ $(OBJS_GC)
191         $(RANLIB) $@
192
193 libobjc_s.a: libobjc.a
194         mv libobjc.a libobjc_s.a
195
196 # Create a relocatable DLL
197 libobjc.dll: libobjc_s.a libobjc_entry.o
198         $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
199                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
200         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
201                 --base-file libobjc.base --output-exp libobjc.exp
202         $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
203                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
204         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
205                 --base-file libobjc.base --output-exp libobjc.exp
206         $(GCC_FOR_TARGET) libobjc.exp -mdll \
207                 -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
208         $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
209                 --output-lib libobjc.a
210
211 info: objc-features.info
212 dvi: objc-features.dvi
213 html: objc-features_toc.html
214
215 objc-features.info: $(srcdir)/objc-features.texi
216         makeinfo $(srcdir)/objc-features.texi
217
218 objc-features.dvi: $(srcdir)/objc-features.texi
219         texi2dvi $(srcdir)/objc-features.texi
220
221 objc-features_toc.html: objc-features.texi
222         texi2html -split_node $(srcdir)/objc-features.texi
223
224 Makefile: Makefile.in config.status
225         $(SHELL) config.status
226
227 config.status: configure
228         rm -f config.cache
229         CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
230         CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
231
232 ${srcdir}/configure: configure.in
233         rm -f config.cache
234         cd ${srcdir} && autoconf
235
236 install: install-libs copy-headers
237
238 install-libs: installdirs
239         -if test -f libobjc.a ; then \
240           rm -f $(libsubdir)/libobjc.a; \
241           $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
242           chmod a-x $(libsubdir)/libobjc.a; \
243         else true; fi
244         -if test -f libobjc_gc.a ; then \
245           rm -f $(libsubdir)/libobjc_gc.a; \
246           $(INSTALL_DATA) libobjc_gc.a $(libsubdir)/libobjc_gc.a; \
247           chmod a-x $(libsubdir)/libobjc_gc.a; \
248         else true; fi
249         -if test -f libobjc_s.a ; then \
250           rm -f $(libsubdir)/libobjc_s.a; \
251           $(INSTALL_DATA) libobjc_s.a $(libsubdir)/libobjc_s.a; \
252           chmod a-x $(libsubdir)/libobjc_s.a; \
253         else true; fi
254           -if test -f libobjc.dll ; then \
255           rm -f $(bindir)/libobjc.dll; \
256           $(INSTALL_DATA) libobjc.dll $(bindir)/libobjc.dll; \
257         else true; fi
258
259 # Copy Objective C headers to installation include directory.
260 copy-headers:
261         -rm -rf $(incinstalldir)/objc
262         -mkdir $(incinstalldir)/objc
263         for file in $(OBJC_H); do \
264           realfile=$(srcdir)/objc/$${file}; \
265           cp $${realfile} $(incinstalldir)/objc; \
266           chmod a+r $(incinstalldir)/objc/$${file}; \
267         done
268
269 check uninstall install-strip dist installcheck installdirs:
270
271 mostlyclean:
272         -rm -f runtime-info.h tmp-runtime.s *.o libobjc* xforward \
273                 fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
274                 *.toc *.tp *.vr *.html libobj.exp
275         @$(MULTICLEAN) multi-clean DO=mostlyclean
276
277 clean: mostlyclean
278         rm -f config.log
279         @$(MULTICLEAN) multi-clean DO=clean
280
281 distclean: clean
282         @$(MULTICLEAN) multi-clean DO=distclean
283         rm -f config.cache config.status Makefile configure
284
285 maintainer-clean realclean: distclean
286
287 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
288         install-strip dist installcheck installdirs