Makefile.in 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. # Makefile for GNU Objective C runtime library.
  2. # Copyright (C) 1993-2022 Free Software Foundation, Inc.
  3. #This file is part of GCC.
  4. #GCC is free software; you can redistribute it and/or modify
  5. #it under the terms of the GNU General Public License as published by
  6. #the Free Software Foundation; either version 3, or (at your option)
  7. #any later version.
  8. #GCC is distributed in the hope that it will be useful,
  9. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. #GNU General Public License for more details.
  12. #You should have received a copy of the GNU General Public License
  13. #along with GCC; see the file COPYING3. If not see
  14. #<http://www.gnu.org/licenses/>.
  15. #This was cribbed from the libchill, libiberty and libstdc++
  16. #Makefile.in files. Some of this stuff may be unnecessary and
  17. #worthless.
  18. SHELL = @SHELL@
  19. MAKEOVERRIDES=
  20. #### Start of system configuration section. ####
  21. srcdir = @glibcpp_srcdir@
  22. VPATH = @glibcpp_srcdir@
  23. prefix = @prefix@
  24. exec_prefix = @exec_prefix@
  25. target_noncanonical = @target_noncanonical@
  26. gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
  27. host_subdir = @host_subdir@
  28. top_srcdir = @top_srcdir@
  29. multi_basedir = @multi_basedir@
  30. toolexecdir = @toolexecdir@
  31. # Toolexecdir is used only by toolexeclibdir
  32. toolexeclibdir = @toolexeclibdir@
  33. includedirname = @includedirname@
  34. libsuffix = @libsuffix@
  35. lt_host_flags = @lt_host_flags@
  36. extra_ldflags_libobjc = @extra_ldflags_libobjc@
  37. top_builddir = .
  38. libdir = $(exec_prefix)/lib
  39. libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
  40. # Multilib support variables.
  41. MULTISRCTOP =
  42. MULTIBUILDTOP =
  43. MULTIDIRS =
  44. MULTISUBDIR =
  45. MULTIDO = true
  46. MULTICLEAN = true
  47. # Not configured per top-level version, since that doesn't get passed
  48. # down at configure time, but overrridden by the top-level install
  49. # target.
  50. INSTALL = @INSTALL@
  51. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  52. INSTALL_DATA = @INSTALL_DATA@
  53. AR = @AR@
  54. AR_FLAGS = rc
  55. RANLIB = @RANLIB@
  56. CC = @CC@
  57. CFLAGS = @CFLAGS@
  58. XCFLAGS = @XCFLAGS@
  59. WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
  60. ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) \
  61. $(XCFLAGS) $(CFLAGS) $(WARN_CFLAGS) \
  62. -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
  63. # Libtool
  64. # The following strings describe the version of the obj-C library
  65. # begin compiled and compatibility issues.
  66. # Please refer to Libtool documentation about how to manage these
  67. # numbers.
  68. LIBOBJC_VERSION = @VERSION@
  69. LIBOBJC_GC_VERSION = @VERSION@
  70. LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
  71. LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
  72. LIBTOOL_LINK = $(LIBTOOL) --mode=link
  73. LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
  74. LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
  75. #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
  76. OBJC_GCFLAGS=@OBJC_GCFLAGS@
  77. OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
  78. OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
  79. OBJC_BOEHM_GC_LIBS=@OBJC_BOEHM_GC_LIBS@
  80. INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
  81. -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
  82. -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
  83. -I$(srcdir)/$(MULTISRCTOP)../libgcc \
  84. -I$(MULTIBUILDTOP)../libgcc \
  85. -I$(srcdir)/$(MULTISRCTOP)../include \
  86. $(OBJC_BOEHM_GC_INCLUDES)
  87. ##
  88. ## The list of header/source files
  89. ##
  90. # User-visible header files, from the objc/ directory
  91. OBJC_H = \
  92. objc.h \
  93. objc-exception.h \
  94. objc-sync.h \
  95. \
  96. NXConstStr.h \
  97. Object.h \
  98. Protocol.h \
  99. message.h \
  100. objc-decls.h \
  101. runtime.h \
  102. thr.h
  103. # Objective-C source files to compile
  104. OBJC_SOURCE_FILES = \
  105. NXConstStr.m \
  106. Object.m \
  107. Protocol.m \
  108. accessors.m \
  109. linking.m
  110. # C source files to compile
  111. C_SOURCE_FILES = \
  112. class.c \
  113. encoding.c \
  114. error.c \
  115. gc.c \
  116. hash.c \
  117. init.c \
  118. ivars.c \
  119. memory.c \
  120. methods.c \
  121. nil_method.c \
  122. objc-foreach.c \
  123. objc-sync.c \
  124. objects.c \
  125. protocols.c \
  126. sarray.c \
  127. selector.c \
  128. sendmsg.c \
  129. thr.c \
  130. exception.c
  131. # Object files to link (when the library is linked with no GC (Garbage Collection))
  132. OBJS = \
  133. $(patsubst %.m,%.lo,$(OBJC_SOURCE_FILES)) \
  134. $(patsubst %.c,%.lo,$(C_SOURCE_FILES))
  135. # Object files to link (when the library is linked with GC (Garbage Collection))
  136. OBJS_GC = \
  137. $(patsubst %.m,%_gc.lo,$(OBJC_SOURCE_FILES)) \
  138. $(patsubst %.c,%_gc.lo,$(C_SOURCE_FILES))
  139. ##
  140. ## The rules to build
  141. ##
  142. # Flags to pass to a recursive make.
  143. FLAGS_TO_PASS = \
  144. "AR=$(AR)" \
  145. "AR_FLAGS=$(AR_FLAGS)" \
  146. "CC=$(CC)" \
  147. "CFLAGS=$(CFLAGS)" \
  148. "DESTDIR=$(DESTDIR)" \
  149. "LIBCFLAGS=$(LIBCFLAGS)" \
  150. "EXTRA_OFILES=$(EXTRA_OFILES)" \
  151. "HDEFINES=$(HDEFINES)" \
  152. "INSTALL=$(INSTALL)" \
  153. "INSTALL_DATA=$(INSTALL_DATA)" \
  154. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  155. "LDFLAGS=$(LDFLAGS)" \
  156. "LIBTOOL=$(LIBTOOL)" \
  157. "LOADLIBES=$(LOADLIBES)" \
  158. "PICFLAG=$(PICFLAG)" \
  159. "RANLIB=$(RANLIB)" \
  160. "SHELL=$(SHELL)" \
  161. "prefix=$(prefix)" \
  162. "exec_prefix=$(exec_prefix)" \
  163. "libdir=$(libdir)" \
  164. "libsubdir=$(libsubdir)" \
  165. "tooldir=$(tooldir)"
  166. # The 'all' rule must be the first one so that it is executed if
  167. # nothing is specified on the command-line.
  168. all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
  169. : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
  170. .SUFFIXES:
  171. .SUFFIXES: .c .m .lo
  172. %.lo: %.c
  173. $(LIBTOOL_COMPILE) $(CC) $< -c \
  174. $(ALL_CFLAGS) $(INCLUDES) \
  175. -o $@
  176. %_gc.lo: %.c
  177. $(LIBTOOL_COMPILE) $(CC) $< -c \
  178. $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
  179. -o $@
  180. %.lo: %.m
  181. $(LIBTOOL_COMPILE) $(CC) $< -c \
  182. $(ALL_CFLAGS) $(INCLUDES) -fgnu-runtime \
  183. -o $@
  184. %_gc.lo: %.m
  185. $(LIBTOOL_COMPILE) $(CC) $< -c \
  186. $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fgnu-runtime \
  187. -o $@
  188. # sendmsg has a special rule because it depends on runtime-info.h.
  189. runtime-info.h:
  190. echo "" > tmp-runtime.m
  191. echo "/* This file is automatically generated */" > $@
  192. $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
  193. rm -f tmp-runtime.m tmp-runtime.s
  194. sendmsg.lo: sendmsg.c runtime-info.h
  195. $(LIBTOOL_COMPILE) $(CC) $< -c \
  196. $(ALL_CFLAGS) $(INCLUDES) \
  197. -o $@
  198. sendmsg_gc.lo: sendmsg.c runtime-info.h
  199. $(LIBTOOL_COMPILE) $(CC) $< -c \
  200. $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) \
  201. -o $@
  202. # These files have separate rules because they require special
  203. # compiler flags.
  204. exception.lo: exception.c
  205. $(LIBTOOL_COMPILE) $(CC) $< -c \
  206. $(ALL_CFLAGS) $(INCLUDES) -fexceptions \
  207. -o $@
  208. exception_gc.lo: exception.c
  209. $(LIBTOOL_COMPILE) $(CC) $< -c \
  210. $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \
  211. -o $@
  212. doc: info dvi pdf html
  213. # No install-html or install-pdf support
  214. .PHONY: install-html install-pdf install-info
  215. install-html:
  216. install-pdf:
  217. install-info:
  218. LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
  219. libobjc$(libsuffix).la: $(OBJS)
  220. $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
  221. -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
  222. -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
  223. $(LTLDFLAGS)
  224. libobjc_gc$(libsuffix).la: $(OBJS_GC)
  225. $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
  226. -Wc,-shared-libgcc -rpath $(toolexeclibdir) \
  227. -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
  228. $(LTLDFLAGS)
  229. info:
  230. dvi:
  231. pdf:
  232. html:
  233. Makefile: Makefile.in config.status
  234. $(SHELL) config.status
  235. config.status: configure
  236. rm -f config.cache
  237. CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
  238. CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
  239. AUTOCONF = autoconf
  240. ACLOCAL = aclocal
  241. ACLOCAL_AMFLAGS = -I ../config -I ..
  242. aclocal_deps = \
  243. $(srcdir)/../config/multi.m4 \
  244. $(srcdir)/../config/override.m4 \
  245. $(srcdir)/../config/proginstall.m4 \
  246. $(srcdir)/../config/toolexeclibdir.m4 \
  247. $(srcdir)/../ltoptions.m4 \
  248. $(srcdir)/../ltsugar.m4 \
  249. $(srcdir)/../ltversion.m4 \
  250. $(srcdir)/../lt~obsolete.m4 \
  251. $(srcdir)/../config/cet.m4 \
  252. $(srcdir)/acinclude.m4
  253. $(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
  254. rm -f config.cache
  255. cd $(srcdir) && $(AUTOCONF)
  256. $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
  257. cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
  258. install: install-libs install-headers
  259. install-libs: installdirs
  260. $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
  261. $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
  262. if [ "$(OBJC_BOEHM_GC)" ]; then \
  263. $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
  264. $(DESTDIR)$(toolexeclibdir);\
  265. fi
  266. $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
  267. @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
  268. # Copy Objective-C headers to installation include directory.
  269. install-headers:
  270. $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
  271. for file in $(OBJC_H); do \
  272. realfile=$(srcdir)/objc/$${file}; \
  273. $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
  274. done
  275. check uninstall install-strip dist installcheck installdirs:
  276. mostlyclean:
  277. -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
  278. -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
  279. fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
  280. *.toc *.tp *.vr *.html libobj.exp
  281. @$(MULTICLEAN) multi-clean DO=mostlyclean
  282. clean: mostlyclean
  283. rm -f config.log
  284. @$(MULTICLEAN) multi-clean DO=clean
  285. distclean: clean
  286. @$(MULTICLEAN) multi-clean DO=distclean
  287. rm -f config.cache config.status Makefile configure
  288. maintainer-clean realclean: distclean
  289. .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
  290. install-strip dist installcheck installdirs
  291. # Don't export variables to the environment, in order to not confuse
  292. # configure.
  293. .NOEXPORT: