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