# Makefile for GNU Objective C runtime library.
# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
#This file is part of GCC.
#GCC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
+#the Free Software Foundation; either version 3, or (at your option)
#any later version.
#GCC is distributed in the hope that it will be useful,
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
-#along with GCC; see the file COPYING. If not, write to
-#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-#Boston, MA 02110-1301, USA. */
+#along with GCC; see the file COPYING3. If not see
+#<http://www.gnu.org/licenses/>.
#This was cribbed from the libchill, libiberty and libstdc++
#Makefile.in files. Some of this stuff may be unnecessary and
top_builddir = .
+-include ../boehm-gc/threads.mk
+
libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
# numbers.
LIBOBJC_VERSION = @VERSION@
LIBOBJC_GC_VERSION = @VERSION@
-LIBTOOL = @LIBTOOL@
+LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
LIBTOOL_LINK = $(LIBTOOL) --mode=link
LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
OBJC_GCFLAGS=-DOBJC_WITH_GC=1
-OBJC_THREAD_FILE=thr-objc
OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
+OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config \
all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
-# User-visible header files.
-
-OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
- NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
- thr.h objc-decls.h
+# User-visible header files, from the objc/ directory
+
+OBJC_H = \
+ objc.h \
+ objc-exception.h \
+ \
+ NXConstStr.h \
+ Object.h \
+ Protocol.h \
+ encoding.h \
+ hash.h \
+ message.h \
+ objc-api.h \
+ objc-decls.h \
+ objc-list.h \
+ sarray.h \
+ thr.h \
+ typedstream.h
+
+# User-visible header files containing deprecated APIs, from the
+# objc/deprecated directory
+
+OBJC_DEPRECATED_H = \
+ MetaClass.h \
+ Object.h \
+ STR.h \
+ objc_error.h \
+ objc_unexpected_exception.h \
+ struct_objc_class.h \
+ struct_objc_protocol.h \
+ struct_objc_selector.h \
+ typedstream.h
# Modules that comprise the runtime library.
-OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
- misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
- Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
- $(OBJC_THREAD_FILE).lo exception.lo
-
-OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
- init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
- NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
- sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
- $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
+OBJS = \
+ NXConstStr.lo \
+ Object.lo \
+ Protocol.lo \
+ archive.lo \
+ class.lo \
+ encoding.lo \
+ error.lo \
+ gc.lo \
+ hash.lo \
+ init.lo \
+ linking.lo \
+ memory.lo \
+ nil_method.lo \
+ objects.lo \
+ sarray.lo \
+ selector.lo \
+ sendmsg.lo \
+ thr.lo \
+ exception.lo
+
+OBJS_GC = \
+ NXConstStr_gc.lo \
+ Object_gc.lo \
+ Protocol_gc.lo \
+ archive_gc.lo \
+ class_gc.lo \
+ encoding_gc.lo \
+ error_gc.lo \
+ gc_gc.lo \
+ hash_gc.lo \
+ init_gc.lo \
+ linking_gc.lo \
+ memory_gc.lo \
+ nil_method_gc.lo \
+ objects_gc.lo \
+ sarray_gc.lo \
+ selector_gc.lo \
+ sendmsg_gc.lo \
+ thr_gc.lo \
+ exception_gc.lo
runtime-info.h:
echo "" > tmp-runtime.m
rm -f tmp-runtime.m tmp-runtime.s
archive_gc.lo: archive.c
- $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c -o $@ $(ALL_CFLAGS) \
+ $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+archive.lo: archive.c
+ $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c $(ALL_CFLAGS) \
$(INCLUDES) $<
class_gc.lo: class.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
$(INCLUDES) $<
+error_gc.lo: error.c
+ $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
+
gc.lo: gc.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(OBJC_GCFLAGS) $(INCLUDES) $<
-misc_gc.lo: misc.c
+memory_gc.lo: memory.c
$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
$(INCLUDES) $<
$(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(OBJC_GCFLAGS) $(INCLUDES) $<
+# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
Object.lo: Object.m
- $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
- $(INCLUDES) $<
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
+ -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
Object_gc.lo: Object.m
- $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
- $(OBJC_GCFLAGS) $(INCLUDES) $<
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
+ -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
objects_gc.lo: objects.c
$(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
$(INCLUDES) $<
-$(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
- $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
+# -Wno-deprecated-declarations is to silence warnings from using
+# _objc_unexpected_exception.
exception.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
- -fexceptions $(INCLUDES) $<
+ -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
exception_gc.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- -fexceptions $(INCLUDES) $<
+ -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
doc: info dvi pdf html
# No install-html or install-pdf support
-.PHONY: install-html install-pdf
+.PHONY: install-html install-pdf install-info
install-html:
install-pdf:
+install-info:
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
$(LTLDFLAGS)
libobjc_gc$(libsuffix).la: $(OBJS_GC)
- $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
+ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
-rpath $(toolexeclibdir) \
-version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
$(LTLDFLAGS)
-#
-# FIXME -- The following part does not fit in the libtool context.
-# Libtool is supposed to [going to] be able to create a win 32 DLL
-# without extra code but since I don't have a win machine to test
-# if it already works, I leave the old code here.
-#
-libobjc_s.a: libobjc.la
- mv libobjc.a libobjc_s.a
-
-# Create a relocatable DLL
-libobjc.dll: libobjc_s.a libobjc_entry.o
- $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) libobjc.exp -mdll \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --output-lib libobjc.a
-#
-#
-#
-#
-#
-
info:
dvi:
pdf:
CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-${srcdir}/configure: @MAINT@ configure.ac
+AUTOCONF = autoconf
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../config -I ..
+aclocal_deps = \
+ $(srcdir)/../config/multi.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/proginstall.m4 \
+ $(srcdir)/../ltoptions.m4 \
+ $(srcdir)/../ltsugar.m4 \
+ $(srcdir)/../ltversion.m4 \
+ $(srcdir)/../lt~obsolete.m4 \
+ $(srcdir)/acinclude.m4
+
+$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
rm -f config.cache
- cd ${srcdir} && autoconf
+ cd $(srcdir) && $(AUTOCONF)
+
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
install: install-libs install-headers
realfile=$(srcdir)/objc/$${file}; \
$(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
done
+ $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
+ for file in $(OBJC_DEPRECATED_H); do \
+ realfile=$(srcdir)/objc/deprecated/$${file}; \
+ $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
+ done
check uninstall install-strip dist installcheck installdirs: