Makefile.in 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. # Copyright (C) 1989-2022 Free Software Foundation, Inc.
  2. # This file is part of GDB.
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program 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. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Please keep lists in this file sorted alphabetically, with one item per line.
  16. # See gdb/Makefile.in for guidelines on ordering files and directories.
  17. prefix = @prefix@
  18. exec_prefix = @exec_prefix@
  19. host_alias = @host_noncanonical@
  20. target_alias = @target_noncanonical@
  21. program_transform_name = @program_transform_name@
  22. bindir = @bindir@
  23. libdir = @libdir@
  24. CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
  25. install_sh = @install_sh@
  26. SHELL = @SHELL@
  27. EXEEXT = @EXEEXT@
  28. INSTALL = @INSTALL@
  29. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  30. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  31. INSTALL_DATA = @INSTALL_DATA@
  32. RANLIB = @RANLIB@
  33. CC = @CC@
  34. CXX = @CXX@
  35. CXX_DIALECT = @CXX_DIALECT@
  36. AR = @AR@
  37. AR_FLAGS = rc
  38. STRIP = @STRIP@
  39. # Dependency tracking information.
  40. DEPMODE = @CCDEPMODE@
  41. DEPDIR = @DEPDIR@
  42. depcomp = $(SHELL) $(srcdir)/../depcomp
  43. # Directory containing source files. Don't clean up the spacing,
  44. # this exact string is matched for by the "configure" script.
  45. srcdir = @srcdir@
  46. abs_top_srcdir = @abs_top_srcdir@
  47. abs_srcdir = @abs_srcdir@
  48. VPATH = @srcdir@
  49. top_builddir = .
  50. include $(srcdir)/../gdb/silent-rules.mk
  51. # Note that these are overridden by GNU make-specific code below if
  52. # GNU make is used. The overrides implement dependency tracking.
  53. COMPILE.pre = $(CXX) $(CXX_DIALECT)
  54. COMPILE.post = -c -o $@
  55. POSTCOMPILE = @true
  56. # CXXFLAGS is at the very end on purpose, so that user-supplied flags can
  57. # override internal flags.
  58. COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
  59. # It is also possible that you will need to add -I/usr/include/sys to the
  60. # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
  61. # is where it should be according to Posix).
  62. # Set this up with gcc if you have gnu ld and the loader will print out
  63. # line numbers for undefinded refs.
  64. #CC_LD = g++ -static
  65. CC_LD = $(CXX) $(CXX_DIALECT)
  66. # Where is the "include" directory? Traditionally ../include or ./include
  67. INCLUDE_DIR = ${srcdir}/../include
  68. INCLUDE_DEP = $$(INCLUDE_DIR)
  69. LIBIBERTY_BUILDDIR = ../libiberty
  70. LIBIBERTY_NORMAL = $(LIBIBERTY_BUILDDIR)/libiberty.a
  71. LIBIBERTY_NOASAN = $(LIBIBERTY_BUILDDIR)/noasan/libiberty.a
  72. LIBIBERTY_PIC = $(LIBIBERTY_BUILDDIR)/pic/libiberty.a
  73. LIBIBERTY_FOR_SHLIB = \
  74. $(if $(wildcard $(LIBIBERTY_NOASAN)),\
  75. $(LIBIBERTY_NOASAN),\
  76. $(if $(wildcard $(LIBIBERTY_PIC)),\
  77. $(LIBIBERTY_PIC),\
  78. $(LIBIBERTY_NORMAL)))
  79. LIBIBERTY = $(LIBIBERTY_NORMAL)
  80. GDBSUPPORT_BUILDDIR = ../gdbsupport
  81. GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a
  82. # Where is ust? These will be empty if ust was not available.
  83. ustlibs = @ustlibs@
  84. ustinc = @ustinc@
  85. # gnulib
  86. GNULIB_PARENT_DIR = ..
  87. include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
  88. # Where is the INTL library? Typically in ../intl.
  89. INTL = @LIBINTL@
  90. INTL_DEPS = @LIBINTL_DEP@
  91. INTL_CFLAGS = @INCINTL@
  92. INCSUPPORT = -I$(srcdir)/.. -I..
  93. # All the includes used for CFLAGS and for lint.
  94. # -I. for config files.
  95. # -I${srcdir} for our headers.
  96. # -I$(srcdir)/../gdb/regformats for regdef.h.
  97. #
  98. # We do not include ../target or ../nat in here because headers
  99. # in those directories should be included with the subdirectory.
  100. # e.g.: "target/wait.h".
  101. #
  102. INCLUDE_CFLAGS = -I. -I${srcdir} \
  103. -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
  104. -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \
  105. $(INTL_CFLAGS)
  106. # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
  107. # from the config/ directory.
  108. GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
  109. #PROFILE_CFLAGS = -pg
  110. WARN_CFLAGS = @WARN_CFLAGS@
  111. WERROR_CFLAGS = @WERROR_CFLAGS@
  112. WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
  113. | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
  114. # These are specifically reserved for setting from the command line
  115. # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
  116. CFLAGS = @CFLAGS@
  117. CXXFLAGS = @CXXFLAGS@
  118. CPPFLAGS = @CPPFLAGS@
  119. PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
  120. PTHREAD_LIBS = @PTHREAD_LIBS@
  121. WIN32APILIBS = @WIN32APILIBS@
  122. # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
  123. INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
  124. ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
  125. INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
  126. INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
  127. # LDFLAGS is specifically reserved for setting from the command line
  128. # when running make.
  129. LDFLAGS = @LDFLAGS@
  130. INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
  131. # All source files that go into linking GDB remote server.
  132. SFILES = \
  133. $(srcdir)/debug.cc \
  134. $(srcdir)/dll.cc \
  135. $(srcdir)/gdbreplay.cc \
  136. $(srcdir)/hostio.cc \
  137. $(srcdir)/i387-fp.cc \
  138. $(srcdir)/inferiors.cc \
  139. $(srcdir)/linux-aarch64-low.cc \
  140. $(srcdir)/linux-arc-low.cc \
  141. $(srcdir)/linux-arm-low.cc \
  142. $(srcdir)/linux-ia64-low.cc \
  143. $(srcdir)/linux-low.cc \
  144. $(srcdir)/linux-m68k-low.cc \
  145. $(srcdir)/linux-mips-low.cc \
  146. $(srcdir)/linux-nios2-low.cc \
  147. $(srcdir)/linux-or1k-low.cc \
  148. $(srcdir)/linux-ppc-low.cc \
  149. $(srcdir)/linux-riscv-low.cc \
  150. $(srcdir)/linux-s390-low.cc \
  151. $(srcdir)/linux-sh-low.cc \
  152. $(srcdir)/linux-sparc-low.cc \
  153. $(srcdir)/linux-x86-low.cc \
  154. $(srcdir)/linux-xtensa-low.cc \
  155. $(srcdir)/mem-break.cc \
  156. $(srcdir)/netbsd-aarch64-low.cc \
  157. $(srcdir)/netbsd-amd64-low.cc \
  158. $(srcdir)/netbsd-i386-low.cc \
  159. $(srcdir)/netbsd-low.cc \
  160. $(srcdir)/netbsd-low.h \
  161. $(srcdir)/proc-service.cc \
  162. $(srcdir)/proc-service.list \
  163. $(srcdir)/regcache.cc \
  164. $(srcdir)/remote-utils.cc \
  165. $(srcdir)/server.cc \
  166. $(srcdir)/symbol.cc \
  167. $(srcdir)/target.cc \
  168. $(srcdir)/thread-db.cc \
  169. $(srcdir)/utils.cc \
  170. $(srcdir)/win32-i386-low.cc \
  171. $(srcdir)/win32-low.cc \
  172. $(srcdir)/x86-low.cc \
  173. $(srcdir)/../gdb/alloc.c \
  174. $(srcdir)/../gdb/arch/arc.c \
  175. $(srcdir)/../gdb/arch/arm.c \
  176. $(srcdir)/../gdb/arch/arm-get-next-pcs.c \
  177. $(srcdir)/../gdb/arch/arm-linux.c \
  178. $(srcdir)/../gdb/arch/ppc-linux-common.c \
  179. $(srcdir)/../gdb/arch/riscv.c \
  180. $(srcdir)/../gdb/nat/aarch64-mte-linux-ptrace.c \
  181. $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
  182. $(srcdir)/../gdb/nat/linux-btrace.c \
  183. $(srcdir)/../gdb/nat/linux-namespaces.c \
  184. $(srcdir)/../gdb/nat/linux-osdata.c \
  185. $(srcdir)/../gdb/nat/linux-personality.c \
  186. $(srcdir)/../gdb/nat/mips-linux-watch.c \
  187. $(srcdir)/../gdb/nat/ppc-linux.c \
  188. $(srcdir)/../gdb/nat/riscv-linux-tdesc.c \
  189. $(srcdir)/../gdb/nat/fork-inferior.c \
  190. $(srcdir)/../gdb/target/waitstatus.c
  191. DEPFILES = @GDBSERVER_DEPFILES@
  192. LIBOBJS = @LIBOBJS@
  193. SOURCES = $(SFILES)
  194. TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
  195. OBS = \
  196. alloc.o \
  197. ax.o \
  198. debug.o \
  199. dll.o \
  200. hostio.o \
  201. inferiors.o \
  202. mem-break.o \
  203. notif.o \
  204. regcache.o \
  205. remote-utils.o \
  206. server.o \
  207. symbol.o \
  208. target.o \
  209. tdesc.o \
  210. tracepoint.o \
  211. utils.o \
  212. version.o \
  213. target/waitstatus.o \
  214. $(DEPFILES) \
  215. $(LIBOBJS) \
  216. $(XML_BUILTIN)
  217. GDBREPLAY_OBS = \
  218. gdbreplay.o \
  219. utils.o \
  220. version.o
  221. GDBSERVER_LIBS = @GDBSERVER_LIBS@ $(PTHREAD_LIBS)
  222. XM_CLIBS = @LIBS@
  223. CDEPS = $(srcdir)/proc-service.list
  224. # XML files to compile in to gdbserver, if any.
  225. XML_DIR = $(srcdir)/../gdb/features
  226. XML_FILES = @srv_xmlfiles@
  227. XML_BUILTIN = @srv_xmlbuiltin@
  228. IPA_DEPFILES = @IPA_DEPFILES@
  229. extra_libraries = @extra_libraries@
  230. FLAGS_TO_PASS = \
  231. "prefix=$(prefix)" \
  232. "exec_prefix=$(exec_prefix)" \
  233. "libdir=$(libdir)" \
  234. "DESTDIR=$(DESTDIR)" \
  235. "AR=$(AR)" \
  236. "AR_FLAGS=$(AR_FLAGS)" \
  237. "CC=$(CC)" \
  238. "CFLAGS=$(CFLAGS)" \
  239. "CXX=$(CXX)" \
  240. "CXXFLAGS=$(CXXFLAGS)" \
  241. "DLLTOOL=$(DLLTOOL)" \
  242. "LDFLAGS=$(LDFLAGS)" \
  243. "RANLIB=$(RANLIB)" \
  244. "MAKEINFO=$(MAKEINFO)" \
  245. "MAKEHTML=$(MAKEHTML)" \
  246. "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
  247. "INSTALL=$(INSTALL)" \
  248. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  249. "INSTALL_DATA=$(INSTALL_DATA)" \
  250. "RUNTEST=$(RUNTEST)" \
  251. "RUNTESTFLAGS=$(RUNTESTFLAGS)"
  252. # All generated files which can be included by another file.
  253. generated_files = config.h
  254. all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
  255. # Traditionally "install" depends on "all". But it may be useful
  256. # not to; for example, if the user has made some trivial change to a
  257. # source file and doesn't care about rebuilding or just wants to save the
  258. # time it takes for make to check that all is up to date.
  259. # install-only is intended to address that need.
  260. install: all
  261. @$(MAKE) $(FLAGS_TO_PASS) install-only
  262. install-only:
  263. n=`echo gdbserver | sed '$(program_transform_name)'`; \
  264. if [ x$$n = x ]; then n=gdbserver; else true; fi; \
  265. if [ x"$(IPA_DEPFILES)" != x ]; then \
  266. $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libdir); \
  267. $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
  268. fi; \
  269. $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
  270. $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
  271. install-strip:
  272. $(MAKE) $(FLAGS_TO_PASS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  273. install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  274. `test -z '$(STRIP)' || \
  275. echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
  276. uninstall: force
  277. n=`echo gdbserver | sed '$(program_transform_name)'`; \
  278. if [ x$$n = x ]; then n=gdbserver; else true; fi; \
  279. if [ x"$(IPA_DEPFILES)" != x ]; then \
  280. rm -f $(DESTDIR)$(libdir)/$(IPA_LIB); \
  281. fi; \
  282. rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT)
  283. installcheck:
  284. check:
  285. info dvi pdf:
  286. install-info:
  287. install-pdf:
  288. html:
  289. install-html:
  290. clean-info:
  291. gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
  292. $(INTL_DEPS) $(GDBSUPPORT)
  293. $(SILENCE) rm -f gdbserver$(EXEEXT)
  294. $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
  295. $(CXXFLAGS) \
  296. -o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
  297. $(LIBGNU_EXTRA_LIBS) $(LIBIBERTY) $(INTL) \
  298. $(GDBSERVER_LIBS) $(XM_CLIBS) $(WIN32APILIBS)
  299. gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
  300. $(INTL_DEPS) $(GDBSUPPORT)
  301. $(SILENCE) rm -f gdbreplay$(EXEEXT)
  302. $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
  303. $(CXXFLAGS) \
  304. -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
  305. $(GDBSUPPORT) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) \
  306. $(LIBIBERTY) $(INTL) $(WIN32APILIBS)
  307. IPA_OBJS = \
  308. alloc-ipa.o \
  309. ax-ipa.o \
  310. gdbsupport/common-utils-ipa.o \
  311. gdbsupport/errors-ipa.o \
  312. gdbsupport/format-ipa.o \
  313. gdbsupport/print-utils-ipa.o \
  314. gdbsupport/rsp-low-ipa.o \
  315. gdbsupport/safe-strerror-ipa.o \
  316. gdbsupport/tdesc-ipa.o \
  317. regcache-ipa.o \
  318. remote-utils-ipa.o \
  319. tdesc-ipa.o \
  320. tracepoint-ipa.o \
  321. utils-ipa.o \
  322. ${IPA_DEPFILES}
  323. IPA_LIB = libinproctrace.so
  324. $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
  325. $(SILENCE) rm -f $(IPA_LIB)
  326. $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
  327. -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
  328. $(CXXFLAGS) \
  329. -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread
  330. # Put the proper machine-specific files first, so M-. on a machine
  331. # specific routine gets the one for the correct machine.
  332. # The xyzzy stuff below deals with empty DEPFILES
  333. TAGS: ${TAGFILES}
  334. etags \
  335. `for i in yzzy ${DEPFILES}; do \
  336. if [ x$$i != xyzzy ]; then \
  337. echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
  338. -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
  339. fi; \
  340. done` \
  341. ${TAGFILES}
  342. tags: TAGS
  343. mostlyclean clean:
  344. rm -f *.o ${ADD_FILES} *~
  345. rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
  346. rm -f $(IPA_LIB)
  347. rm -f *-generated.cc
  348. rm -f stamp-xml
  349. rm -f $(DEPDIR)/*.Po
  350. for i in $(CONFIG_SRC_SUBDIR); do \
  351. rm -f $$i/*.o; \
  352. rm -f $$i/$(DEPDIR)/*; \
  353. done
  354. maintainer-clean realclean distclean: clean
  355. rm -f Makefile config.status config.h stamp-h config.log config.cache
  356. for i in $(CONFIG_SRC_SUBDIR); do \
  357. rmdir $$i/$(DEPDIR); \
  358. done
  359. config.h: stamp-h ; @true
  360. stamp-h: config.in config.status
  361. $(SHELL) ./config.status config.h
  362. Makefile: Makefile.in config.status
  363. $(SHELL) ./config.status $@
  364. config.status: configure configure.srv $(srcdir)/../bfd/development.sh
  365. $(SHELL) ./config.status --recheck
  366. # automatic rebuilding in automake-generated Makefiles requires
  367. # this rule in the toplevel Makefile, which, with GNU make, causes
  368. # the desired updates through the implicit regeneration of the Makefile
  369. # and all of its prerequisites.
  370. am--refresh:
  371. @:
  372. force:
  373. version-generated.cc: Makefile $(srcdir)/../gdb/version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
  374. $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/../gdb \
  375. $(host_alias) $(target_alias) $@
  376. xml-builtin-generated.cc: stamp-xml; @true
  377. stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
  378. $(SILENCE) rm -f xml-builtin.tmp
  379. $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
  380. xml-builtin.tmp $(XML_FILES)
  381. $(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin-generated.cc
  382. $(SILENCE) echo stamp > stamp-xml
  383. .PRECIOUS: xml-builtin.cc
  384. # GNU Make has an annoying habit of putting *all* the Makefile variables
  385. # into the environment, unless you include this target as a circumvention.
  386. # Rumor is that this will be fixed (and this target can be removed)
  387. # in GNU Make 4.0.
  388. .NOEXPORT:
  389. # GNU Make 3.63 has a different problem: it keeps tacking command line
  390. # overrides onto the definition of $(MAKE). This variable setting
  391. # will remove them.
  392. MAKEOVERRIDES =
  393. regdat_sh = $(srcdir)/../gdb/regformats/regdat.sh
  394. UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
  395. # Undo gnulib replacements for the IPA shared library build.
  396. # The gnulib headers are still needed, but gnulib is not linked
  397. # into the IPA lib so replacement apis don't work.
  398. UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r -Drpl_free=free
  399. # Note, we only build the IPA if -fvisibility=hidden is supported in
  400. # the first place.
  401. IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
  402. $(UNDO_GNULIB_CFLAGS) \
  403. -fPIC -DIN_PROCESS_AGENT \
  404. -fvisibility=hidden
  405. # CXXFLAGS is at the very end on purpose, so that user-supplied flags can
  406. # override internal flags.
  407. IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
  408. # Rules for special cases.
  409. ax-ipa.o: ax.cc
  410. $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
  411. $(POSTCOMPILE)
  412. ax.o: ax.cc
  413. $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
  414. $(POSTCOMPILE)
  415. # Rules for objects that go in the in-process agent.
  416. arch/%-ipa.o: ../gdb/arch/%.c
  417. $(IPAGENT_COMPILE) -x c++ $<
  418. $(POSTCOMPILE)
  419. gdbsupport/%-ipa.o: ../gdbsupport/%.cc
  420. $(IPAGENT_COMPILE) $<
  421. $(POSTCOMPILE)
  422. %-ipa.o: %-generated.cc
  423. $(IPAGENT_COMPILE) $<
  424. $(POSTCOMPILE)
  425. %-ipa.o: %.cc
  426. $(IPAGENT_COMPILE) $<
  427. $(POSTCOMPILE)
  428. %-ipa.o: ../gdb/%.c
  429. $(IPAGENT_COMPILE) -x c++ $<
  430. $(POSTCOMPILE)
  431. # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
  432. # Therefore, this one needs to be before "%.o: %.cc" for it to be considered for
  433. # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.cc.
  434. #
  435. # Later versions of GNU Make choose the rule with the shortest stem, so it would
  436. # work in any order.
  437. %-ipa.o: %-ipa.cc
  438. $(IPAGENT_COMPILE) $<
  439. $(POSTCOMPILE)
  440. # Rules for objects that go in the gdbserver binary.
  441. arch/%.o: ../gdb/arch/%.c
  442. $(COMPILE) -x c++ $<
  443. $(POSTCOMPILE)
  444. %.o: %-generated.cc
  445. $(COMPILE) $<
  446. $(POSTCOMPILE)
  447. %.o: %.cc
  448. $(COMPILE) $<
  449. $(POSTCOMPILE)
  450. nat/%.o: ../gdb/nat/%.c
  451. $(COMPILE) -x c++ $<
  452. $(POSTCOMPILE)
  453. target/%.o: ../gdb/target/%.c
  454. $(COMPILE) -x c++ $<
  455. $(POSTCOMPILE)
  456. %.o: ../gdb/%.c
  457. $(COMPILE) -x c++ $<
  458. $(POSTCOMPILE)
  459. # Rules for register format descriptions. Suffix destination files with
  460. # -generated to identify and clean them easily.
  461. %-generated.cc: ../gdb/regformats/%.dat $(regdat_sh)
  462. $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
  463. %-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
  464. $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
  465. #
  466. # Dependency tracking.
  467. #
  468. ifeq ($(DEPMODE),depmode=gcc3)
  469. # Note that we put the dependencies into a .Tpo file, then move them
  470. # into place if the compile succeeds. We need this because gcc does
  471. # not atomically write the dependency output file.
  472. override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
  473. -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
  474. override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
  475. $(@D)/$(DEPDIR)/$(basename $(@F)).Po
  476. else
  477. override COMPILE.pre = source='$<' object='$@' libtool=no \
  478. DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
  479. $(CXX) $(CXX_DIALECT)
  480. # depcomp handles atomicity for us, so we don't need a postcompile
  481. # step.
  482. override POSTCOMPILE =
  483. endif
  484. # A list of all the objects we might care about in this build, for
  485. # dependency tracking.
  486. all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
  487. # Ensure that generated files are created early. Use order-only
  488. # dependencies if available. They require GNU make 3.80 or newer,
  489. # and the .VARIABLES variable was introduced at the same time.
  490. ifdef .VARIABLES
  491. $(all_object_files): | $(generated_files)
  492. else
  493. $(all_object_files) : $(generated_files)
  494. endif
  495. # All the .deps files to include.
  496. all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
  497. $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
  498. # Dependencies.
  499. -include $(all_deps_files)
  500. # Disable implicit make rules.
  501. include $(srcdir)/../gdb/disable-implicit-rules.mk
  502. # Do not delete intermediate files (e.g. *-generated.cc).
  503. .SECONDARY:
  504. # This is the end of "Makefile.in".