OSDN Git Service

In libobjc/:
[pf3gnuchains/gcc-fork.git] / libobjc / Makefile.in
index ac042ac..12f3e83 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for GNU Objective C runtime library.
 # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -43,6 +43,7 @@ toolexeclibdir = @toolexeclibdir@
 includedirname = @includedirname@
 libsuffix = @libsuffix@
 
+lt_host_flags = @lt_host_flags@
 extra_ldflags_libobjc = @extra_ldflags_libobjc@
 
 top_builddir = .
@@ -92,26 +93,118 @@ LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
 LIBTOOL_CLEAN   = $(LIBTOOL) --mode=clean
 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
 
-OBJC_GCFLAGS=-DOBJC_WITH_GC=1
+OBJC_GCFLAGS=@OBJC_GCFLAGS@
 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 \
+INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
   -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
   -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
   -I$(srcdir)/$(MULTISRCTOP)../include \
   $(OBJC_BOEHM_GC_INCLUDES)
 
+##
+## The list of header/source files
+##
 
-.SUFFIXES:
-.SUFFIXES: .c .m .lo
+# User-visible header files, from the objc/ directory
+OBJC_H = \
+  objc.h \
+  objc-exception.h \
+  objc-sync.h \
+  \
+  NXConstStr.h \
+  Object.h \
+  Protocol.h \
+  encoding.h \
+  message.h \
+  objc-api.h \
+  objc-decls.h \
+  runtime.h \
+  thr.h \
+  \
+  hash.h \
+  objc-list.h \
+  sarray.h \
+  typedstream.h
 
-.c.lo:
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
+# User-visible header files containing deprecated APIs, from the
+# objc/deprecated directory
+OBJC_DEPRECATED_H = \
+  METHOD_NULL.h \
+  MetaClass.h \
+  Object.h \
+  Protocol.h \
+  STR.h \
+  hash.h \
+  objc-list.h \
+  objc_get_uninstalled_dtable.h \
+  objc_malloc.h \
+  objc_msg_sendv.h \
+  objc_object_alloc.h \
+  objc_unexpected_exception.h \
+  objc_valloc.h \
+  sarray.h \
+  struct_objc_category.h \
+  struct_objc_class.h \
+  struct_objc_ivar.h \
+  struct_objc_ivar_list.h \
+  struct_objc_method.h \
+  struct_objc_method_list.h \
+  struct_objc_module.h \
+  struct_objc_protocol.h \
+  struct_objc_protocol_list.h \
+  struct_objc_selector.h \
+  struct_objc_static_instances.h \
+  struct_objc_symtab.h \
+  typedstream.h 
+
+# Objective-C source files to compile
+OBJC_SOURCE_FILES = \
+   NXConstStr.m \
+   Object.m \
+   Protocol.m \
+   accessors.m \
+   linking.m
+
+# C source files to compile
+C_SOURCE_FILES = \
+   archive.c \
+   class.c \
+   encoding.c \
+   error.c \
+   gc.c \
+   hash.c \
+   init.c \
+   ivars.c \
+   memory.c \
+   methods.c \
+   nil_method.c \
+   objc-foreach.c \
+   objc-sync.c \
+   objects.c \
+   protocols.c \
+   sarray.c \
+   selector.c \
+   sendmsg.c \
+   thr.c \
+   exception.c
+
+# Object files to link (when the library is linked with no GC (Garbage Collection))
+OBJS = \
+  $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
+  $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
+
+# Object files to link (when the library is linked with GC (Garbage Collection))
+OBJS_GC = \
+  $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
+  $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
 
-.m.lo:
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
+
+##
+## The rules to build
+##
 
 # Flags to pass to a recursive make.
 FLAGS_TO_PASS = \
@@ -138,201 +231,86 @@ FLAGS_TO_PASS = \
        "libsubdir=$(libsubdir)" \
        "tooldir=$(tooldir)"
 
+# The 'all' rule must be the first one so that it is executed if
+# nothing is specified on the command-line.
 all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
        : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
 
-# 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
+.SUFFIXES:
+.SUFFIXES: .c .m .lo
 
-# User-visible header files containing deprecated APIs, from the
-# objc/deprecated directory
+%.lo: %.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) \
+          -o $@
 
-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 
+%_gc.lo: %.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
+          -o $@
 
-# Modules that comprise the runtime library.
-
-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
+%.lo: %.m
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
+          -o $@
 
-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
+%_gc.lo: %.m
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
+          -o $@
 
+# sendmsg has a special rule because it depends on runtime-info.h.
 runtime-info.h: 
        echo "" > tmp-runtime.m
        echo "/* This file is automatically generated */" > $@
        $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
        rm -f tmp-runtime.m tmp-runtime.s
 
-archive_gc.lo: archive.c
-       $(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) $<
-
-encoding_gc.lo: encoding.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) $<
-
-gc_gc.lo: gc.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-hash_gc.lo: hash.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-init_gc.lo: init.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-linking.lo: linking.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(INCLUDES) $<
-
-linking_gc.lo: linking.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-memory_gc.lo: memory.c
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
+sendmsg.lo: sendmsg.c runtime-info.h
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) \
+          -o $@
 
-nil_method_gc.lo: nil_method.c
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
+sendmsg_gc.lo: sendmsg.c runtime-info.h
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
+          -o $@
 
-NXConstStr.lo: NXConstStr.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(INCLUDES) $<
+# These files have separate rules because they require special
+# compiler flags.
+archive.lo: archive.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -Wno-deprecated-declarations \
+          -o $@
 
-NXConstStr_gc.lo: NXConstStr.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(OBJC_GCFLAGS) $(INCLUDES) $<
+archive_gc.lo: archive.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -Wno-deprecated-declarations \
+          -o $@
 
 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
 Object.lo: Object.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
-               -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime -Wno-deprecated-declarations \
+          -o $@
 
 # -Wno-deprecated-declarations is for the objc/typedstream.h functions.
 Object_gc.lo: Object.m
-       $(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) \
-               $(INCLUDES) $<
-
-Protocol.lo: Protocol.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(INCLUDES) $<
-
-Protocol_gc.lo: Protocol.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-sarray_gc.lo: sarray.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-selector_gc.lo: selector.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-sendmsg.lo: sendmsg.c runtime-info.h
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-sendmsg_gc.lo: sendmsg.c runtime-info.h
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-thr_gc.lo: thr.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime -Wno-deprecated-declarations \
+          -o $@
 
 # -Wno-deprecated-declarations is to silence warnings from using 
 # _objc_unexpected_exception.
 exception.lo: exception.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
-               -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
+          -o $@
 
 exception_gc.lo: exception.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \
+          -o $@
 
 doc: info dvi pdf html
 
@@ -346,13 +324,13 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
 libobjc$(libsuffix).la: $(OBJS)
        $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
-               -rpath $(toolexeclibdir) \
+               -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
                -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
                $(LTLDFLAGS)
 
 libobjc_gc$(libsuffix).la: $(OBJS_GC)
        $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
-               -rpath $(toolexeclibdir) \
+               -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
                -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
                $(LTLDFLAGS)
 
@@ -401,7 +379,7 @@ install-libs: installdirs
        $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
        @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
 
-# Copy Objective C headers to installation include directory.
+# Copy Objective-C headers to installation include directory.
 install-headers:
        $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
        for file in $(OBJC_H); do \