RISC-V: Add pause hint instruction.
[deliverable/binutils-gdb.git] / gdbserver / Makefile.in
CommitLineData
3666a048 1# Copyright (C) 1989-2021 Free Software Foundation, Inc.
c906108c
SS
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
32de4b9d 7# the Free Software Foundation; either version 3 of the License, or
c906108c 8# (at your option) any later version.
1b3f6016 9#
c906108c
SS
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.
1b3f6016 14#
c906108c 15# You should have received a copy of the GNU General Public License
32de4b9d 16# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 17
b593ecca
SM
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
d6e9fb05
JK
21prefix = @prefix@
22exec_prefix = @exec_prefix@
c906108c 23
bd885420
YQ
24host_alias = @host_noncanonical@
25target_alias = @target_noncanonical@
d6e9fb05
JK
26program_transform_name = @program_transform_name@
27bindir = @bindir@
28libdir = @libdir@
c906108c
SS
29tooldir = $(libdir)/$(target_alias)
30
96e946ca 31datarootdir = @datarootdir@
d6e9fb05
JK
32datadir = @datadir@
33mandir = @mandir@
c906108c
SS
34man1dir = $(mandir)/man1
35man2dir = $(mandir)/man2
36man3dir = $(mandir)/man3
37man4dir = $(mandir)/man4
38man5dir = $(mandir)/man5
39man6dir = $(mandir)/man6
40man7dir = $(mandir)/man7
41man8dir = $(mandir)/man8
42man9dir = $(mandir)/man9
d6e9fb05 43infodir = @infodir@
085dd6e6 44htmldir = $(prefix)/html
d6e9fb05 45includedir = @includedir@
60d6cfc9 46CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
c906108c 47
bdaed379
HD
48install_sh = @install_sh@
49
a8347a2a 50SHELL = @SHELL@
de7c3b4a 51EXEEXT = @EXEEXT@
c906108c 52
d6e9fb05
JK
53INSTALL = @INSTALL@
54INSTALL_PROGRAM = @INSTALL_PROGRAM@
bdaed379 55INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
d6e9fb05 56INSTALL_DATA = @INSTALL_DATA@
c9a1864a 57RANLIB = @RANLIB@
c906108c 58
84563040 59CC = @CC@
3bc3d82a 60CXX = @CXX@
8629c02c 61CXX_DIALECT = @CXX_DIALECT@
e1d2394b
MS
62AR = @AR@
63AR_FLAGS = rc
bdaed379 64STRIP = @STRIP@
c906108c 65
61c125b9
TT
66# Dependency tracking information.
67DEPMODE = @CCDEPMODE@
68DEPDIR = @DEPDIR@
919adfe8 69depcomp = $(SHELL) $(srcdir)/../depcomp
61c125b9 70
c906108c
SS
71# Directory containing source files. Don't clean up the spacing,
72# this exact string is matched for by the "configure" script.
d6e9fb05 73srcdir = @srcdir@
8629c02c
SM
74abs_top_srcdir = @abs_top_srcdir@
75abs_srcdir = @abs_srcdir@
d6e9fb05 76VPATH = @srcdir@
c906108c 77
9a665d62
TT
78top_builddir = .
79
919adfe8 80include $(srcdir)/../gdb/silent-rules.mk
39be3c7e
SM
81
82# Note that these are overridden by GNU make-specific code below if
83# GNU make is used. The overrides implement dependency tracking.
feacfcac 84COMPILE.pre = $(CXX) $(CXX_DIALECT)
39be3c7e 85COMPILE.post = -c -o $@
39be3c7e
SM
86POSTCOMPILE = @true
87
a038ffd8
SM
88# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
89# override internal flags.
90COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
91
c906108c 92# It is also possible that you will need to add -I/usr/include/sys to the
1b3f6016 93# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
c906108c
SS
94# is where it should be according to Posix).
95
96# Set this up with gcc if you have gnu ld and the loader will print out
97# line numbers for undefinded refs.
8629c02c
SM
98#CC_LD = g++ -static
99CC_LD = $(CXX) $(CXX_DIALECT)
c906108c
SS
100
101# Where is the "include" directory? Traditionally ../include or ./include
919adfe8 102INCLUDE_DIR = ${srcdir}/../include
c906108c
SS
103INCLUDE_DEP = $$(INCLUDE_DIR)
104
1a627e7e 105LIBIBERTY_BUILDDIR = ../libiberty
0b04e523
TT
106LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
107
4635ff97
TT
108GDBSUPPORT_BUILDDIR = ../gdbsupport
109GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a
110
0fb4aa4b
PA
111# Where is ust? These will be empty if ust was not available.
112ustlibs = @ustlibs@
113ustinc = @ustinc@
114
c9a1864a 115# gnulib
1a627e7e 116GNULIB_BUILDDIR = ../gnulib
361cb219 117include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc
ecedbe58 118
9a665d62
TT
119# Where is the INTL library? Typically in ../intl.
120INTL = @LIBINTL@
121INTL_DEPS = @LIBINTL_DEP@
122INTL_CFLAGS = @INCINTL@
123
919adfe8 124INCSUPPORT = -I$(srcdir)/.. -I..
01027315 125
c906108c
SS
126# All the includes used for CFLAGS and for lint.
127# -I. for config files.
7ea81414 128# -I${srcdir} for our headers.
919adfe8 129# -I$(srcdir)/../gdb/regformats for regdef.h.
96d7229d
LM
130#
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".
134#
a0707f3c 135INCLUDE_CFLAGS = -I. -I${srcdir} \
919adfe8 136 -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
9a665d62
TT
137 -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \
138 $(INTL_CFLAGS)
c906108c
SS
139
140# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
141# from the config/ directory.
142GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
143#PROFILE_CFLAGS = -pg
144
d4596a3d
PA
145WARN_CFLAGS = @WARN_CFLAGS@
146WERROR_CFLAGS = @WERROR_CFLAGS@
0729219d 147
d3ce09f5
SS
148WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
149 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
150
a994041d 151# These are specifically reserved for setting from the command line
c906108c 152# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
84563040 153CFLAGS = @CFLAGS@
a994041d 154CXXFLAGS = @CXXFLAGS@
bffc0964 155CPPFLAGS = @CPPFLAGS@
84563040 156
5e030278
TT
157PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
158PTHREAD_LIBS = @PTHREAD_LIBS@
159
4635ff97
TT
160WIN32APILIBS = @WIN32APILIBS@
161
c906108c 162# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
a038ffd8 163INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
5e030278 164 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
8629c02c
SM
165INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
166INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
c906108c
SS
167
168# LDFLAGS is specifically reserved for setting from the command line
169# when running make.
697f7479 170LDFLAGS = @LDFLAGS@
f6de3c42 171INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
c906108c 172
c906108c
SS
173# All source files that go into linking GDB remote server.
174
b593ecca 175SFILES = \
feacfcac
SM
176 $(srcdir)/debug.cc \
177 $(srcdir)/dll.cc \
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 \
6d2d7c56 184 $(srcdir)/linux-arc-low.cc \
feacfcac 185 $(srcdir)/linux-arm-low.cc \
feacfcac
SM
186 $(srcdir)/linux-ia64-low.cc \
187 $(srcdir)/linux-low.cc \
feacfcac
SM
188 $(srcdir)/linux-m68k-low.cc \
189 $(srcdir)/linux-mips-low.cc \
190 $(srcdir)/linux-nios2-low.cc \
191 $(srcdir)/linux-ppc-low.cc \
bf84f706 192 $(srcdir)/linux-riscv-low.cc \
feacfcac
SM
193 $(srcdir)/linux-s390-low.cc \
194 $(srcdir)/linux-sh-low.cc \
195 $(srcdir)/linux-sparc-low.cc \
feacfcac
SM
196 $(srcdir)/linux-x86-low.cc \
197 $(srcdir)/linux-xtensa-low.cc \
198 $(srcdir)/mem-break.cc \
8b558efe 199 $(srcdir)/netbsd-aarch64-low.cc \
62ba5048 200 $(srcdir)/netbsd-amd64-low.cc \
8b667fae 201 $(srcdir)/netbsd-i386-low.cc \
62ba5048
KR
202 $(srcdir)/netbsd-low.cc \
203 $(srcdir)/netbsd-low.h \
feacfcac 204 $(srcdir)/proc-service.cc \
b593ecca 205 $(srcdir)/proc-service.list \
feacfcac
SM
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 \
212 $(srcdir)/utils.cc \
feacfcac
SM
213 $(srcdir)/win32-i386-low.cc \
214 $(srcdir)/win32-low.cc \
feacfcac 215 $(srcdir)/x86-low.cc \
919adfe8 216 $(srcdir)/../gdb/alloc.c \
6d2d7c56 217 $(srcdir)/../gdb/arch/arc.c \
919adfe8
TT
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 \
bf84f706 222 $(srcdir)/../gdb/arch/riscv.c \
919adfe8
TT
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 \
bf84f706 230 $(srcdir)/../gdb/nat/riscv-linux-tdesc.c \
919adfe8
TT
231 $(srcdir)/../gdb/nat/fork-inferior.c \
232 $(srcdir)/../gdb/target/waitstatus.c
c906108c 233
7ea81414 234DEPFILES = @GDBSERVER_DEPFILES@
c906108c 235
e28b3332
DJ
236LIBOBJS = @LIBOBJS@
237
7ea81414 238SOURCES = $(SFILES)
1b3f6016 239TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
c906108c 240
b593ecca 241OBS = \
08f10e02 242 alloc.o \
b593ecca 243 ax.o \
b593ecca
SM
244 debug.o \
245 dll.o \
b593ecca
SM
246 hostio.o \
247 inferiors.o \
248 mem-break.o \
b593ecca 249 notif.o \
b593ecca
SM
250 regcache.o \
251 remote-utils.o \
b593ecca 252 server.o \
b593ecca
SM
253 symbol.o \
254 target.o \
255 tdesc.o \
256 tracepoint.o \
257 utils.o \
b593ecca 258 version.o \
42cd72aa 259 target/waitstatus.o \
b593ecca
SM
260 $(DEPFILES) \
261 $(LIBOBJS) \
262 $(XML_BUILTIN)
263
03349c93 264GDBREPLAY_OBS = \
03349c93
PA
265 gdbreplay.o \
266 utils.o \
267 version.o
268
5e030278 269GDBSERVER_LIBS = @GDBSERVER_LIBS@ $(PTHREAD_LIBS)
b80864fb 270XM_CLIBS = @LIBS@
f6528abd 271CDEPS = $(srcdir)/proc-service.list
c906108c 272
fb1e4ffc 273# XML files to compile in to gdbserver, if any.
919adfe8 274XML_DIR = $(srcdir)/../gdb/features
fb1e4ffc
DJ
275XML_FILES = @srv_xmlfiles@
276XML_BUILTIN = @srv_xmlbuiltin@
277
fa593d66
PA
278IPA_DEPFILES = @IPA_DEPFILES@
279extra_libraries = @extra_libraries@
280
f474844c
JZ
281FLAGS_TO_PASS = \
282 "prefix=$(prefix)" \
283 "exec_prefix=$(exec_prefix)" \
284 "infodir=$(infodir)" \
285 "datarootdir=$(datarootdir)" \
286 "docdir=$(docdir)" \
287 "htmldir=$(htmldir)" \
288 "pdfdir=$(pdfdir)" \
289 "libdir=$(libdir)" \
290 "mandir=$(mandir)" \
291 "datadir=$(datadir)" \
292 "includedir=$(includedir)" \
293 "against=$(against)" \
294 "DESTDIR=$(DESTDIR)" \
295 "AR=$(AR)" \
296 "AR_FLAGS=$(AR_FLAGS)" \
297 "CC=$(CC)" \
298 "CFLAGS=$(CFLAGS)" \
299 "CXX=$(CXX)" \
300 "CXXFLAGS=$(CXXFLAGS)" \
301 "DLLTOOL=$(DLLTOOL)" \
302 "LDFLAGS=$(LDFLAGS)" \
303 "RANLIB=$(RANLIB)" \
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)"
312
fd9bb8b8 313# All generated files which can be included by another file.
1a627e7e 314generated_files = config.h
fd9bb8b8 315
fa593d66 316all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
c906108c
SS
317
318# Traditionally "install" depends on "all". But it may be useful
1b3f6016 319# not to; for example, if the user has made some trivial change to a
c906108c
SS
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.
f474844c
JZ
323install: all
324 @$(MAKE) $(FLAGS_TO_PASS) install-only
325
1b3f6016 326install-only:
c906108c
SS
327 n=`echo gdbserver | sed '$(program_transform_name)'`; \
328 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
12ac6819 329 if [ x"$(IPA_DEPFILES)" != x ]; then \
919adfe8 330 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libdir); \
48189bec 331 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
fa593d66 332 fi; \
919adfe8 333 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
48189bec 334 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
c906108c 335
bdaed379
HD
336install-strip:
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
341
c906108c
SS
342uninstall: force
343 n=`echo gdbserver | sed '$(program_transform_name)'`; \
344 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
f1048712 345 rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
c906108c
SS
346
347installcheck:
348check:
9453113a 349info dvi pdf:
c906108c 350install-info:
9453113a 351install-pdf:
085dd6e6
JM
352html:
353install-html:
1a627e7e 354clean-info:
c906108c 355
9a665d62 356gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
4635ff97 357 $(INTL_DEPS) $(GDBSUPPORT)
39be3c7e
SM
358 $(SILENCE) rm -f gdbserver$(EXEEXT)
359 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
a038ffd8 360 $(CXXFLAGS) \
4635ff97 361 -o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
361cb219
AB
362 $(LIBGNU_EXTRA_LIBS) $(LIBIBERTY) $(INTL) \
363 $(GDBSERVER_LIBS) $(XM_CLIBS) $(WIN32APILIBS)
c9a1864a 364
9a665d62 365gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
4635ff97 366 $(INTL_DEPS) $(GDBSUPPORT)
39be3c7e
SM
367 $(SILENCE) rm -f gdbreplay$(EXEEXT)
368 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
a038ffd8 369 $(CXXFLAGS) \
4635ff97 370 -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
361cb219
AB
371 $(GDBSUPPORT) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) \
372 $(LIBIBERTY) $(INTL) $(WIN32APILIBS)
c906108c 373
a206891a 374IPA_OBJS = \
08f10e02 375 alloc-ipa.o \
a206891a 376 ax-ipa.o \
268a13a5
TT
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 \
ab7d13f0 382 gdbsupport/safe-strerror-ipa.o \
268a13a5 383 gdbsupport/tdesc-ipa.o \
a206891a
SM
384 regcache-ipa.o \
385 remote-utils-ipa.o \
a206891a
SM
386 tdesc-ipa.o \
387 tracepoint-ipa.o \
388 utils-ipa.o \
ef87c8bb 389 ${IPA_DEPFILES}
fa593d66 390
8629c02c 391IPA_LIB = libinproctrace.so
fa593d66 392
8ff03f0b 393$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
39be3c7e
SM
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) \
a038ffd8 397 $(CXXFLAGS) \
96648494 398 -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY) -ldl -pthread
fa593d66 399
c906108c
SS
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
403TAGS: ${TAGFILES}
42ba50ec 404 etags \
c906108c
SS
405 `for i in yzzy ${DEPFILES}; do \
406 if [ x$$i != xyzzy ]; then \
feacfcac 407 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
42cd72aa 408 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
c906108c
SS
409 fi; \
410 done` \
411 ${TAGFILES}
412tags: TAGS
413
dda42c0b 414mostlyclean clean:
c906108c 415 rm -f *.o ${ADD_FILES} *~
de7c3b4a 416 rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
fa593d66 417 rm -f $(IPA_LIB)
feacfcac 418 rm -f *-generated.cc
8fa5b777 419 rm -f stamp-xml
65dd1e59 420 rm -f $(DEPDIR)/*.Po
60d6cfc9
YQ
421 for i in $(CONFIG_SRC_SUBDIR); do \
422 rm -f $$i/*.o; \
423 rm -f $$i/$(DEPDIR)/*; \
424 done
c906108c 425
a59d1c82 426maintainer-clean realclean distclean: clean
c971b7fa
PA
427 rm -f Makefile config.status config.h stamp-h config.log
428 rm -f Makefile
60d6cfc9
YQ
429 for i in $(CONFIG_SRC_SUBDIR); do \
430 rmdir $$i/$(DEPDIR); \
431 done
c971b7fa 432
c3a3ccc7
DJ
433config.h: stamp-h ; @true
434stamp-h: config.in config.status
c5adaa19 435 $(SHELL) ./config.status config.h
0729219d 436
7ea81414 437Makefile: Makefile.in config.status
c5adaa19 438 $(SHELL) ./config.status $@
c906108c 439
919adfe8 440config.status: configure configure.srv $(srcdir)/../bfd/development.sh
d6e9fb05
JK
441 $(SHELL) ./config.status --recheck
442
c9a1864a
YQ
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.
447am--refresh:
448 @:
449
c906108c
SS
450force:
451
feacfcac 452version-generated.cc: Makefile $(srcdir)/../gdb/version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
919adfe8 453 $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/../gdb \
39be3c7e 454 $(host_alias) $(target_alias) $@
c906108c 455
feacfcac 456xml-builtin-generated.cc: stamp-xml; @true
fb1e4ffc 457stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
39be3c7e
SM
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)
feacfcac 461 $(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin-generated.cc
39be3c7e 462 $(SILENCE) echo stamp > stamp-xml
fb1e4ffc 463
feacfcac 464.PRECIOUS: xml-builtin.cc
fb1e4ffc 465
c906108c
SS
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)
469# in GNU Make 4.0.
470.NOEXPORT:
471
472# GNU Make 3.63 has a different problem: it keeps tacking command line
473# overrides onto the definition of $(MAKE). This variable setting
474# will remove them.
8629c02c 475MAKEOVERRIDES =
c906108c 476
919adfe8 477regdat_sh = $(srcdir)/../gdb/regformats/regdat.sh
7a60ad40 478
0fb4aa4b
PA
479UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
480
956cc47c
SN
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.
ab7d13f0 484UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
956cc47c 485
fa593d66
PA
486# Note, we only build the IPA if -fvisibility=hidden is supported in
487# the first place.
bffc0964 488IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
956cc47c 489 $(UNDO_GNULIB_CFLAGS) \
3ba6ad0f 490 -fPIC -DIN_PROCESS_AGENT \
fa593d66
PA
491 -fvisibility=hidden
492
a038ffd8
SM
493# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
494# override internal flags.
495IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
61c125b9 496
1a01e7c6
SM
497# Rules for special cases.
498
feacfcac 499ax-ipa.o: ax.cc
61c125b9
TT
500 $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
501 $(POSTCOMPILE)
61c125b9 502
feacfcac 503ax.o: ax.cc
61c125b9
TT
504 $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
505 $(POSTCOMPILE)
506
a543c5ca
AH
507# Rules for objects that go in the in-process agent.
508
919adfe8 509arch/%-ipa.o: ../gdb/arch/%.c
feacfcac 510 $(IPAGENT_COMPILE) -x c++ $<
b4570e4b
YQ
511 $(POSTCOMPILE)
512
06b3c5bd 513gdbsupport/%-ipa.o: ../gdbsupport/%.cc
a543c5ca
AH
514 $(IPAGENT_COMPILE) $<
515 $(POSTCOMPILE)
a8ebe3d5 516
feacfcac 517%-ipa.o: %-generated.cc
8fa5b777
SM
518 $(IPAGENT_COMPILE) $<
519 $(POSTCOMPILE)
520
feacfcac 521%-ipa.o: %.cc
a8ebe3d5
SM
522 $(IPAGENT_COMPILE) $<
523 $(POSTCOMPILE)
524
919adfe8 525%-ipa.o: ../gdb/%.c
feacfcac 526 $(IPAGENT_COMPILE) -x c++ $<
1ee7b812
BE
527 $(POSTCOMPILE)
528
1a01e7c6 529# Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
feacfcac
SM
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.
1a01e7c6
SM
532#
533# Later versions of GNU Make choose the rule with the shortest stem, so it would
534# work in any order.
535
feacfcac 536%-ipa.o: %-ipa.cc
1a01e7c6
SM
537 $(IPAGENT_COMPILE) $<
538 $(POSTCOMPILE)
539
a543c5ca 540# Rules for objects that go in the gdbserver binary.
36bc18a8 541
919adfe8 542arch/%.o: ../gdb/arch/%.c
feacfcac 543 $(COMPILE) -x c++ $<
5f035c07
YQ
544 $(POSTCOMPILE)
545
feacfcac 546%.o: %-generated.cc
21122961
SM
547 $(COMPILE) $<
548 $(POSTCOMPILE)
549
feacfcac 550%.o: %.cc
6bda016b
SM
551 $(COMPILE) $<
552 $(POSTCOMPILE)
553
919adfe8 554nat/%.o: ../gdb/nat/%.c
feacfcac 555 $(COMPILE) -x c++ $<
c5a22423
SM
556 $(POSTCOMPILE)
557
919adfe8 558target/%.o: ../gdb/target/%.c
feacfcac 559 $(COMPILE) -x c++ $<
21122961 560 $(POSTCOMPILE)
08f10e02 561
919adfe8 562%.o: ../gdb/%.c
feacfcac 563 $(COMPILE) -x c++ $<
08f10e02 564 $(POSTCOMPILE)
21122961 565
8fa5b777
SM
566# Rules for register format descriptions. Suffix destination files with
567# -generated to identify and clean them easily.
c362e621 568
feacfcac 569%-generated.cc: ../gdb/regformats/%.dat $(regdat_sh)
39be3c7e 570 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
c362e621 571
feacfcac 572%-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
39be3c7e 573 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
61c125b9
TT
574
575#
3b165252 576# Dependency tracking.
61c125b9
TT
577#
578
3b165252 579ifeq ($(DEPMODE),depmode=gcc3)
61c125b9
TT
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.
3b165252 583override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
60d6cfc9
YQ
584 -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
585override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
586 $(@D)/$(DEPDIR)/$(basename $(@F)).Po
3b165252
SM
587else
588override COMPILE.pre = source='$<' object='$@' libtool=no \
60d6cfc9 589 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
feacfcac 590 $(CXX) $(CXX_DIALECT)
61c125b9
TT
591# depcomp handles atomicity for us, so we don't need a postcompile
592# step.
3b165252
SM
593override POSTCOMPILE =
594endif
61c125b9
TT
595
596# A list of all the objects we might care about in this build, for
597# dependency tracking.
1798301e 598all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
61c125b9
TT
599
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.
3b165252
SM
603ifdef .VARIABLES
604$(all_object_files): | $(generated_files)
605else
61c125b9 606$(all_object_files) : $(generated_files)
3b165252 607endif
61c125b9 608
f31c089e
SM
609# All the .deps files to include.
610all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
611 $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
612
61c125b9 613# Dependencies.
f31c089e 614-include $(all_deps_files)
61c125b9 615
ad02e4fe 616# Disable implicit make rules.
919adfe8 617include $(srcdir)/../gdb/disable-implicit-rules.mk
ad02e4fe 618
feacfcac 619# Do not delete intermediate files (e.g. *-generated.cc).
50a421ac
SM
620.SECONDARY:
621
c906108c 622# This is the end of "Makefile.in".
This page took 1.737482 seconds and 4 git commands to generate.