]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libobjc/Makefile.in
rs6000: Check -+0 and NaN for smax/smin generation
[thirdparty/gcc.git] / libobjc / Makefile.in
index 891c6609c37c449a7a1f69ba964229ee3e976828..46c8540701086c3f83b0df3c07dd1d300c9fe05a 100644 (file)
@@ -1,6 +1,5 @@
 # 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.
+# Copyright (C) 1993-2020 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -32,7 +31,7 @@ VPATH = @glibcpp_srcdir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 target_noncanonical = @target_noncanonical@
-gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
+gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
 host_subdir = @host_subdir@
 top_srcdir = @top_srcdir@
 multi_basedir = @multi_basedir@
@@ -43,12 +42,11 @@ toolexeclibdir = @toolexeclibdir@
 includedirname = @includedirname@
 libsuffix = @libsuffix@
 
+lt_host_flags = @lt_host_flags@
 extra_ldflags_libobjc = @extra_ldflags_libobjc@
 
 top_builddir = .
 
--include ../boehm-gc/threads.mk
-
 libdir = $(exec_prefix)/lib
 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
 
@@ -74,8 +72,10 @@ RANLIB = @RANLIB@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+XCFLAGS = @XCFLAGS@
 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
-ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
+ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) \
+       $(XCFLAGS) $(CFLAGS) $(WARN_CFLAGS) \
        -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
 
 # Libtool
@@ -92,26 +92,81 @@ 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)
+OBJC_BOEHM_GC_LIBS=@OBJC_BOEHM_GC_LIBS@
 
-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)../libgcc \
+  -I$(MULTIBUILDTOP)../libgcc \
   -I$(srcdir)/$(MULTISRCTOP)../include \
   $(OBJC_BOEHM_GC_INCLUDES)
 
-
-.SUFFIXES:
-.SUFFIXES: .c .m .lo
-
-.c.lo:
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-.m.lo:
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
+##
+## The list of header/source files
+##
+
+# User-visible header files, from the objc/ directory
+OBJC_H = \
+  objc.h \
+  objc-exception.h \
+  objc-sync.h \
+  \
+  NXConstStr.h \
+  Object.h \
+  Protocol.h \
+  message.h \
+  objc-decls.h \
+  runtime.h \
+  thr.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 = \
+   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))
+
+
+##
+## The rules to build
+##
 
 # Flags to pass to a recursive make.
 FLAGS_TO_PASS = \
@@ -138,131 +193,63 @@ 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.
+.SUFFIXES:
+.SUFFIXES: .c .m .lo
 
-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
+%.lo: %.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) \
+          -o $@
 
-# Modules that comprise the runtime library.
+%_gc.lo: %.c
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
+          -o $@
 
-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 \
-          exception.lo
+%.lo: %.m
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
+          -o $@
 
-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 \
-         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) -c  -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(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) $<
-
-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) $<
-
-misc_gc.lo: misc.c
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-nil_method_gc.lo: nil_method.c
-       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
-
-NXConstStr.lo: NXConstStr.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(INCLUDES) $<
-
-NXConstStr_gc.lo: NXConstStr.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-Object.lo: Object.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
-               $(INCLUDES) $<
-
-Object_gc.lo: Object.m
-       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -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) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) \
+          -o $@
 
 sendmsg_gc.lo: sendmsg.c runtime-info.h
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
+          -o $@
 
-thr_gc.lo: thr.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               $(INCLUDES) $<
+# These files have separate rules because they require special
+# compiler flags.
 
 exception.lo: exception.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
-               -fexceptions $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) -fexceptions \
+          -o $@
 
 exception_gc.lo: exception.c
-       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-               -fexceptions $(INCLUDES) $<
+       $(LIBTOOL_COMPILE) $(CC) $< -c \
+          $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \
+          -o $@
 
 doc: info dvi pdf html
 
@@ -276,13 +263,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)
 
@@ -306,10 +293,12 @@ aclocal_deps = \
        $(srcdir)/../config/multi.m4 \
        $(srcdir)/../config/override.m4 \
        $(srcdir)/../config/proginstall.m4 \
+       $(srcdir)/../config/toolexeclibdir.m4 \
        $(srcdir)/../ltoptions.m4 \
        $(srcdir)/../ltsugar.m4 \
        $(srcdir)/../ltversion.m4 \
        $(srcdir)/../lt~obsolete.m4 \
+       $(srcdir)/../config/cet.m4 \
        $(srcdir)/acinclude.m4
 
 $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
@@ -331,7 +320,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 \