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