1 # Copyright (C) 1989-2017 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@
51 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
52 INSTALL_DATA
= @INSTALL_DATA@
57 CXX_DIALECT
= @CXX_DIALECT@
61 # Dependency tracking information.
64 depcomp
= $(SHELL
) $(srcdir)/..
/depcomp
66 # Note that these are overridden by GNU make-specific code below if
67 # GNU make is used. The overrides implement dependency tracking.
68 COMPILE.pre
= $(CXX
) -x c
++ $(CXX_DIALECT
)
69 COMPILE.post
= -c
-o
$@
70 COMPILE
= $(COMPILE.pre
) $(INTERNAL_CFLAGS
) $(COMPILE.post
)
73 # Directory containing source files. Don't clean up the spacing,
74 # this exact string is matched for by the "configure" script.
76 abs_top_srcdir
= @abs_top_srcdir@
77 abs_srcdir
= @abs_srcdir@
80 # It is also possible that you will need to add -I/usr/include/sys to the
81 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
82 # is where it should be according to Posix).
84 # Set this up with gcc if you have gnu ld and the loader will print out
85 # line numbers for undefinded refs.
87 CC_LD
= $(CXX
) $(CXX_DIALECT
)
89 # Where is the "include" directory? Traditionally ../include or ./include
90 INCLUDE_DIR
= ${srcdir}/..
/..
/include
91 INCLUDE_DEP
= $$(INCLUDE_DIR
)
93 LIBIBERTY_BUILDDIR
= build-libiberty-gdbserver
94 LIBIBERTY
= $(LIBIBERTY_BUILDDIR
)/libiberty.a
96 # Where is ust? These will be empty if ust was not available.
101 GNULIB_BUILDDIR
= build-gnulib-gdbserver
102 LIBGNU
= $(GNULIB_BUILDDIR
)/import
/libgnu.a
103 INCGNU
= -I
$(srcdir)/..
/gnulib
/import
-I
$(GNULIB_BUILDDIR
)/import
105 # Generated headers in the gnulib directory. These must be listed
106 # so that they are generated before other files are compiled.
107 GNULIB_H
= $(GNULIB_BUILDDIR
)/import
/string.h @GNULIB_STDINT_H@
109 # All the includes used for CFLAGS and for lint.
110 # -I. for config files.
111 # -I${srcdir} for our headers.
112 # -I$(srcdir)/../regformats for regdef.h.
114 # We do not include ../target or ../nat in here because headers
115 # in those directories should be included with the subdirectory.
116 # e.g.: "target/wait.h".
118 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
$(srcdir)/..
/common \
119 -I
$(srcdir)/..
/regformats
-I
$(srcdir)/..
-I
$(INCLUDE_DIR
) \
122 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
123 # from the config/ directory.
124 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
125 #PROFILE_CFLAGS = -pg
127 WARN_CFLAGS
= @WARN_CFLAGS@
128 WERROR_CFLAGS
= @WERROR_CFLAGS@
130 WARN_CFLAGS_NO_FORMAT
= `echo " $(WARN_CFLAGS) " \
131 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
133 # These are specifically reserved for setting from the command line
134 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
136 CXXFLAGS
= @CXXFLAGS@
137 CPPFLAGS
= @CPPFLAGS@
139 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
140 INTERNAL_CFLAGS_BASE
= ${CXXFLAGS} ${GLOBAL_CFLAGS} \
141 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
142 INTERNAL_WARN_CFLAGS
= ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS
)
143 INTERNAL_CFLAGS
= ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS
) -DGDBSERVER
145 # LDFLAGS is specifically reserved for setting from the command line
148 INTERNAL_LDFLAGS
= $(LDFLAGS
) @RDYNAMIC@
150 # All source files that go into linking GDB remote server.
155 $(srcdir)/gdbreplay.c \
157 $(srcdir)/hostio-errno.c \
158 $(srcdir)/i387-fp.c \
159 $(srcdir)/inferiors.c \
160 $(srcdir)/linux-aarch64-low.c \
161 $(srcdir)/linux-arm-low.c \
162 $(srcdir)/linux-bfin-low.c \
163 $(srcdir)/linux-cris-low.c \
164 $(srcdir)/linux-crisv32-low.c \
165 $(srcdir)/linux-ia64-low.c \
166 $(srcdir)/linux-low.c \
167 $(srcdir)/linux-m32r-low.c \
168 $(srcdir)/linux-m68k-low.c \
169 $(srcdir)/linux-mips-low.c \
170 $(srcdir)/linux-nios2-low.c \
171 $(srcdir)/linux-ppc-low.c \
172 $(srcdir)/linux-s390-low.c \
173 $(srcdir)/linux-sh-low.c \
174 $(srcdir)/linux-sparc-low.c \
175 $(srcdir)/linux-tile-low.c \
176 $(srcdir)/linux-x86-low.c \
177 $(srcdir)/linux-xtensa-low.c \
178 $(srcdir)/mem-break.c \
179 $(srcdir)/proc-service.c \
180 $(srcdir)/proc-service.list \
181 $(srcdir)/regcache.c \
182 $(srcdir)/remote-utils.c \
186 $(srcdir)/thread-db.c \
188 $(srcdir)/win32-arm-low.c \
189 $(srcdir)/win32-i386-low.c \
190 $(srcdir)/win32-low.c \
191 $(srcdir)/wincecompat.c \
192 $(srcdir)/x86-low.c \
193 $(srcdir)/arch
/arm.c \
194 $(srcdir)/arch
/arm-get-next-pcs.c \
195 $(srcdir)/arch
/arm-linux.c \
196 $(srcdir)/common
/btrace-common.c \
197 $(srcdir)/common
/buffer.c \
198 $(srcdir)/common
/cleanups.c \
199 $(srcdir)/common
/common-debug.c \
200 $(srcdir)/common
/common-exceptions.c \
201 $(srcdir)/common
/common-regcache.c \
202 $(srcdir)/common
/common-utils.c \
203 $(srcdir)/common
/errors.c \
204 $(srcdir)/common
/environ.c \
205 $(srcdir)/common
/fileio.c \
206 $(srcdir)/common
/filestuff.c \
207 $(srcdir)/common
/job-control.c \
208 $(srcdir)/common
/gdb_vecs.c \
209 $(srcdir)/common
/new-op.c \
210 $(srcdir)/common
/print-utils.c \
211 $(srcdir)/common
/ptid.c \
212 $(srcdir)/common
/rsp-low.c \
213 $(srcdir)/common
/vec.c \
214 $(srcdir)/common
/xml-utils.c \
215 $(srcdir)/nat
/linux-btrace.c \
216 $(srcdir)/nat
/linux-namespaces.c \
217 $(srcdir)/nat
/linux-osdata.c \
218 $(srcdir)/nat
/linux-personality.c \
219 $(srcdir)/nat
/mips-linux-watch.c \
220 $(srcdir)/nat
/ppc-linux.c \
221 $(srcdir)/nat
/fork-inferior.c \
222 $(srcdir)/target
/waitstatus.c
224 DEPFILES
= @GDBSERVER_DEPFILES@
229 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
238 common-exceptions.o \
264 signals-state-save-restore.o \
278 GDBREPLAY_OBS
= gdbreplay.o version.o
279 GDBSERVER_LIBS
= @GDBSERVER_LIBS@
281 CDEPS
= $(srcdir)/proc-service.list
283 # XML files to compile in to gdbserver, if any.
284 XML_DIR
= $(srcdir)/..
/features
285 XML_FILES
= @srv_xmlfiles@
286 XML_BUILTIN
= @srv_xmlbuiltin@
288 IPA_DEPFILES
= @IPA_DEPFILES@
289 extra_libraries
= @extra_libraries@
291 SUBDIRS
= $(GNULIB_BUILDDIR
) $(LIBIBERTY_BUILDDIR
)
292 CLEANDIRS
= $(SUBDIRS
)
294 # List of subdirectories in the build tree that must exist.
295 # This is used to force build failures in existing trees when
296 # a new directory is added.
297 # The format here is for the `case' shell command.
298 REQUIRED_SUBDIRS
= $(GNULIB_BUILDDIR
) |
$(LIBIBERTY_BUILDDIR
)
302 "exec_prefix=$(exec_prefix)" \
303 "infodir=$(infodir)" \
304 "datarootdir=$(datarootdir)" \
306 "htmldir=$(htmldir)" \
310 "datadir=$(datadir)" \
311 "includedir=$(includedir)" \
312 "against=$(against)" \
313 "DESTDIR=$(DESTDIR)" \
315 "AR_FLAGS=$(AR_FLAGS)" \
319 "CXXFLAGS=$(CXXFLAGS)" \
320 "DLLTOOL=$(DLLTOOL)" \
321 "LDFLAGS=$(LDFLAGS)" \
323 "MAKEINFO=$(MAKEINFO)" \
324 "MAKEHTML=$(MAKEHTML)" \
325 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
326 "INSTALL=$(INSTALL)" \
327 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
328 "INSTALL_DATA=$(INSTALL_DATA)" \
329 "RUNTEST=$(RUNTEST)" \
330 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
332 # All generated files which can be included by another file.
333 generated_files
= config.h
$(GNULIB_H
)
335 all: gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) $(extra_libraries
)
336 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
338 # Traditionally "install" depends on "all". But it may be useful
339 # not to; for example, if the user has made some trivial change to a
340 # source file and doesn't care about rebuilding or just wants to save the
341 # time it takes for make to check that all is up to date.
342 # install-only is intended to address that need.
344 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
347 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
348 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
349 if
[ x
"$(IPA_DEPFILES)" != x
]; then \
350 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(libdir); \
351 $(INSTALL_PROGRAM
) $(IPA_LIB
) $(DESTDIR
)$(libdir)/$(IPA_LIB
); \
353 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(bindir); \
354 $(INSTALL_PROGRAM
) gdbserver
$(EXEEXT
) $(DESTDIR
)$(bindir)/$$n$(EXEEXT
)
355 # Note that we run install and not install-only, as the latter
356 # is not part of GNU standards and in particular not provided
358 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=install "DODIRS=$(SUBDIRS)" subdir_do
361 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
362 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
363 rm -f
$(DESTDIR
)/$(bindir)/$$n$(EXEEXT
) $(DESTDIR
)$(man1dir)/$$n.1
364 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
374 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
376 gdbserver
$(EXEEXT
): $(OBS
) ${ADD_DEPS} ${CDEPS} $(LIBGNU
) $(LIBIBERTY
)
377 rm -f gdbserver
$(EXEEXT
)
378 $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbserver
$(EXEEXT
) $(OBS
) \
379 $(LIBGNU
) $(LIBIBERTY
) $(GDBSERVER_LIBS
) $(XM_CLIBS
)
381 $(LIBGNU
) $(LIBIBERTY
) $(GNULIB_H
): all-lib
382 all-lib
: $(GNULIB_BUILDDIR
)/Makefile
$(LIBIBERTY_BUILDDIR
)/Makefile
383 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=all DODIRS
="$(SUBDIRS)" subdir_do
386 gdbreplay
$(EXEEXT
): $(GDBREPLAY_OBS
) $(LIBGNU
) $(LIBIBERTY
)
387 rm -f gdbreplay
$(EXEEXT
)
388 $(CC_LD
) $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbreplay
$(EXEEXT
) $(GDBREPLAY_OBS
) \
389 $(XM_CLIBS
) $(LIBGNU
) $(LIBIBERTY
)
406 IPA_LIB
= libinproctrace.so
408 $(IPA_LIB
): $(IPA_OBJS
) ${ADD_DEPS} ${CDEPS}
410 $(CC_LD
) -shared
-fPIC
-Wl
,--soname
=$(IPA_LIB
) -Wl
,--no-undefined
$(INTERNAL_CFLAGS
) \
411 $(INTERNAL_LDFLAGS
) -o
$(IPA_LIB
) ${IPA_OBJS} -ldl
-pthread
413 # Put the proper machine-specific files first, so M-. on a machine
414 # specific routine gets the one for the correct machine.
415 # The xyzzy stuff below deals with empty DEPFILES
417 etags
`find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
418 `find ${srcdir}/../config -name ${XM_FILE} -print` \
419 `find ${srcdir}/../config -name ${NAT_FILE} -print` \
420 `for i in yzzy ${DEPFILES}; do \
421 if [ x$$i != xyzzy ]; then \
422 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
429 rm -f
*.o
${ADD_FILES} *~
430 rm -f gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) core make.log
435 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
437 maintainer-clean
realclean distclean: clean
438 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
439 rm -rf
$(GNULIB_BUILDDIR
)
440 rm -f Makefile config.status config.h stamp-h config.log
444 @for i in
$(DODIRS
); do \
446 $(REQUIRED_SUBDIRS
)) \
447 if
[ ! -f .
/$$i/Makefile
] ; then \
448 echo
"Missing $$i/Makefile" >&2 ; \
452 if
[ -f .
/$$i/Makefile
] ; then \
454 $(MAKE
) $(FLAGS_TO_PASS
) $(DO
)) ; then true
; \
459 config.h
: stamp-h
; @true
460 stamp-h
: config.in config.status
461 CONFIG_FILES
="" CONFIG_HEADERS
=config.h
:config.in
$(SHELL
) .
/config.status
463 Makefile
: Makefile.in config.status
464 CONFIG_HEADERS
="" $(SHELL
) .
/config.status
466 $(GNULIB_BUILDDIR
)/Makefile
: $(srcdir)/..
/gnulib
/Makefile.in config.status
467 @cd
$(GNULIB_BUILDDIR
); CONFIG_FILES
="Makefile" \
468 CONFIG_COMMANDS
="depfiles" \
471 $(SHELL
) config.status
473 config.status
: configure configure.srv
$(srcdir)/..
/..
/bfd
/development.sh
474 $(SHELL
) .
/config.status
--recheck
476 # automatic rebuilding in automake-generated Makefiles requires
477 # this rule in the toplevel Makefile, which, with GNU make, causes
478 # the desired updates through the implicit regeneration of the Makefile
479 # and all of its prerequisites.
485 version-generated.c
: Makefile
$(srcdir)/..
/version.in
$(srcdir)/..
/..
/bfd
/version.h
$(srcdir)/..
/common
/create-version.sh
486 $(SHELL
) $(srcdir)/..
/common
/create-version.sh
$(srcdir)/.. \
487 $(host_alias
) $(target_alias
) $@
489 xml-builtin-generated.c
: stamp-xml
; @true
490 stamp-xml
: $(XML_DIR
)/feature_to_c.sh Makefile
$(XML_FILES
)
491 rm -f xml-builtin.tmp
492 $(SHELL
) $(XML_DIR
)/feature_to_c.sh xml-builtin.tmp
$(XML_FILES
)
493 $(SHELL
) $(srcdir)/..
/..
/move-if-change xml-builtin.tmp xml-builtin-generated.c
494 echo stamp
> stamp-xml
496 .PRECIOUS
: xml-builtin.c
498 # GNU Make has an annoying habit of putting *all* the Makefile variables
499 # into the environment, unless you include this target as a circumvention.
500 # Rumor is that this will be fixed (and this target can be removed)
504 # GNU Make 3.63 has a different problem: it keeps tacking command line
505 # overrides onto the definition of $(MAKE). This variable setting
509 regdat_sh
= $(srcdir)/..
/regformats
/regdat.sh
511 UST_CFLAGS
= $(ustinc
) -DCONFIG_UST_GDB_INTEGRATION
513 # Note, we only build the IPA if -fvisibility=hidden is supported in
515 IPAGENT_CFLAGS
= $(INTERNAL_CFLAGS
) $(UST_CFLAGS
) \
516 -fPIC
-DIN_PROCESS_AGENT \
519 IPAGENT_COMPILE
= $(COMPILE.pre
) $(IPAGENT_CFLAGS
) $(COMPILE.post
)
521 # Rules for special cases.
524 $(IPAGENT_COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
528 $(COMPILE
) $(WARN_CFLAGS_NO_FORMAT
) $<
531 arch-i386.o
: ..
/arch
/i386.c
535 # Rules for objects that go in the in-process agent.
537 %-ipa.o
: %-generated.c
538 $(IPAGENT_COMPILE
) $<
542 $(IPAGENT_COMPILE
) $<
545 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
546 # Therefore, this one needs to be before "%.o: %.c" for it to be considered for
547 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
549 # Later versions of GNU Make choose the rule with the shortest stem, so it would
553 $(IPAGENT_COMPILE
) $<
556 %-ipa.o
: ..
/common
/%.c
557 $(IPAGENT_COMPILE
) $<
561 $(IPAGENT_COMPILE
) $<
564 # Rules for objects that go in the gdbserver binary.
590 # Rules for register format descriptions. Suffix destination files with
591 # -generated to identify and clean them easily.
593 %-generated.c
: ..
/regformats
/%.dat |
$(regdat_sh
)
594 $(SHELL
) $(regdat_sh
) $< $@
596 %-generated.c
: ..
/regformats
/arm
/%.dat |
$(regdat_sh
)
597 $(SHELL
) $(regdat_sh
) $< $@
599 %-generated.c
: ..
/regformats
/i386
/%.dat |
$(regdat_sh
)
600 $(SHELL
) $(regdat_sh
) $< $@
602 %-generated.c
: ..
/regformats
/rs6000
/%.dat |
$(regdat_sh
)
603 $(SHELL
) $(regdat_sh
) $< $@
606 # Dependency tracking.
609 ifeq ($(DEPMODE
),depmode
=gcc3
)
610 # Note that we put the dependencies into a .Tpo file, then move them
611 # into place if the compile succeeds. We need this because gcc does
612 # not atomically write the dependency output file.
613 override COMPILE.post
= -c
-o
$@
-MT
$@
-MMD
-MP \
614 -MF
$(DEPDIR
)/$(basename $(@F
)).Tpo
615 override POSTCOMPILE
= @mv
$(DEPDIR
)/$(basename $(@F
)).Tpo \
616 $(DEPDIR
)/$(basename $(@F
)).Po
618 override COMPILE.pre
= source
='$<' object
='$@' libtool
=no \
619 DEPDIR
=$(DEPDIR
) $(DEPMODE
) $(depcomp
) $(CC
)
620 # depcomp handles atomicity for us, so we don't need a postcompile
622 override POSTCOMPILE
=
625 # A list of all the objects we might care about in this build, for
626 # dependency tracking.
627 all_object_files
= $(OBS
) $(GDBREPLAY_OBS
) $(IPA_OBJS
)
629 # Ensure that generated files are created early. Use order-only
630 # dependencies if available. They require GNU make 3.80 or newer,
631 # and the .VARIABLES variable was introduced at the same time.
633 $(all_object_files
): |
$(generated_files
)
635 $(all_object_files
) : $(generated_files
)
639 -include $(patsubst %.o
, $(DEPDIR
)/%.Po
, $(all_object_files
))
641 # Disable implicit make rules.
642 include $(srcdir)/..
/disable-implicit-rules.mk
644 # Do not delete intermediate files (e.g. *-generated.c).
647 # This is the end of "Makefile.in".