Makefile.in 9.3 KB

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