1 # Copyright (C) 1989-2020 Free Software Foundation, Inc.
3 # This file is part of GDB.
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.
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.
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/>.
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.
22 exec_prefix = @
exec_prefix@
24 host_alias
= @host_noncanonical@
25 target_alias
= @target_noncanonical@
26 program_transform_name
= @program_transform_name@
29 tooldir
= $(libdir)/$(target_alias
)
31 datarootdir
= @datarootdir@
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
44 htmldir
= $(prefix)/html
45 includedir = @
includedir@
46 CONFIG_SRC_SUBDIR
= @CONFIG_SRC_SUBDIR@
48 install_sh
= @install_sh@
54 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
55 INSTALL_STRIP_PROGRAM
= @INSTALL_STRIP_PROGRAM@
56 INSTALL_DATA
= @INSTALL_DATA@
61 CXX_DIALECT
= @CXX_DIALECT@
66 # Dependency tracking information.
69 depcomp
= $(SHELL
) $(srcdir)/..
/depcomp
71 # Directory containing source files. Don't clean up the spacing,
72 # this exact string is matched for by the "configure" script.
74 abs_top_srcdir
= @abs_top_srcdir@
75 abs_srcdir
= @abs_srcdir@
80 include $(srcdir)/..
/gdb
/silent-rules.mk
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
$@
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
)
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).
96 # Set this up with gcc if you have gnu ld and the loader will print out
97 # line numbers for undefinded refs.
99 CC_LD
= $(CXX
) $(CXX_DIALECT
)
101 # Where is the "include" directory? Traditionally ../include or ./include
102 INCLUDE_DIR
= ${srcdir}/..
/include
103 INCLUDE_DEP
= $$(INCLUDE_DIR
)
105 LIBIBERTY_BUILDDIR
= ..
/libiberty
106 LIBIBERTY
= $(LIBIBERTY_BUILDDIR
)/libiberty.a
108 GDBSUPPORT_BUILDDIR
= ..
/gdbsupport
109 GDBSUPPORT
= $(GDBSUPPORT_BUILDDIR
)/libgdbsupport.a
111 # Where is ust? These will be empty if ust was not available.
116 GNULIB_BUILDDIR
= ..
/gnulib
117 include $(GNULIB_BUILDDIR
)/Makefile.gnulib.inc
119 # Where is the INTL library? Typically in ../intl.
121 INTL_DEPS
= @LIBINTL_DEP@
122 INTL_CFLAGS
= @INCINTL@
124 INCSUPPORT
= -I
$(srcdir)/..
-I..
126 # All the includes used for CFLAGS and for lint.
127 # -I. for config files.
128 # -I${srcdir} for our headers.
129 # -I$(srcdir)/../gdb/regformats for regdef.h.
131 # We do not include ../target or ../nat in here because headers
132 # in those directories should be included with the subdirectory.
133 # e.g.: "target/wait.h".
135 INCLUDE_CFLAGS
= -I.
-I
${srcdir} \
136 -I
$(srcdir)/..
/gdb
/regformats
-I
$(srcdir)/..
-I
$(INCLUDE_DIR
) \
137 -I
$(srcdir)/..
/gdb
$(INCGNU
) $(INCSUPPORT
) \
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
145 WARN_CFLAGS
= @WARN_CFLAGS@
146 WERROR_CFLAGS
= @WERROR_CFLAGS@
148 WARN_CFLAGS_NO_FORMAT
= `echo " $(WARN_CFLAGS) " \
149 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
151 # These are specifically reserved for setting from the command line
152 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
154 CXXFLAGS
= @CXXFLAGS@
155 CPPFLAGS
= @CPPFLAGS@
157 PTHREAD_CFLAGS
= @PTHREAD_CFLAGS@
158 PTHREAD_LIBS
= @PTHREAD_LIBS@
160 WIN32APILIBS
= @WIN32APILIBS@
162 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
163 INTERNAL_CFLAGS_BASE
= ${GLOBAL_CFLAGS} \
164 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS
)
165 INTERNAL_WARN_CFLAGS
= ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS
)
166 INTERNAL_CFLAGS
= ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS
) -DGDBSERVER
168 # LDFLAGS is specifically reserved for setting from the command line
171 INTERNAL_LDFLAGS
= $(LDFLAGS
) @RDYNAMIC@
173 # All source files that go into linking GDB remote server.
178 $(srcdir)/gdbreplay.
cc \
179 $(srcdir)/hostio.
cc \
180 $(srcdir)/hostio-errno.
cc \
181 $(srcdir)/i387-fp.
cc \
182 $(srcdir)/inferiors.
cc \
183 $(srcdir)/linux-aarch64-low.
cc \
184 $(srcdir)/linux-arc-low.
cc \
185 $(srcdir)/linux-arm-low.
cc \
186 $(srcdir)/linux-ia64-low.
cc \
187 $(srcdir)/linux-low.
cc \
188 $(srcdir)/linux-m68k-low.
cc \
189 $(srcdir)/linux-mips-low.
cc \
190 $(srcdir)/linux-nios2-low.
cc \
191 $(srcdir)/linux-ppc-low.
cc \
192 $(srcdir)/linux-riscv-low.
cc \
193 $(srcdir)/linux-s390-low.
cc \
194 $(srcdir)/linux-sh-low.
cc \
195 $(srcdir)/linux-sparc-low.
cc \
196 $(srcdir)/linux-x86-low.
cc \
197 $(srcdir)/linux-xtensa-low.
cc \
198 $(srcdir)/mem-break.
cc \
199 $(srcdir)/netbsd-aarch64-low.
cc \
200 $(srcdir)/netbsd-amd64-low.
cc \
201 $(srcdir)/netbsd-i386-low.
cc \
202 $(srcdir)/netbsd-low.
cc \
203 $(srcdir)/netbsd-low.h \
204 $(srcdir)/proc-service.
cc \
205 $(srcdir)/proc-service.list \
206 $(srcdir)/regcache.
cc \
207 $(srcdir)/remote-utils.
cc \
208 $(srcdir)/server.
cc \
209 $(srcdir)/symbol.
cc \
210 $(srcdir)/target.
cc \
211 $(srcdir)/thread-db.
cc \
213 $(srcdir)/win32-i386-low.
cc \
214 $(srcdir)/win32-low.
cc \
215 $(srcdir)/x86-low.
cc \
216 $(srcdir)/..
/gdb
/alloc.c \
217 $(srcdir)/..
/gdb
/arch
/arc.c \
218 $(srcdir)/..
/gdb
/arch
/arm.c \
219 $(srcdir)/..
/gdb
/arch
/arm-get-next-pcs.c \
220 $(srcdir)/..
/gdb
/arch
/arm-linux.c \
221 $(srcdir)/..
/gdb
/arch
/ppc-linux-common.c \
222 $(srcdir)/..
/gdb
/arch
/riscv.c \
223 $(srcdir)/..
/gdb
/nat
/aarch64-sve-linux-ptrace.c \
224 $(srcdir)/..
/gdb
/nat
/linux-btrace.c \
225 $(srcdir)/..
/gdb
/nat
/linux-namespaces.c \
226 $(srcdir)/..
/gdb
/nat
/linux-osdata.c \
227 $(srcdir)/..
/gdb
/nat
/linux-personality.c \
228 $(srcdir)/..
/gdb
/nat
/mips-linux-watch.c \
229 $(srcdir)/..
/gdb
/nat
/ppc-linux.c \
230 $(srcdir)/..
/gdb
/nat
/riscv-linux-tdesc.c \
231 $(srcdir)/..
/gdb
/nat
/fork-inferior.c \
232 $(srcdir)/..
/gdb
/target
/waitstatus.c
234 DEPFILES
= @GDBSERVER_DEPFILES@
239 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
259 target
/waitstatus.o \
269 GDBSERVER_LIBS
= @GDBSERVER_LIBS@
$(PTHREAD_LIBS
)
271 CDEPS
= $(srcdir)/proc-service.list
273 # XML files to compile in to gdbserver, if any.
274 XML_DIR
= $(srcdir)/..
/gdb
/features
275 XML_FILES
= @srv_xmlfiles@
276 XML_BUILTIN
= @srv_xmlbuiltin@
278 IPA_DEPFILES
= @IPA_DEPFILES@
279 extra_libraries
= @extra_libraries@
283 "exec_prefix=$(exec_prefix)" \
284 "infodir=$(infodir)" \
285 "datarootdir=$(datarootdir)" \
287 "htmldir=$(htmldir)" \
291 "datadir=$(datadir)" \
292 "includedir=$(includedir)" \
293 "against=$(against)" \
294 "DESTDIR=$(DESTDIR)" \
296 "AR_FLAGS=$(AR_FLAGS)" \
300 "CXXFLAGS=$(CXXFLAGS)" \
301 "DLLTOOL=$(DLLTOOL)" \
302 "LDFLAGS=$(LDFLAGS)" \
304 "MAKEINFO=$(MAKEINFO)" \
305 "MAKEHTML=$(MAKEHTML)" \
306 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
307 "INSTALL=$(INSTALL)" \
308 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
309 "INSTALL_DATA=$(INSTALL_DATA)" \
310 "RUNTEST=$(RUNTEST)" \
311 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
313 # All generated files which can be included by another file.
314 generated_files
= config.h
316 all: gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) $(extra_libraries
)
318 # Traditionally "install" depends on "all". But it may be useful
319 # not to; for example, if the user has made some trivial change to a
320 # source file and doesn't care about rebuilding or just wants to save the
321 # time it takes for make to check that all is up to date.
322 # install-only is intended to address that need.
324 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
327 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
328 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
329 if
[ x
"$(IPA_DEPFILES)" != x
]; then \
330 $(SHELL
) $(srcdir)/..
/mkinstalldirs
$(DESTDIR
)$(libdir); \
331 $(INSTALL_PROGRAM_ENV
) $(INSTALL_PROGRAM
) $(IPA_LIB
) $(DESTDIR
)$(libdir)/$(IPA_LIB
); \
333 $(SHELL
) $(srcdir)/..
/mkinstalldirs
$(DESTDIR
)$(bindir); \
334 $(INSTALL_PROGRAM_ENV
) $(INSTALL_PROGRAM
) gdbserver
$(EXEEXT
) $(DESTDIR
)$(bindir)/$$n$(EXEEXT
)
337 $(MAKE
) $(FLAGS_TO_PASS
) INSTALL_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" \
338 install_sh_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG
=-s \
339 `test -z '$(STRIP)' || \
340 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
343 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
344 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
345 rm -f
$(DESTDIR
)/$(bindir)/$$n$(EXEEXT
) $(DESTDIR
)$(man1dir)/$$n.1
356 gdbserver
$(EXEEXT
): $(sort $(OBS
)) ${CDEPS} $(LIBGNU
) $(LIBIBERTY
) \
357 $(INTL_DEPS
) $(GDBSUPPORT
)
358 $(SILENCE
) rm -f gdbserver
$(EXEEXT
)
359 $(ECHO_CXXLD
) $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
361 -o gdbserver
$(EXEEXT
) $(OBS
) $(GDBSUPPORT
) $(LIBGNU
) \
362 $(LIBGNU_EXTRA_LIBS
) $(LIBIBERTY
) $(INTL
) \
363 $(GDBSERVER_LIBS
) $(XM_CLIBS
) $(WIN32APILIBS
)
365 gdbreplay
$(EXEEXT
): $(sort $(GDBREPLAY_OBS
)) $(LIBGNU
) $(LIBIBERTY
) \
366 $(INTL_DEPS
) $(GDBSUPPORT
)
367 $(SILENCE
) rm -f gdbreplay
$(EXEEXT
)
368 $(ECHO_CXXLD
) $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
370 -o gdbreplay
$(EXEEXT
) $(GDBREPLAY_OBS
) $(XM_CLIBS
) \
371 $(GDBSUPPORT
) $(LIBGNU
) $(LIBGNU_EXTRA_LIBS
) \
372 $(LIBIBERTY
) $(INTL
) $(WIN32APILIBS
)
377 gdbsupport
/common-utils-ipa.o \
378 gdbsupport
/errors-ipa.o \
379 gdbsupport
/format-ipa.o \
380 gdbsupport
/print-utils-ipa.o \
381 gdbsupport
/rsp-low-ipa.o \
382 gdbsupport
/safe-strerror-ipa.o \
383 gdbsupport
/tdesc-ipa.o \
391 IPA_LIB
= libinproctrace.so
393 $(IPA_LIB
): $(sort $(IPA_OBJS
)) ${CDEPS}
394 $(SILENCE
) rm -f
$(IPA_LIB
)
395 $(ECHO_CXXLD
) $(CC_LD
) -shared
-fPIC
-Wl
,--soname
=$(IPA_LIB
) \
396 -Wl
,--no-undefined
$(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
398 -o
$(IPA_LIB
) ${IPA_OBJS} -ldl
-pthread
400 # Put the proper machine-specific files first, so M-. on a machine
401 # specific routine gets the one for the correct machine.
402 # The xyzzy stuff below deals with empty DEPFILES
405 `for i in yzzy ${DEPFILES}; do \
406 if [ x$$i != xyzzy ]; then \
407 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
408 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
415 rm -f
*.o
${ADD_FILES} *~
416 rm -f gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) core make.log
421 for i in
$(CONFIG_SRC_SUBDIR
); do \
423 rm -f
$$i/$(DEPDIR
)/*; \
426 maintainer-clean
realclean distclean: clean
427 rm -f Makefile config.status config.h stamp-h config.log
429 for i in
$(CONFIG_SRC_SUBDIR
); do \
430 rmdir
$$i/$(DEPDIR
); \
433 config.h
: stamp-h
; @true
434 stamp-h
: config.in config.status
435 $(SHELL
) .
/config.status config.h
437 Makefile
: Makefile.in config.status
438 $(SHELL
) .
/config.status
$@
440 config.status
: configure configure.srv
$(srcdir)/..
/bfd
/development.sh
441 $(SHELL
) .
/config.status
--recheck
443 # automatic rebuilding in automake-generated Makefiles requires
444 # this rule in the toplevel Makefile, which, with GNU make, causes
445 # the desired updates through the implicit regeneration of the Makefile
446 # and all of its prerequisites.
452 version-generated.
cc: Makefile
$(srcdir)/..
/gdb
/version.in
$(srcdir)/..
/bfd
/version.h
$(srcdir)/..
/gdbsupport
/create-version.sh
453 $(ECHO_GEN
) $(SHELL
) $(srcdir)/..
/gdbsupport
/create-version.sh
$(srcdir)/..
/gdb \
454 $(host_alias
) $(target_alias
) $@
456 xml-builtin-generated.
cc: stamp-xml
; @true
457 stamp-xml
: $(XML_DIR
)/feature_to_c.sh Makefile
$(XML_FILES
)
458 $(SILENCE
) rm -f xml-builtin.tmp
459 $(ECHO_GEN_XML_BUILTIN_GENERATED
) $(SHELL
) $(XML_DIR
)/feature_to_c.sh \
460 xml-builtin.tmp
$(XML_FILES
)
461 $(SILENCE
) $(SHELL
) $(srcdir)/..
/move-if-change xml-builtin.tmp xml-builtin-generated.
cc
462 $(SILENCE
) echo stamp
> stamp-xml
464 .PRECIOUS
: xml-builtin.
cc
466 # GNU Make has an annoying habit of putting *all* the Makefile variables
467 # into the environment, unless you include this target as a circumvention.
468 # Rumor is that this will be fixed (and this target can be removed)
472 # GNU Make 3.63 has a different problem: it keeps tacking command line
473 # overrides onto the definition of $(MAKE). This variable setting
477 regdat_sh
= $(srcdir)/..
/gdb
/regformats
/regdat.sh
479 UST_CFLAGS
= $(ustinc
) -DCONFIG_UST_GDB_INTEGRATION
481 # Undo gnulib replacements for the IPA shared library build.
482 # The gnulib headers are still needed, but gnulib is not linked
483 # into the IPA lib so replacement apis don't work.
484 UNDO_GNULIB_CFLAGS
= -Drpl_strerror_r
=strerror_r
486 # Note, we only build the IPA if -fvisibility=hidden is supported in
488 IPAGENT_CFLAGS
= $(INTERNAL_CFLAGS
) $(UST_CFLAGS
) \
489 $(UNDO_GNULIB_CFLAGS
) \
490 -fPIC
-DIN_PROCESS_AGENT \
493 # CXXFLAGS is at the very end on purpose, so that user-supplied flags can
494 # override internal flags.
495 IPAGENT_COMPILE
= $(ECHO_CXX
) $(COMPILE.pre
) $(IPAGENT_CFLAGS
) $(CXXFLAGS
) $(COMPILE.post
)
497 # Rules for special cases.
500 $(IPAGENT_COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
504 $(COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
507 # Rules for objects that go in the in-process agent.
509 arch
/%-ipa.o
: ..
/gdb
/arch
/%.c
510 $(IPAGENT_COMPILE
) -x c
++ $<
513 gdbsupport
/%-ipa.o
: ..
/gdbsupport
/%.
cc
514 $(IPAGENT_COMPILE
) $<
517 %-ipa.o
: %-generated.
cc
518 $(IPAGENT_COMPILE
) $<
522 $(IPAGENT_COMPILE
) $<
526 $(IPAGENT_COMPILE
) -x c
++ $<
529 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
530 # Therefore, this one needs to be before "%.o: %.cc" for it to be considered for
531 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.cc.
533 # Later versions of GNU Make choose the rule with the shortest stem, so it would
537 $(IPAGENT_COMPILE
) $<
540 # Rules for objects that go in the gdbserver binary.
542 arch
/%.o
: ..
/gdb
/arch
/%.c
554 nat
/%.o
: ..
/gdb
/nat
/%.c
558 target
/%.o
: ..
/gdb
/target
/%.c
566 # Rules for register format descriptions. Suffix destination files with
567 # -generated to identify and clean them easily.
569 %-generated.
cc: ..
/gdb
/regformats
/%.dat
$(regdat_sh
)
570 $(ECHO_REGDAT
) $(SHELL
) $(regdat_sh
) $< $@
572 %-generated.
cc: ..
/gdb
/regformats
/rs6000
/%.dat
$(regdat_sh
)
573 $(ECHO_REGDAT
) $(SHELL
) $(regdat_sh
) $< $@
576 # Dependency tracking.
579 ifeq ($(DEPMODE
),depmode
=gcc3
)
580 # Note that we put the dependencies into a .Tpo file, then move them
581 # into place if the compile succeeds. We need this because gcc does
582 # not atomically write the dependency output file.
583 override COMPILE.post
= -c
-o
$@
-MT
$@
-MMD
-MP \
584 -MF
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo
585 override POSTCOMPILE
= @mv
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo \
586 $(@D
)/$(DEPDIR
)/$(basename $(@F
)).Po
588 override COMPILE.pre
= source
='$<' object
='$@' libtool
=no \
589 DEPDIR
=$(DEPDIR
) $(DEPMODE
) $(depcomp
) \
590 $(CXX
) $(CXX_DIALECT
)
591 # depcomp handles atomicity for us, so we don't need a postcompile
593 override POSTCOMPILE
=
596 # A list of all the objects we might care about in this build, for
597 # dependency tracking.
598 all_object_files
= $(OBS
) $(GDBREPLAY_OBS
) $(IPA_OBJS
)
600 # Ensure that generated files are created early. Use order-only
601 # dependencies if available. They require GNU make 3.80 or newer,
602 # and the .VARIABLES variable was introduced at the same time.
604 $(all_object_files
): |
$(generated_files
)
606 $(all_object_files
) : $(generated_files
)
609 # All the .deps files to include.
610 all_deps_files
= $(foreach dep
,$(patsubst %.o
,%.Po
,$(all_object_files
)),\
611 $(dir $(dep
))/$(DEPDIR
)/$(notdir $(dep
)))
614 -include $(all_deps_files
)
616 # Disable implicit make rules.
617 include $(srcdir)/..
/gdb
/disable-implicit-rules.mk
619 # Do not delete intermediate files (e.g. *-generated.cc).
622 # This is the end of "Makefile.in".