X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=libobjc%2FMakefile.in;h=46c8540701086c3f83b0df3c07dd1d300c9fe05a;hb=a929b39aa32a6bc65158bd8e32ce96bc1c906065;hp=a47f7ea344b17c9f7f058ad9249aa57ff73d273b;hpb=e976a775e259c5a85907a4b4e9a2b707c7ce9cca;p=gcc.git diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in index a47f7ea344b..46c85407010 100644 --- a/libobjc/Makefile.in +++ b/libobjc/Makefile.in @@ -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) +## +## The list of header/source files +## -.SUFFIXES: -.SUFFIXES: .c .m .lo - -.c.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< - -.m.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< +# 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,145 +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, from the objc/ directory - -OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h objc-exception.h \ - NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \ - thr.h objc-decls.h - -# User-visible header files containing deprecated APIs, from the -# objc/deprecated directory +.SUFFIXES: +.SUFFIXES: .c .m .lo -OBJC_DEPRECATED_H = Object.h objc-unexpected-exception.h \ - typedstream.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) -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) $< - -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) $< - -# -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) $< - -# -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) $< + $(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. -# -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 \ + -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 \ + -o $@ doc: info dvi pdf html @@ -290,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) @@ -320,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 @@ -345,18 +320,13 @@ 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 \ 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: