Makefile.am 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. ## Process this file with automake to generate Makefile.in
  2. #
  3. # Copyright (C) 2006-2015 Free Software Foundation, Inc.
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; see the file COPYING3. If not see
  17. # <http://www.gnu.org/licenses/>.
  18. #
  19. AUTOMAKE_OPTIONS = foreign
  20. SUBDIRS = po testsuite
  21. tooldir = $(exec_prefix)/$(target_alias)
  22. ACLOCAL_AMFLAGS = -I ../bfd -I ../config
  23. # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
  24. # -I../zlib, unless we were configured with --with-system-zlib, in which
  25. # case both are empty.
  26. ZLIB = @zlibdir@ -lz
  27. ZLIBINC = @zlibinc@
  28. AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC)
  29. AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC)
  30. AM_CPPFLAGS = \
  31. -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
  32. -DLOCALEDIR="\"$(datadir)/locale\"" \
  33. -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
  34. -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@
  35. LIBIBERTY = ../libiberty/libiberty.a
  36. if PLUGINS
  37. LIBDL = @DLOPEN_LIBS@
  38. endif
  39. if THREADS
  40. THREADSLIB = -lpthread
  41. endif
  42. AM_YFLAGS = -d
  43. # Automake 1.10+ disables lex and yacc output file regeneration if
  44. # maintainer mode is disabled. Avoid this.
  45. am__skiplex =
  46. am__skipyacc =
  47. bin_PROGRAMS = dwp
  48. noinst_PROGRAMS = ld-new incremental-dump
  49. noinst_LIBRARIES = libgold.a
  50. CCFILES = \
  51. archive.cc \
  52. attributes.cc \
  53. binary.cc \
  54. common.cc \
  55. compressed_output.cc \
  56. copy-relocs.cc \
  57. cref.cc \
  58. defstd.cc \
  59. descriptors.cc \
  60. dirsearch.cc \
  61. dynobj.cc \
  62. dwarf_reader.cc \
  63. ehframe.cc \
  64. errors.cc \
  65. expression.cc \
  66. fileread.cc \
  67. gc.cc \
  68. gdb-index.cc \
  69. gold.cc \
  70. gold-threads.cc \
  71. icf.cc \
  72. incremental.cc \
  73. int_encoding.cc \
  74. layout.cc \
  75. mapfile.cc \
  76. merge.cc \
  77. nacl.cc \
  78. object.cc \
  79. options.cc \
  80. output.cc \
  81. parameters.cc \
  82. plugin.cc \
  83. readsyms.cc \
  84. reduced_debug_output.cc \
  85. reloc.cc \
  86. resolve.cc \
  87. script-sections.cc \
  88. script.cc \
  89. stringpool.cc \
  90. symtab.cc \
  91. target.cc \
  92. target-select.cc \
  93. timer.cc \
  94. version.cc \
  95. workqueue.cc \
  96. workqueue-threads.cc
  97. HFILES = \
  98. arm-reloc-property.h \
  99. aarch64-reloc-property.h \
  100. archive.h \
  101. attributes.h \
  102. binary.h \
  103. common.h \
  104. compressed_output.h \
  105. copy-relocs.h \
  106. cref.h \
  107. defstd.h \
  108. dirsearch.h \
  109. descriptors.h \
  110. dynobj.h \
  111. dwarf_reader.h \
  112. ehframe.h \
  113. errors.h \
  114. fileread.h \
  115. freebsd.h \
  116. gc.h \
  117. gdb-index.h \
  118. gold.h \
  119. gold-threads.h \
  120. icf.h \
  121. int_encoding.h \
  122. layout.h \
  123. mapfile.h \
  124. merge.h \
  125. nacl.h \
  126. object.h \
  127. options.h \
  128. output.h \
  129. parameters.h \
  130. plugin.h \
  131. readsyms.h \
  132. reduced_debug_output.h \
  133. reloc.h \
  134. reloc-types.h \
  135. script-c.h \
  136. script-sections.h \
  137. script.h \
  138. stringpool.h \
  139. symtab.h \
  140. target.h \
  141. target-reloc.h \
  142. target-select.h \
  143. timer.h \
  144. tls.h \
  145. token.h \
  146. workqueue.h \
  147. workqueue-internal.h
  148. YFILES = \
  149. yyscript.y
  150. DEFFILES = arm-reloc.def aarch64-reloc.def
  151. EXTRA_DIST = yyscript.c yyscript.h
  152. diststuff: $(EXTRA_DIST)
  153. TARGETSOURCES = \
  154. i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc arm-reloc-property.cc tilegx.cc \
  155. mips.cc aarch64.cc aarch64-reloc-property.cc
  156. ALL_TARGETOBJS = \
  157. i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
  158. arm.$(OBJEXT) arm-reloc-property.$(OBJEXT) tilegx.$(OBJEXT) \
  159. mips.$(OBJEXT) aarch64.$(OBJEXT) aarch64-reloc-property.$(OBJEXT)
  160. libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) $(DEFFILES)
  161. libgold_a_LIBADD = $(LIBOBJS)
  162. sources_var = main.cc
  163. deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
  164. ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
  165. $(THREADSLIB) $(LIBDL) $(ZLIB)
  166. ldflags_var = $(GOLD_LDFLAGS)
  167. ld_new_SOURCES = $(sources_var)
  168. ld_new_DEPENDENCIES = $(deps_var)
  169. ld_new_LDADD = $(ldadd_var)
  170. ld_new_LDFLAGS = $(ldflags_var)
  171. EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
  172. incremental_dump_SOURCES = incremental-dump.cc
  173. incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
  174. $(LIBINTL_DEP)
  175. incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
  176. $(THREADSLIB) $(LIBDL) $(ZLIB)
  177. dwp_SOURCES = dwp.cc
  178. dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
  179. dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \
  180. $(LIBDL) $(ZLIB)
  181. dwp_LDFLAGS = $(GOLD_LDFLAGS)
  182. CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh
  183. # Use an explicit dependency for the bison generated header file.
  184. expression.$(OBJEXT): yyscript.h
  185. script-sections.$(OBJEXT): yyscript.h
  186. script.$(OBJEXT): yyscript.h
  187. # We have to build libgold.a before we run the tests.
  188. check: libgold.a
  189. .PHONY: install-exec-local
  190. install-exec-local: ld-new$(EXEEXT)
  191. $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
  192. n=`echo $(installed_linker) | sed '$(transform)'`; \
  193. $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
  194. ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
  195. if test "$(bindir)" != "$(tooldir)/bin"; then \
  196. rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
  197. ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
  198. || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
  199. fi; \
  200. if test "x$(install_as_default)" = "xyes"; then \
  201. ld=`echo ld | sed '$(transform)'`; \
  202. rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
  203. ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \
  204. || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
  205. if test "$(bindir)" != "$(tooldir)/bin"; then \
  206. rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
  207. ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
  208. || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
  209. fi; \
  210. fi
  211. # We want install to imply install-info as per GNU standards, despite
  212. # the cygnus option.
  213. install-data-local: install-info
  214. POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
  215. po/POTFILES.in: @MAINT@ Makefile
  216. for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
  217. && mv tmp $(srcdir)/po/POTFILES.in
  218. # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
  219. # build ld2. ld1 and ld2 should be identical. ld-new need not be
  220. # identical to ld1, since it was linked with the host linker.
  221. if GCC
  222. if NATIVE_LINKER
  223. gcctestdir1/ld: ld-new
  224. test -d gcctestdir1 || mkdir -p gcctestdir1
  225. rm -f gcctestdir1/ld
  226. (cd gcctestdir1 && $(LN_S) ../ld-new ld)
  227. ld1_SOURCES = $(sources_var)
  228. ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
  229. ld1_LDADD = $(ldadd_var)
  230. ld1_LDFLAGS = -Bgcctestdir1/
  231. gcctestdir2/ld: ld1
  232. test -d gcctestdir2 || mkdir -p gcctestdir2
  233. rm -f gcctestdir2/ld
  234. (cd gcctestdir2 && $(LN_S) ../ld1 ld)
  235. ld2_SOURCES = $(sources_var)
  236. ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
  237. ld2_LDADD = $(ldadd_var)
  238. ld2_LDFLAGS = -Bgcctestdir2/
  239. bootstrap-test: ld2
  240. rm -f $@
  241. echo "#!/bin/sh" > $@
  242. echo "cmp ld1 ld2" >> $@
  243. chmod +x $@
  244. libgold-1-r.o: gcctestdir1/ld libgold.a
  245. gcctestdir1/ld -o $@ -r --whole-archive libgold.a
  246. ld1_r_SOURCES = $(sources_var)
  247. ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
  248. ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
  249. ld1_r_LDFLAGS = -Bgcctestdir1/
  250. gcctestdir2-r/ld: ld1-r
  251. test -d gcctestdir2-r || mkdir -p gcctestdir2-r
  252. rm -f gcctestdir2-r/ld
  253. (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
  254. libgold-2-r.o: gcctestdir2-r/ld libgold.a
  255. gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
  256. ld2_r_SOURCES = $(sources_var)
  257. ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
  258. ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
  259. ld2_r_LDFLAGS = -Bgcctestdir2-r/
  260. bootstrap-test-r: ld2-r
  261. rm -f $@
  262. echo "#!/bin/sh" > $@
  263. echo "cmp ld1-r ld2-r" >> $@
  264. chmod +x $@
  265. check_PROGRAMS = ld1 ld2 ld1-r ld2-r
  266. TESTS = bootstrap-test bootstrap-test-r
  267. # Verify that changing the number of threads doesn't change the
  268. # treehash computation, by building ld1 and ld3 the same way except
  269. # for the number of threads. However, the build ID should change if
  270. # we change the chunk size for --build-id=tree, so ld4 should be
  271. # different. We run the latter test even if multithreading is unavailable,
  272. # because the treehash can still operate in that mode.
  273. check_PROGRAMS += ld4
  274. TESTS += bootstrap-test-treehash-chunksize
  275. gcctestdir3/ld: ld-new
  276. test -d gcctestdir3 || mkdir -p gcctestdir3
  277. rm -f gcctestdir3/ld
  278. (cd gcctestdir3 && $(LN_S) ../ld-new ld)
  279. ld3_SOURCES = $(sources_var)
  280. ld3_DEPENDENCIES = $(deps_var) gcctestdir3/ld
  281. ld3_LDADD = $(ldadd_var)
  282. ld3_LDFLAGS = -Bgcctestdir3/
  283. gcctestdir4/ld: ld-new
  284. test -d gcctestdir4 || mkdir -p gcctestdir4
  285. rm -f gcctestdir4/ld
  286. (cd gcctestdir4 && $(LN_S) ../ld-new ld)
  287. ld4_SOURCES = $(sources_var)
  288. ld4_DEPENDENCIES = $(deps_var) gcctestdir4/ld
  289. ld4_LDADD = $(ldadd_var)
  290. ld4_LDFLAGS = -Bgcctestdir4/
  291. ld1_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
  292. ld2_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
  293. ld3_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
  294. ld4_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12346 -Wl,--build-id-min-file-size-for-treehash=0
  295. if THREADS
  296. ld1_LDFLAGS += -Wl,--thread-count=3
  297. ld2_LDFLAGS += -Wl,--thread-count=3
  298. ld3_LDFLAGS += -Wl,--thread-count=13
  299. ld4_LDFLAGS += -Wl,--thread-count=3
  300. check_PROGRAMS += ld3
  301. TESTS += bootstrap-test-treehash-chunksize
  302. bootstrap-test-treehash: ld1 ld3
  303. rm -f $@
  304. echo "#!/bin/sh" > $@
  305. echo "cmp ld1 ld3" >> $@
  306. chmod +x $@
  307. endif
  308. bootstrap-test-treehash-chunksize: ld1 ld4
  309. rm -f $@
  310. echo "#!/bin/sh" > $@
  311. echo "cmp ld1 ld4 | grep ." >> $@
  312. chmod +x $@
  313. endif
  314. endif