Debian Codegraph @

gdbserver/Makefile.in

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