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
$@
86 COMPILE
= $(ECHO_CXX
) $(COMPILE.pre
) $(INTERNAL_CFLAGS
) $(COMPILE.post
)
89 # It is also possible that you will need to add -I/usr/include/sys to the
90 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
91 # is where it should be according to Posix).
93 # Set this up with gcc if you have gnu ld and the loader will print out
94 # line numbers for undefinded refs.
96 CC_LD
= $(CXX
) $(CXX_DIALECT
)
98 # Where is the "include" directory? Traditionally ../include or ./include
99 INCLUDE_DIR
= ${srcdir}/..
/include
100 INCLUDE_DEP
= $$(INCLUDE_DIR
)
102 LIBIBERTY_BUILDDIR
= ..
/libiberty
103 LIBIBERTY
= $(LIBIBERTY_BUILDDIR
)/libiberty.a
105 GDBSUPPORT_BUILDDIR
= ..
/gdbsupport
106 GDBSUPPORT
= $(GDBSUPPORT_BUILDDIR
)/libgdbsupport.a
108 # Where is ust? These will be empty if ust was not available.
113 GNULIB_BUILDDIR
= ..
/gnulib
114 LIBGNU
= $(GNULIB_BUILDDIR
)/import
/libgnu.a
115 INCGNU
= -I
$(srcdir)/..
/gnulib
/import
-I
$(GNULIB_BUILDDIR
)/import
117 # Where is the INTL library? Typically in ../intl.
119 INTL_DEPS
= @LIBINTL_DEP@
120 INTL_CFLAGS
= @INCINTL@
122 INCSUPPORT
= -I
$(srcdir)/..
-I..
124 # All the includes used for CFLAGS and for lint.
125 # -I. for config files.
126 # -I${srcdir} for our headers.
127 # -I$(srcdir)/../gdb/regformats for regdef.h.
129 # We do not include ../target or ../nat in here because headers
130 # in those directories should be included with the subdirectory.
131 # e.g.: "target/wait.h".
133 INCLUDE_CFLAGS
= -I.
-I
${srcdir} \
134 -I
$(srcdir)/..
/gdb
/regformats
-I
$(srcdir)/..
-I
$(INCLUDE_DIR
) \
135 -I
$(srcdir)/..
/gdb
$(INCGNU
) $(INCSUPPORT
) \
138 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
139 # from the config/ directory.
140 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
141 #PROFILE_CFLAGS = -pg
143 WARN_CFLAGS
= @WARN_CFLAGS@
144 WERROR_CFLAGS
= @WERROR_CFLAGS@
146 WARN_CFLAGS_NO_FORMAT
= `echo " $(WARN_CFLAGS) " \
147 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
149 # These are specifically reserved for setting from the command line
150 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
152 CXXFLAGS
= @CXXFLAGS@
153 CPPFLAGS
= @CPPFLAGS@
155 PTHREAD_CFLAGS
= @PTHREAD_CFLAGS@
156 PTHREAD_LIBS
= @PTHREAD_LIBS@
158 WIN32APILIBS
= @WIN32APILIBS@
160 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
161 INTERNAL_CFLAGS_BASE
= ${CXXFLAGS} ${GLOBAL_CFLAGS} \
162 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS
)
163 INTERNAL_WARN_CFLAGS
= ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS
)
164 INTERNAL_CFLAGS
= ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS
) -DGDBSERVER
166 # LDFLAGS is specifically reserved for setting from the command line
169 INTERNAL_LDFLAGS
= $(LDFLAGS
) @RDYNAMIC@
171 # All source files that go into linking GDB remote server.
176 $(srcdir)/gdbreplay.
cc \
177 $(srcdir)/hostio.
cc \
178 $(srcdir)/hostio-errno.
cc \
179 $(srcdir)/i387-fp.
cc \
180 $(srcdir)/inferiors.
cc \
181 $(srcdir)/linux-aarch64-low.
cc \
182 $(srcdir)/linux-arm-low.
cc \
183 $(srcdir)/linux-ia64-low.
cc \
184 $(srcdir)/linux-low.
cc \
185 $(srcdir)/linux-m32r-low.
cc \
186 $(srcdir)/linux-m68k-low.
cc \
187 $(srcdir)/linux-mips-low.
cc \
188 $(srcdir)/linux-nios2-low.
cc \
189 $(srcdir)/linux-ppc-low.
cc \
190 $(srcdir)/linux-riscv-low.
cc \
191 $(srcdir)/linux-s390-low.
cc \
192 $(srcdir)/linux-sh-low.
cc \
193 $(srcdir)/linux-sparc-low.
cc \
194 $(srcdir)/linux-tile-low.
cc \
195 $(srcdir)/linux-x86-low.
cc \
196 $(srcdir)/linux-xtensa-low.
cc \
197 $(srcdir)/mem-break.
cc \
198 $(srcdir)/proc-service.
cc \
199 $(srcdir)/proc-service.list \
200 $(srcdir)/regcache.
cc \
201 $(srcdir)/remote-utils.
cc \
202 $(srcdir)/server.
cc \
203 $(srcdir)/symbol.
cc \
204 $(srcdir)/target.
cc \
205 $(srcdir)/thread-db.
cc \
207 $(srcdir)/win32-arm-low.
cc \
208 $(srcdir)/win32-i386-low.
cc \
209 $(srcdir)/win32-low.
cc \
210 $(srcdir)/wincecompat.
cc \
211 $(srcdir)/x86-low.
cc \
212 $(srcdir)/..
/gdb
/alloc.c \
213 $(srcdir)/..
/gdb
/arch
/arm.c \
214 $(srcdir)/..
/gdb
/arch
/arm-get-next-pcs.c \
215 $(srcdir)/..
/gdb
/arch
/arm-linux.c \
216 $(srcdir)/..
/gdb
/arch
/ppc-linux-common.c \
217 $(srcdir)/..
/gdb
/arch
/riscv.c \
218 $(srcdir)/..
/gdb
/nat
/aarch64-sve-linux-ptrace.c \
219 $(srcdir)/..
/gdb
/nat
/linux-btrace.c \
220 $(srcdir)/..
/gdb
/nat
/linux-namespaces.c \
221 $(srcdir)/..
/gdb
/nat
/linux-osdata.c \
222 $(srcdir)/..
/gdb
/nat
/linux-personality.c \
223 $(srcdir)/..
/gdb
/nat
/mips-linux-watch.c \
224 $(srcdir)/..
/gdb
/nat
/ppc-linux.c \
225 $(srcdir)/..
/gdb
/nat
/riscv-linux-tdesc.c \
226 $(srcdir)/..
/gdb
/nat
/fork-inferior.c \
227 $(srcdir)/..
/gdb
/target
/waitstatus.c
229 DEPFILES
= @GDBSERVER_DEPFILES@
234 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
254 target
/waitstatus.o \
264 GDBSERVER_LIBS
= @GDBSERVER_LIBS@
$(PTHREAD_LIBS
)
266 CDEPS
= $(srcdir)/proc-service.list
268 # XML files to compile in to gdbserver, if any.
269 XML_DIR
= $(srcdir)/..
/gdb
/features
270 XML_FILES
= @srv_xmlfiles@
271 XML_BUILTIN
= @srv_xmlbuiltin@
273 IPA_DEPFILES
= @IPA_DEPFILES@
274 extra_libraries
= @extra_libraries@
278 "exec_prefix=$(exec_prefix)" \
279 "infodir=$(infodir)" \
280 "datarootdir=$(datarootdir)" \
282 "htmldir=$(htmldir)" \
286 "datadir=$(datadir)" \
287 "includedir=$(includedir)" \
288 "against=$(against)" \
289 "DESTDIR=$(DESTDIR)" \
291 "AR_FLAGS=$(AR_FLAGS)" \
295 "CXXFLAGS=$(CXXFLAGS)" \
296 "DLLTOOL=$(DLLTOOL)" \
297 "LDFLAGS=$(LDFLAGS)" \
299 "MAKEINFO=$(MAKEINFO)" \
300 "MAKEHTML=$(MAKEHTML)" \
301 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
302 "INSTALL=$(INSTALL)" \
303 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
304 "INSTALL_DATA=$(INSTALL_DATA)" \
305 "RUNTEST=$(RUNTEST)" \
306 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
308 # All generated files which can be included by another file.
309 generated_files
= config.h
311 all: gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) $(extra_libraries
)
313 # Traditionally "install" depends on "all". But it may be useful
314 # not to; for example, if the user has made some trivial change to a
315 # source file and doesn't care about rebuilding or just wants to save the
316 # time it takes for make to check that all is up to date.
317 # install-only is intended to address that need.
319 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
322 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
323 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
324 if
[ x
"$(IPA_DEPFILES)" != x
]; then \
325 $(SHELL
) $(srcdir)/..
/mkinstalldirs
$(DESTDIR
)$(libdir); \
326 $(INSTALL_PROGRAM_ENV
) $(INSTALL_PROGRAM
) $(IPA_LIB
) $(DESTDIR
)$(libdir)/$(IPA_LIB
); \
328 $(SHELL
) $(srcdir)/..
/mkinstalldirs
$(DESTDIR
)$(bindir); \
329 $(INSTALL_PROGRAM_ENV
) $(INSTALL_PROGRAM
) gdbserver
$(EXEEXT
) $(DESTDIR
)$(bindir)/$$n$(EXEEXT
)
332 $(MAKE
) $(FLAGS_TO_PASS
) INSTALL_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" \
333 install_sh_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG
=-s \
334 `test -z '$(STRIP)' || \
335 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
338 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
339 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
340 rm -f
$(DESTDIR
)/$(bindir)/$$n$(EXEEXT
) $(DESTDIR
)$(man1dir)/$$n.1
351 gdbserver
$(EXEEXT
): $(sort $(OBS
)) ${CDEPS} $(LIBGNU
) $(LIBIBERTY
) \
352 $(INTL_DEPS
) $(GDBSUPPORT
)
353 $(SILENCE
) rm -f gdbserver
$(EXEEXT
)
354 $(ECHO_CXXLD
) $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
355 -o gdbserver
$(EXEEXT
) $(OBS
) $(GDBSUPPORT
) $(LIBGNU
) \
356 $(LIBIBERTY
) $(INTL
) $(GDBSERVER_LIBS
) $(XM_CLIBS
) \
359 gdbreplay
$(EXEEXT
): $(sort $(GDBREPLAY_OBS
)) $(LIBGNU
) $(LIBIBERTY
) \
360 $(INTL_DEPS
) $(GDBSUPPORT
)
361 $(SILENCE
) rm -f gdbreplay
$(EXEEXT
)
362 $(ECHO_CXXLD
) $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
363 -o gdbreplay
$(EXEEXT
) $(GDBREPLAY_OBS
) $(XM_CLIBS
) \
364 $(GDBSUPPORT
) $(LIBGNU
) $(LIBIBERTY
) $(INTL
) \
370 gdbsupport
/common-utils-ipa.o \
371 gdbsupport
/errors-ipa.o \
372 gdbsupport
/format-ipa.o \
373 gdbsupport
/print-utils-ipa.o \
374 gdbsupport
/rsp-low-ipa.o \
375 gdbsupport
/safe-strerror-ipa.o \
376 gdbsupport
/tdesc-ipa.o \
384 IPA_LIB
= libinproctrace.so
386 $(IPA_LIB
): $(sort $(IPA_OBJS
)) ${CDEPS}
387 $(SILENCE
) rm -f
$(IPA_LIB
)
388 $(ECHO_CXXLD
) $(CC_LD
) -shared
-fPIC
-Wl
,--soname
=$(IPA_LIB
) \
389 -Wl
,--no-undefined
$(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) \
390 -o
$(IPA_LIB
) ${IPA_OBJS} -ldl
-pthread
392 # Put the proper machine-specific files first, so M-. on a machine
393 # specific routine gets the one for the correct machine.
394 # The xyzzy stuff below deals with empty DEPFILES
397 `for i in yzzy ${DEPFILES}; do \
398 if [ x$$i != xyzzy ]; then \
399 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
400 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
407 rm -f
*.o
${ADD_FILES} *~
408 rm -f gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) core make.log
413 for i in
$(CONFIG_SRC_SUBDIR
); do \
415 rm -f
$$i/$(DEPDIR
)/*; \
418 maintainer-clean
realclean distclean: clean
419 rm -f Makefile config.status config.h stamp-h config.log
421 for i in
$(CONFIG_SRC_SUBDIR
); do \
422 rmdir
$$i/$(DEPDIR
); \
425 config.h
: stamp-h
; @true
426 stamp-h
: config.in config.status
427 $(SHELL
) .
/config.status config.h
429 Makefile
: Makefile.in config.status
430 $(SHELL
) .
/config.status
$@
432 config.status
: configure configure.srv
$(srcdir)/..
/bfd
/development.sh
433 $(SHELL
) .
/config.status
--recheck
435 # automatic rebuilding in automake-generated Makefiles requires
436 # this rule in the toplevel Makefile, which, with GNU make, causes
437 # the desired updates through the implicit regeneration of the Makefile
438 # and all of its prerequisites.
444 version-generated.
cc: Makefile
$(srcdir)/..
/gdb
/version.in
$(srcdir)/..
/bfd
/version.h
$(srcdir)/..
/gdbsupport
/create-version.sh
445 $(ECHO_GEN
) $(SHELL
) $(srcdir)/..
/gdbsupport
/create-version.sh
$(srcdir)/..
/gdb \
446 $(host_alias
) $(target_alias
) $@
448 xml-builtin-generated.
cc: stamp-xml
; @true
449 stamp-xml
: $(XML_DIR
)/feature_to_c.sh Makefile
$(XML_FILES
)
450 $(SILENCE
) rm -f xml-builtin.tmp
451 $(ECHO_GEN_XML_BUILTIN_GENERATED
) $(SHELL
) $(XML_DIR
)/feature_to_c.sh \
452 xml-builtin.tmp
$(XML_FILES
)
453 $(SILENCE
) $(SHELL
) $(srcdir)/..
/move-if-change xml-builtin.tmp xml-builtin-generated.
cc
454 $(SILENCE
) echo stamp
> stamp-xml
456 .PRECIOUS
: xml-builtin.
cc
458 # GNU Make has an annoying habit of putting *all* the Makefile variables
459 # into the environment, unless you include this target as a circumvention.
460 # Rumor is that this will be fixed (and this target can be removed)
464 # GNU Make 3.63 has a different problem: it keeps tacking command line
465 # overrides onto the definition of $(MAKE). This variable setting
469 regdat_sh
= $(srcdir)/..
/gdb
/regformats
/regdat.sh
471 UST_CFLAGS
= $(ustinc
) -DCONFIG_UST_GDB_INTEGRATION
473 # Undo gnulib replacements for the IPA shared library build.
474 # The gnulib headers are still needed, but gnulib is not linked
475 # into the IPA lib so replacement apis don't work.
476 UNDO_GNULIB_CFLAGS
= -Drpl_strerror_r
=strerror_r
478 # Note, we only build the IPA if -fvisibility=hidden is supported in
480 IPAGENT_CFLAGS
= $(INTERNAL_CFLAGS
) $(UST_CFLAGS
) \
481 $(UNDO_GNULIB_CFLAGS
) \
482 -fPIC
-DIN_PROCESS_AGENT \
485 IPAGENT_COMPILE
= $(ECHO_CXX
) $(COMPILE.pre
) $(IPAGENT_CFLAGS
) $(COMPILE.post
)
487 # Rules for special cases.
490 $(IPAGENT_COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
494 $(COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
497 # Rules for objects that go in the in-process agent.
499 arch
/%-ipa.o
: ..
/gdb
/arch
/%.c
500 $(IPAGENT_COMPILE
) -x c
++ $<
503 gdbsupport
/%-ipa.o
: ..
/gdbsupport
/%.
cc
504 $(IPAGENT_COMPILE
) $<
507 %-ipa.o
: %-generated.
cc
508 $(IPAGENT_COMPILE
) $<
512 $(IPAGENT_COMPILE
) $<
516 $(IPAGENT_COMPILE
) -x c
++ $<
519 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
520 # Therefore, this one needs to be before "%.o: %.cc" for it to be considered for
521 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.cc.
523 # Later versions of GNU Make choose the rule with the shortest stem, so it would
527 $(IPAGENT_COMPILE
) $<
530 # Rules for objects that go in the gdbserver binary.
532 arch
/%.o
: ..
/gdb
/arch
/%.c
544 nat
/%.o
: ..
/gdb
/nat
/%.c
548 target
/%.o
: ..
/gdb
/target
/%.c
556 # Rules for register format descriptions. Suffix destination files with
557 # -generated to identify and clean them easily.
559 %-generated.
cc: ..
/gdb
/regformats
/%.dat
$(regdat_sh
)
560 $(ECHO_REGDAT
) $(SHELL
) $(regdat_sh
) $< $@
562 %-generated.
cc: ..
/gdb
/regformats
/arm
/%.dat
$(regdat_sh
)
563 $(ECHO_REGDAT
) $(SHELL
) $(regdat_sh
) $< $@
565 %-generated.
cc: ..
/gdb
/regformats
/rs6000
/%.dat
$(regdat_sh
)
566 $(ECHO_REGDAT
) $(SHELL
) $(regdat_sh
) $< $@
569 # Dependency tracking.
572 ifeq ($(DEPMODE
),depmode
=gcc3
)
573 # Note that we put the dependencies into a .Tpo file, then move them
574 # into place if the compile succeeds. We need this because gcc does
575 # not atomically write the dependency output file.
576 override COMPILE.post
= -c
-o
$@
-MT
$@
-MMD
-MP \
577 -MF
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo
578 override POSTCOMPILE
= @mv
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo \
579 $(@D
)/$(DEPDIR
)/$(basename $(@F
)).Po
581 override COMPILE.pre
= source
='$<' object
='$@' libtool
=no \
582 DEPDIR
=$(DEPDIR
) $(DEPMODE
) $(depcomp
) \
583 $(CXX
) $(CXX_DIALECT
)
584 # depcomp handles atomicity for us, so we don't need a postcompile
586 override POSTCOMPILE
=
589 # A list of all the objects we might care about in this build, for
590 # dependency tracking.
591 all_object_files
= $(OBS
) $(GDBREPLAY_OBS
) $(IPA_OBJS
)
593 # Ensure that generated files are created early. Use order-only
594 # dependencies if available. They require GNU make 3.80 or newer,
595 # and the .VARIABLES variable was introduced at the same time.
597 $(all_object_files
): |
$(generated_files
)
599 $(all_object_files
) : $(generated_files
)
602 # All the .deps files to include.
603 all_deps_files
= $(foreach dep
,$(patsubst %.o
,%.Po
,$(all_object_files
)),\
604 $(dir $(dep
))/$(DEPDIR
)/$(notdir $(dep
)))
607 -include $(all_deps_files
)
609 # Disable implicit make rules.
610 include $(srcdir)/..
/gdb
/disable-implicit-rules.mk
612 # Do not delete intermediate files (e.g. *-generated.cc).
615 # This is the end of "Makefile.in".