1 # GNU Objective C Runtime Makefile
2 # Copyright (C) 1993 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 it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2, or (at your option) any later version.
10 # GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 # You should have received a copy of the GNU General Public License along with
16 # GNU CC; see the file COPYING. If not, write to the Free Software
17 # Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19 # This makefile is run by the parent dir's makefile.
21 # srcdir1=`cd $(srcdir); pwd`; \
23 # $(MAKE) $(MAKEFLAGS) -f $$srcdir1/objc/Makefile libobjc.a \
24 # srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
25 # GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
26 # GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$$thisdir1/include
27 # Two targets are used by ../Makefile: `all' and `mostlyclean'.
33 VPATH = $(srcdir)/objc
38 # Always search these dirs when compiling.
39 SUBDIR_INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/config
42 $(GCC_FOR_TARGET) $(OPTIMIZE) -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
45 $(GCC_FOR_TARGET) $(OPTIMIZE) -fgnu-runtime \
46 -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
48 # If we were not invoked from the parent dir,
49 # invoke make in the parent dir and have reinvoke this makefile.
50 # That's necessary to get the right values for srcdir, etc.
52 cd ..; $(MAKE) sublibobjc.a
54 OBJC_O = hash.o sarray.o objc-class.o objc-msg.o objc-init.o objc-archive.o \
55 objc-sel.o objc-object.o objc-misc.o Object.o Protocol.o
59 $(AR) rc libobjc.a $(OBJC_O)
60 # ranlib is run in the parent directory's makefile.
62 OBJC_H = hash.h list.h sarray.h objc.h \
63 objc-api.h objc-archive.h cache.h \
64 Object.h Protocol.h mutex.h
66 # copy objc headers to installation include directory
67 copy-headers: $(OBJC_H)
68 -rm -fr $(incinstalldir)/objc
69 mkdir $(incinstalldir)/objc
70 for file in $(OBJC_H); do \
71 realfile=$(srcdir)/objc/$$file; \
72 cp $$realfile $(incinstalldir)/objc; \
73 chmod a+r $(incinstalldir)/objc; \
76 objc-msg.o: objc-msg.c fflags
77 $(GCC_FOR_TARGET) `cat fflags` -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
79 ## Next to are for heuristics on forwarding mechanism...
81 $(GCC_FOR_TARGET) -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
82 $(GCC_FOR_TARGET) ./_forward.o -o _forward
89 -rm -f *.o libobjc.a _forward fflags
91 distclean: mostlyclean
92 extraclean: mostlyclean