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