1 # Copyright (C) 1989-2018 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@
52 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
53 INSTALL_DATA
= @INSTALL_DATA@
58 CXX_DIALECT
= @CXX_DIALECT@
62 # Dependency tracking information.
65 depcomp
= $(SHELL
) $(srcdir)/..
/depcomp
67 # Note that these are overridden by GNU make-specific code below if
68 # GNU make is used. The overrides implement dependency tracking.
69 COMPILE.pre
= $(CXX
) -x c
++ $(CXX_DIALECT
)
70 COMPILE.post
= -c
-o
$@
71 COMPILE
= $(COMPILE.pre
) $(INTERNAL_CFLAGS
) $(COMPILE.post
)
74 # Directory containing source files. Don't clean up the spacing,
75 # this exact string is matched for by the "configure" script.
77 abs_top_srcdir
= @abs_top_srcdir@
78 abs_srcdir
= @abs_srcdir@
81 # It is also possible that you will need to add -I/usr/include/sys to the
82 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
83 # is where it should be according to Posix).
85 # Set this up with gcc if you have gnu ld and the loader will print out
86 # line numbers for undefinded refs.
88 CC_LD
= $(CXX
) $(CXX_DIALECT
)
90 # Where is the "include" directory? Traditionally ../include or ./include
91 INCLUDE_DIR
= ${srcdir}/..
/..
/include
92 INCLUDE_DEP
= $$(INCLUDE_DIR
)
94 LIBIBERTY_BUILDDIR
= build-libiberty-gdbserver
95 LIBIBERTY
= $(LIBIBERTY_BUILDDIR
)/libiberty.a
97 # Where is ust? These will be empty if ust was not available.
102 GNULIB_BUILDDIR
= build-gnulib-gdbserver
103 LIBGNU
= $(GNULIB_BUILDDIR
)/import
/libgnu.a
104 INCGNU
= -I
$(srcdir)/..
/gnulib
/import
-I
$(GNULIB_BUILDDIR
)/import
106 # Generated headers in the gnulib directory. These must be listed
107 # so that they are generated before other files are compiled.
108 GNULIB_H
= $(GNULIB_BUILDDIR
)/import
/string.h @GNULIB_STDINT_H@
110 # All the includes used for CFLAGS and for lint.
111 # -I. for config files.
112 # -I${srcdir} for our headers.
113 # -I$(srcdir)/../regformats for regdef.h.
115 # We do not include ../target or ../nat in here because headers
116 # in those directories should be included with the subdirectory.
117 # e.g.: "target/wait.h".
119 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
$(srcdir)/..
/common \
120 -I
$(srcdir)/..
/regformats
-I
$(srcdir)/..
-I
$(INCLUDE_DIR
) \
123 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
124 # from the config/ directory.
125 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
126 #PROFILE_CFLAGS = -pg
128 WARN_CFLAGS
= @WARN_CFLAGS@
129 WERROR_CFLAGS
= @WERROR_CFLAGS@
131 WARN_CFLAGS_NO_FORMAT
= `echo " $(WARN_CFLAGS) " \
132 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
134 # These are specifically reserved for setting from the command line
135 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
137 CXXFLAGS
= @CXXFLAGS@
138 CPPFLAGS
= @CPPFLAGS@
140 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
141 INTERNAL_CFLAGS_BASE
= ${CXXFLAGS} ${GLOBAL_CFLAGS} \
142 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
143 INTERNAL_WARN_CFLAGS
= ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS
)
144 INTERNAL_CFLAGS
= ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS
) -DGDBSERVER
146 # LDFLAGS is specifically reserved for setting from the command line
149 INTERNAL_LDFLAGS
= $(LDFLAGS
) @RDYNAMIC@
151 # All source files that go into linking GDB remote server.
156 $(srcdir)/gdbreplay.c \
158 $(srcdir)/hostio-errno.c \
159 $(srcdir)/i387-fp.c \
160 $(srcdir)/inferiors.c \
161 $(srcdir)/linux-aarch64-low.c \
162 $(srcdir)/linux-arm-low.c \
163 $(srcdir)/linux-bfin-low.c \
164 $(srcdir)/linux-cris-low.c \
165 $(srcdir)/linux-crisv32-low.c \
166 $(srcdir)/linux-ia64-low.c \
167 $(srcdir)/linux-low.c \
168 $(srcdir)/linux-m32r-low.c \
169 $(srcdir)/linux-m68k-low.c \
170 $(srcdir)/linux-mips-low.c \
171 $(srcdir)/linux-nios2-low.c \
172 $(srcdir)/linux-ppc-low.c \
173 $(srcdir)/linux-s390-low.c \
174 $(srcdir)/linux-sh-low.c \
175 $(srcdir)/linux-sparc-low.c \
176 $(srcdir)/linux-tile-low.c \
177 $(srcdir)/linux-x86-low.c \
178 $(srcdir)/linux-xtensa-low.c \
179 $(srcdir)/mem-break.c \
180 $(srcdir)/proc-service.c \
181 $(srcdir)/proc-service.list \
182 $(srcdir)/regcache.c \
183 $(srcdir)/remote-utils.c \
187 $(srcdir)/thread-db.c \
189 $(srcdir)/win32-arm-low.c \
190 $(srcdir)/win32-i386-low.c \
191 $(srcdir)/win32-low.c \
192 $(srcdir)/wincecompat.c \
193 $(srcdir)/x86-low.c \
194 $(srcdir)/arch
/arm.c \
195 $(srcdir)/arch
/arm-get-next-pcs.c \
196 $(srcdir)/arch
/arm-linux.c \
197 $(srcdir)/common
/btrace-common.c \
198 $(srcdir)/common
/buffer.c \
199 $(srcdir)/common
/cleanups.c \
200 $(srcdir)/common
/common-debug.c \
201 $(srcdir)/common
/common-exceptions.c \
202 $(srcdir)/common
/common-regcache.c \
203 $(srcdir)/common
/common-utils.c \
204 $(srcdir)/common
/errors.c \
205 $(srcdir)/common
/environ.c \
206 $(srcdir)/common
/fileio.c \
207 $(srcdir)/common
/filestuff.c \
208 $(srcdir)/common
/job-control.c \
209 $(srcdir)/common
/gdb_tilde_expand.c \
210 $(srcdir)/common
/gdb_vecs.c \
211 $(srcdir)/common
/new-op.c \
212 $(srcdir)/common
/print-utils.c \
213 $(srcdir)/common
/ptid.c \
214 $(srcdir)/common
/rsp-low.c \
215 $(srcdir)/common
/vec.c \
216 $(srcdir)/common
/xml-utils.c \
217 $(srcdir)/nat
/linux-btrace.c \
218 $(srcdir)/nat
/linux-namespaces.c \
219 $(srcdir)/nat
/linux-osdata.c \
220 $(srcdir)/nat
/linux-personality.c \
221 $(srcdir)/nat
/mips-linux-watch.c \
222 $(srcdir)/nat
/ppc-linux.c \
223 $(srcdir)/nat
/fork-inferior.c \
224 $(srcdir)/target
/waitstatus.c
226 DEPFILES
= @GDBSERVER_DEPFILES@
231 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
236 common
/btrace-common.o \
239 common
/common-debug.o \
240 common
/common-exceptions.o \
241 common
/job-control.o \
242 common
/common-regcache.o \
243 common
/common-utils.o \
249 common
/gdb_tilde_expand.o \
252 common
/print-utils.o \
256 common
/signals-state-save-restore.o \
280 GDBREPLAY_OBS
= gdbreplay.o version.o
281 GDBSERVER_LIBS
= @GDBSERVER_LIBS@
283 CDEPS
= $(srcdir)/proc-service.list
285 # XML files to compile in to gdbserver, if any.
286 XML_DIR
= $(srcdir)/..
/features
287 XML_FILES
= @srv_xmlfiles@
288 XML_BUILTIN
= @srv_xmlbuiltin@
290 IPA_DEPFILES
= @IPA_DEPFILES@
291 extra_libraries
= @extra_libraries@
293 SUBDIRS
= $(GNULIB_BUILDDIR
) $(LIBIBERTY_BUILDDIR
)
294 CLEANDIRS
= $(SUBDIRS
)
296 # List of subdirectories in the build tree that must exist.
297 # This is used to force build failures in existing trees when
298 # a new directory is added.
299 # The format here is for the `case' shell command.
300 REQUIRED_SUBDIRS
= $(GNULIB_BUILDDIR
) |
$(LIBIBERTY_BUILDDIR
)
304 "exec_prefix=$(exec_prefix)" \
305 "infodir=$(infodir)" \
306 "datarootdir=$(datarootdir)" \
308 "htmldir=$(htmldir)" \
312 "datadir=$(datadir)" \
313 "includedir=$(includedir)" \
314 "against=$(against)" \
315 "DESTDIR=$(DESTDIR)" \
317 "AR_FLAGS=$(AR_FLAGS)" \
321 "CXXFLAGS=$(CXXFLAGS)" \
322 "DLLTOOL=$(DLLTOOL)" \
323 "LDFLAGS=$(LDFLAGS)" \
325 "MAKEINFO=$(MAKEINFO)" \
326 "MAKEHTML=$(MAKEHTML)" \
327 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
328 "INSTALL=$(INSTALL)" \
329 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
330 "INSTALL_DATA=$(INSTALL_DATA)" \
331 "RUNTEST=$(RUNTEST)" \
332 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
334 # All generated files which can be included by another file.
335 generated_files
= config.h
$(GNULIB_H
)
337 all: gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) $(extra_libraries
)
338 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
340 # Traditionally "install" depends on "all". But it may be useful
341 # not to; for example, if the user has made some trivial change to a
342 # source file and doesn't care about rebuilding or just wants to save the
343 # time it takes for make to check that all is up to date.
344 # install-only is intended to address that need.
346 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
349 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
350 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
351 if
[ x
"$(IPA_DEPFILES)" != x
]; then \
352 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(libdir); \
353 $(INSTALL_PROGRAM
) $(IPA_LIB
) $(DESTDIR
)$(libdir)/$(IPA_LIB
); \
355 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(bindir); \
356 $(INSTALL_PROGRAM
) gdbserver
$(EXEEXT
) $(DESTDIR
)$(bindir)/$$n$(EXEEXT
)
357 # Note that we run install and not install-only, as the latter
358 # is not part of GNU standards and in particular not provided
360 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=install "DODIRS=$(SUBDIRS)" subdir_do
363 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
364 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
365 rm -f
$(DESTDIR
)/$(bindir)/$$n$(EXEEXT
) $(DESTDIR
)$(man1dir)/$$n.1
366 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
376 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
378 gdbserver
$(EXEEXT
): $(OBS
) ${ADD_DEPS} ${CDEPS} $(LIBGNU
) $(LIBIBERTY
)
379 rm -f gdbserver
$(EXEEXT
)
380 $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbserver
$(EXEEXT
) $(OBS
) \
381 $(LIBGNU
) $(LIBIBERTY
) $(GDBSERVER_LIBS
) $(XM_CLIBS
)
383 $(LIBGNU
) $(LIBIBERTY
) $(GNULIB_H
): all-lib
384 all-lib
: $(GNULIB_BUILDDIR
)/Makefile
$(LIBIBERTY_BUILDDIR
)/Makefile
385 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=all DODIRS
="$(SUBDIRS)" subdir_do
388 gdbreplay
$(EXEEXT
): $(GDBREPLAY_OBS
) $(LIBGNU
) $(LIBIBERTY
)
389 rm -f gdbreplay
$(EXEEXT
)
390 $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbreplay
$(EXEEXT
) $(GDBREPLAY_OBS
) \
391 $(XM_CLIBS
) $(LIBGNU
) $(LIBIBERTY
)
395 common
/common-utils-ipa.o \
396 common
/errors-ipa.o \
397 common
/format-ipa.o \
398 common
/print-utils-ipa.o \
399 common
/rsp-low-ipa.o \
408 IPA_LIB
= libinproctrace.so
410 $(IPA_LIB
): $(IPA_OBJS
) ${ADD_DEPS} ${CDEPS}
412 $(CC_LD
) -shared
-fPIC
-Wl
,--soname
=$(IPA_LIB
) -Wl
,--no-undefined
$(INTERNAL_CFLAGS
) \
413 $(INTERNAL_LDFLAGS
) -o
$(IPA_LIB
) ${IPA_OBJS} -ldl
-pthread
415 # Put the proper machine-specific files first, so M-. on a machine
416 # specific routine gets the one for the correct machine.
417 # The xyzzy stuff below deals with empty DEPFILES
419 etags
`find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
420 `find ${srcdir}/../config -name ${XM_FILE} -print` \
421 `find ${srcdir}/../config -name ${NAT_FILE} -print` \
422 `for i in yzzy ${DEPFILES}; do \
423 if [ x$$i != xyzzy ]; then \
424 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
431 rm -f
*.o
${ADD_FILES} *~
432 rm -f gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) core make.log
437 for i in
$(CONFIG_SRC_SUBDIR
); do \
439 rm -f
$$i/$(DEPDIR
)/*; \
441 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
443 maintainer-clean
realclean distclean: clean
444 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
445 rm -rf
$(GNULIB_BUILDDIR
)
446 rm -f Makefile config.status config.h stamp-h config.log
448 for i in
$(CONFIG_SRC_SUBDIR
); do \
449 rmdir
$$i/$(DEPDIR
); \
453 @for i in
$(DODIRS
); do \
455 $(REQUIRED_SUBDIRS
)) \
456 if
[ ! -f .
/$$i/Makefile
] ; then \
457 echo
"Missing $$i/Makefile" >&2 ; \
461 if
[ -f .
/$$i/Makefile
] ; then \
463 $(MAKE
) $(FLAGS_TO_PASS
) $(DO
)) ; then true
; \
468 config.h
: stamp-h
; @true
469 stamp-h
: config.in config.status
470 CONFIG_FILES
="" CONFIG_HEADERS
=config.h
:config.in
$(SHELL
) .
/config.status
472 Makefile
: Makefile.in config.status
473 CONFIG_HEADERS
="" $(SHELL
) .
/config.status
475 $(GNULIB_BUILDDIR
)/Makefile
: $(srcdir)/..
/gnulib
/Makefile.in config.status
476 @cd
$(GNULIB_BUILDDIR
); CONFIG_FILES
="Makefile" \
477 CONFIG_COMMANDS
="depfiles" \
480 $(SHELL
) config.status
482 config.status
: configure configure.srv
$(srcdir)/..
/..
/bfd
/development.sh
483 $(SHELL
) .
/config.status
--recheck
485 # automatic rebuilding in automake-generated Makefiles requires
486 # this rule in the toplevel Makefile, which, with GNU make, causes
487 # the desired updates through the implicit regeneration of the Makefile
488 # and all of its prerequisites.
494 version-generated.c
: Makefile
$(srcdir)/..
/version.in
$(srcdir)/..
/..
/bfd
/version.h
$(srcdir)/..
/common
/create-version.sh
495 $(SHELL
) $(srcdir)/..
/common
/create-version.sh
$(srcdir)/.. \
496 $(host_alias
) $(target_alias
) $@
498 xml-builtin-generated.c
: stamp-xml
; @true
499 stamp-xml
: $(XML_DIR
)/feature_to_c.sh Makefile
$(XML_FILES
)
500 rm -f xml-builtin.tmp
501 $(SHELL
) $(XML_DIR
)/feature_to_c.sh xml-builtin.tmp
$(XML_FILES
)
502 $(SHELL
) $(srcdir)/..
/..
/move-if-change xml-builtin.tmp xml-builtin-generated.c
503 echo stamp
> stamp-xml
505 .PRECIOUS
: xml-builtin.c
507 # GNU Make has an annoying habit of putting *all* the Makefile variables
508 # into the environment, unless you include this target as a circumvention.
509 # Rumor is that this will be fixed (and this target can be removed)
513 # GNU Make 3.63 has a different problem: it keeps tacking command line
514 # overrides onto the definition of $(MAKE). This variable setting
518 regdat_sh
= $(srcdir)/..
/regformats
/regdat.sh
520 UST_CFLAGS
= $(ustinc
) -DCONFIG_UST_GDB_INTEGRATION
522 # Note, we only build the IPA if -fvisibility=hidden is supported in
524 IPAGENT_CFLAGS
= $(INTERNAL_CFLAGS
) $(UST_CFLAGS
) \
525 -fPIC
-DIN_PROCESS_AGENT \
528 IPAGENT_COMPILE
= $(COMPILE.pre
) $(IPAGENT_CFLAGS
) $(COMPILE.post
)
530 # Rules for special cases.
533 $(IPAGENT_COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
537 $(COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
540 # Rules for objects that go in the in-process agent.
542 arch
/%-ipa.o
: ..
/arch
/%.c
543 $(IPAGENT_COMPILE
) $<
546 common
/%-ipa.o
: ..
/common
/%.c
547 $(IPAGENT_COMPILE
) $<
550 %-ipa.o
: %-generated.c
551 $(IPAGENT_COMPILE
) $<
555 $(IPAGENT_COMPILE
) $<
558 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
559 # Therefore, this one needs to be before "%.o: %.c" for it to be considered for
560 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
562 # Later versions of GNU Make choose the rule with the shortest stem, so it would
566 $(IPAGENT_COMPILE
) $<
569 # Rules for objects that go in the gdbserver binary.
571 arch
/%.o
: ..
/arch
/%.c
575 common
/%.o
: ..
/common
/%.c
595 # Rules for register format descriptions. Suffix destination files with
596 # -generated to identify and clean them easily.
598 %-generated.c
: ..
/regformats
/%.dat |
$(regdat_sh
)
599 $(SHELL
) $(regdat_sh
) $< $@
601 %-generated.c
: ..
/regformats
/arm
/%.dat |
$(regdat_sh
)
602 $(SHELL
) $(regdat_sh
) $< $@
604 %-generated.c
: ..
/regformats
/i386
/%.dat |
$(regdat_sh
)
605 $(SHELL
) $(regdat_sh
) $< $@
607 %-generated.c
: ..
/regformats
/rs6000
/%.dat |
$(regdat_sh
)
608 $(SHELL
) $(regdat_sh
) $< $@
611 # Dependency tracking.
614 ifeq ($(DEPMODE
),depmode
=gcc3
)
615 # Note that we put the dependencies into a .Tpo file, then move them
616 # into place if the compile succeeds. We need this because gcc does
617 # not atomically write the dependency output file.
618 override COMPILE.post
= -c
-o
$@
-MT
$@
-MMD
-MP \
619 -MF
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo
620 override POSTCOMPILE
= @mv
$(@D
)/$(DEPDIR
)/$(basename $(@F
)).Tpo \
621 $(@D
)/$(DEPDIR
)/$(basename $(@F
)).Po
623 override COMPILE.pre
= source
='$<' object
='$@' libtool
=no \
624 DEPDIR
=$(DEPDIR
) $(DEPMODE
) $(depcomp
) \
625 $(CXX
) -x c
++ $(CXX_DIALECT
)
626 # depcomp handles atomicity for us, so we don't need a postcompile
628 override POSTCOMPILE
=
631 # A list of all the objects we might care about in this build, for
632 # dependency tracking.
633 all_object_files
= $(OBS
) $(GDBREPLAY_OBS
) $(IPA_OBJS
)
635 # Ensure that generated files are created early. Use order-only
636 # dependencies if available. They require GNU make 3.80 or newer,
637 # and the .VARIABLES variable was introduced at the same time.
639 $(all_object_files
): |
$(generated_files
)
641 $(all_object_files
) : $(generated_files
)
645 -include $(patsubst %.o
, $(DEPDIR
)/%.Po
, $(all_object_files
))
647 # Disable implicit make rules.
648 include $(srcdir)/..
/disable-implicit-rules.mk
650 # Do not delete intermediate files (e.g. *-generated.c).
653 # This is the end of "Makefile.in".