gdb/riscv: Update API for looking up target descriptions
[deliverable/binutils-gdb.git] / gdbserver / Makefile.in
CommitLineData
b811d2c2 1# Copyright (C) 1989-2020 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
919adfe8 78include $(srcdir)/../gdb/silent-rules.mk
39be3c7e
SM
79
80# Note that these are overridden by GNU make-specific code below if
81# GNU make is used. The overrides implement dependency tracking.
feacfcac 82COMPILE.pre = $(CXX) $(CXX_DIALECT)
39be3c7e
SM
83COMPILE.post = -c -o $@
84COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
85POSTCOMPILE = @true
86
c906108c 87# It is also possible that you will need to add -I/usr/include/sys to the
1b3f6016 88# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
c906108c
SS
89# is where it should be according to Posix).
90
91# Set this up with gcc if you have gnu ld and the loader will print out
92# line numbers for undefinded refs.
8629c02c
SM
93#CC_LD = g++ -static
94CC_LD = $(CXX) $(CXX_DIALECT)
c906108c
SS
95
96# Where is the "include" directory? Traditionally ../include or ./include
919adfe8 97INCLUDE_DIR = ${srcdir}/../include
c906108c
SS
98INCLUDE_DEP = $$(INCLUDE_DIR)
99
1a627e7e 100LIBIBERTY_BUILDDIR = ../libiberty
0b04e523
TT
101LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
102
0fb4aa4b
PA
103# Where is ust? These will be empty if ust was not available.
104ustlibs = @ustlibs@
105ustinc = @ustinc@
106
c9a1864a 107# gnulib
1a627e7e 108GNULIB_BUILDDIR = ../gnulib
c971b7fa 109LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
919adfe8 110INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
ecedbe58 111
919adfe8 112INCSUPPORT = -I$(srcdir)/.. -I..
01027315 113
c906108c
SS
114# All the includes used for CFLAGS and for lint.
115# -I. for config files.
7ea81414 116# -I${srcdir} for our headers.
919adfe8 117# -I$(srcdir)/../gdb/regformats for regdef.h.
96d7229d
LM
118#
119# We do not include ../target or ../nat in here because headers
120# in those directories should be included with the subdirectory.
121# e.g.: "target/wait.h".
122#
a0707f3c 123INCLUDE_CFLAGS = -I. -I${srcdir} \
919adfe8
TT
124 -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
125 -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT)
c906108c
SS
126
127# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
128# from the config/ directory.
129GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
130#PROFILE_CFLAGS = -pg
131
d4596a3d
PA
132WARN_CFLAGS = @WARN_CFLAGS@
133WERROR_CFLAGS = @WERROR_CFLAGS@
0729219d 134
d3ce09f5
SS
135WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
136 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
137
a994041d 138# These are specifically reserved for setting from the command line
c906108c 139# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
84563040 140CFLAGS = @CFLAGS@
a994041d 141CXXFLAGS = @CXXFLAGS@
bffc0964 142CPPFLAGS = @CPPFLAGS@
84563040 143
5e030278
TT
144PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
145PTHREAD_LIBS = @PTHREAD_LIBS@
146
c906108c 147# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
8629c02c 148INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
5e030278 149 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
8629c02c
SM
150INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
151INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
c906108c
SS
152
153# LDFLAGS is specifically reserved for setting from the command line
154# when running make.
697f7479 155LDFLAGS = @LDFLAGS@
f6de3c42 156INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
c906108c 157
c906108c
SS
158# All source files that go into linking GDB remote server.
159
b593ecca 160SFILES = \
feacfcac
SM
161 $(srcdir)/debug.cc \
162 $(srcdir)/dll.cc \
163 $(srcdir)/gdbreplay.cc \
164 $(srcdir)/hostio.cc \
165 $(srcdir)/hostio-errno.cc \
166 $(srcdir)/i387-fp.cc \
167 $(srcdir)/inferiors.cc \
168 $(srcdir)/linux-aarch64-low.cc \
169 $(srcdir)/linux-arm-low.cc \
170 $(srcdir)/linux-bfin-low.cc \
171 $(srcdir)/linux-cris-low.cc \
172 $(srcdir)/linux-crisv32-low.cc \
173 $(srcdir)/linux-ia64-low.cc \
174 $(srcdir)/linux-low.cc \
175 $(srcdir)/linux-m32r-low.cc \
176 $(srcdir)/linux-m68k-low.cc \
177 $(srcdir)/linux-mips-low.cc \
178 $(srcdir)/linux-nios2-low.cc \
179 $(srcdir)/linux-ppc-low.cc \
180 $(srcdir)/linux-s390-low.cc \
181 $(srcdir)/linux-sh-low.cc \
182 $(srcdir)/linux-sparc-low.cc \
183 $(srcdir)/linux-tile-low.cc \
184 $(srcdir)/linux-x86-low.cc \
185 $(srcdir)/linux-xtensa-low.cc \
186 $(srcdir)/mem-break.cc \
187 $(srcdir)/proc-service.cc \
b593ecca 188 $(srcdir)/proc-service.list \
feacfcac
SM
189 $(srcdir)/regcache.cc \
190 $(srcdir)/remote-utils.cc \
191 $(srcdir)/server.cc \
192 $(srcdir)/symbol.cc \
193 $(srcdir)/target.cc \
194 $(srcdir)/thread-db.cc \
195 $(srcdir)/utils.cc \
196 $(srcdir)/win32-arm-low.cc \
197 $(srcdir)/win32-i386-low.cc \
198 $(srcdir)/win32-low.cc \
199 $(srcdir)/wincecompat.cc \
200 $(srcdir)/x86-low.cc \
919adfe8
TT
201 $(srcdir)/../gdb/alloc.c \
202 $(srcdir)/../gdb/arch/arm.c \
203 $(srcdir)/../gdb/arch/arm-get-next-pcs.c \
204 $(srcdir)/../gdb/arch/arm-linux.c \
205 $(srcdir)/../gdb/arch/ppc-linux-common.c \
06b3c5bd
SM
206 $(srcdir)/../gdbsupport/btrace-common.cc \
207 $(srcdir)/../gdbsupport/buffer.cc \
208 $(srcdir)/../gdbsupport/cleanups.cc \
209 $(srcdir)/../gdbsupport/common-debug.cc \
210 $(srcdir)/../gdbsupport/common-exceptions.cc \
211 $(srcdir)/../gdbsupport/common-inferior.cc \
212 $(srcdir)/../gdbsupport/common-regcache.cc \
213 $(srcdir)/../gdbsupport/common-utils.cc \
214 $(srcdir)/../gdbsupport/errors.cc \
215 $(srcdir)/../gdbsupport/environ.cc \
216 $(srcdir)/../gdbsupport/fileio.cc \
217 $(srcdir)/../gdbsupport/filestuff.cc \
218 $(srcdir)/../gdbsupport/job-control.cc \
219 $(srcdir)/../gdbsupport/gdb-dlfcn.cc \
220 $(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
221 $(srcdir)/../gdbsupport/gdb_vecs.cc \
222 $(srcdir)/../gdbsupport/gdb_wait.cc \
223 $(srcdir)/../gdbsupport/netstuff.cc \
224 $(srcdir)/../gdbsupport/new-op.cc \
225 $(srcdir)/../gdbsupport/pathstuff.cc \
226 $(srcdir)/../gdbsupport/print-utils.cc \
227 $(srcdir)/../gdbsupport/ptid.cc \
228 $(srcdir)/../gdbsupport/rsp-low.cc \
229 $(srcdir)/../gdbsupport/safe-strerror.cc \
230 $(srcdir)/../gdbsupport/tdesc.cc \
231 $(srcdir)/../gdbsupport/xml-utils.cc \
919adfe8
TT
232 $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
233 $(srcdir)/../gdb/nat/linux-btrace.c \
234 $(srcdir)/../gdb/nat/linux-namespaces.c \
235 $(srcdir)/../gdb/nat/linux-osdata.c \
236 $(srcdir)/../gdb/nat/linux-personality.c \
237 $(srcdir)/../gdb/nat/mips-linux-watch.c \
238 $(srcdir)/../gdb/nat/ppc-linux.c \
239 $(srcdir)/../gdb/nat/fork-inferior.c \
240 $(srcdir)/../gdb/target/waitstatus.c
c906108c 241
7ea81414 242DEPFILES = @GDBSERVER_DEPFILES@
c906108c 243
e28b3332
DJ
244LIBOBJS = @LIBOBJS@
245
7ea81414 246SOURCES = $(SFILES)
1b3f6016 247TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
c906108c 248
b593ecca 249OBS = \
08f10e02 250 alloc.o \
b593ecca 251 ax.o \
268a13a5
TT
252 gdbsupport/agent.o \
253 gdbsupport/btrace-common.o \
254 gdbsupport/buffer.o \
255 gdbsupport/cleanups.o \
256 gdbsupport/common-debug.o \
257 gdbsupport/common-exceptions.o \
80fd2826 258 gdbsupport/common-inferior.o \
268a13a5
TT
259 gdbsupport/job-control.o \
260 gdbsupport/common-regcache.o \
261 gdbsupport/common-utils.o \
262 gdbsupport/errors.o \
263 gdbsupport/environ.o \
264 gdbsupport/fileio.o \
265 gdbsupport/filestuff.o \
266 gdbsupport/format.o \
2d41fa11 267 gdbsupport/gdb-dlfcn.o \
268a13a5
TT
268 gdbsupport/gdb_tilde_expand.o \
269 gdbsupport/gdb_vecs.o \
559e7e50 270 gdbsupport/gdb_wait.o \
268a13a5
TT
271 gdbsupport/netstuff.o \
272 gdbsupport/new-op.o \
273 gdbsupport/pathstuff.o \
274 gdbsupport/print-utils.o \
275 gdbsupport/ptid.o \
276 gdbsupport/rsp-low.o \
cd850b40 277 gdbsupport/safe-strerror.o \
268a13a5
TT
278 gdbsupport/signals.o \
279 gdbsupport/signals-state-save-restore.o \
280 gdbsupport/tdesc.o \
268a13a5 281 gdbsupport/xml-utils.o \
b593ecca
SM
282 debug.o \
283 dll.o \
b593ecca 284 event-loop.o \
b593ecca
SM
285 hostio.o \
286 inferiors.o \
287 mem-break.o \
b593ecca 288 notif.o \
b593ecca
SM
289 regcache.o \
290 remote-utils.o \
b593ecca 291 server.o \
b593ecca
SM
292 symbol.o \
293 target.o \
294 tdesc.o \
295 tracepoint.o \
296 utils.o \
b593ecca 297 version.o \
42cd72aa 298 target/waitstatus.o \
b593ecca
SM
299 $(DEPFILES) \
300 $(LIBOBJS) \
301 $(XML_BUILTIN)
302
03349c93 303GDBREPLAY_OBS = \
268a13a5
TT
304 gdbsupport/cleanups.o \
305 gdbsupport/common-exceptions.o \
306 gdbsupport/common-utils.o \
307 gdbsupport/rsp-low.o \
308 gdbsupport/errors.o \
309 gdbsupport/netstuff.o \
310 gdbsupport/print-utils.o \
ab7d13f0 311 gdbsupport/safe-strerror.o \
03349c93
PA
312 gdbreplay.o \
313 utils.o \
314 version.o
315
5e030278 316GDBSERVER_LIBS = @GDBSERVER_LIBS@ $(PTHREAD_LIBS)
b80864fb 317XM_CLIBS = @LIBS@
f6528abd 318CDEPS = $(srcdir)/proc-service.list
c906108c 319
fb1e4ffc 320# XML files to compile in to gdbserver, if any.
919adfe8 321XML_DIR = $(srcdir)/../gdb/features
fb1e4ffc
DJ
322XML_FILES = @srv_xmlfiles@
323XML_BUILTIN = @srv_xmlbuiltin@
324
fa593d66
PA
325IPA_DEPFILES = @IPA_DEPFILES@
326extra_libraries = @extra_libraries@
327
f474844c
JZ
328FLAGS_TO_PASS = \
329 "prefix=$(prefix)" \
330 "exec_prefix=$(exec_prefix)" \
331 "infodir=$(infodir)" \
332 "datarootdir=$(datarootdir)" \
333 "docdir=$(docdir)" \
334 "htmldir=$(htmldir)" \
335 "pdfdir=$(pdfdir)" \
336 "libdir=$(libdir)" \
337 "mandir=$(mandir)" \
338 "datadir=$(datadir)" \
339 "includedir=$(includedir)" \
340 "against=$(against)" \
341 "DESTDIR=$(DESTDIR)" \
342 "AR=$(AR)" \
343 "AR_FLAGS=$(AR_FLAGS)" \
344 "CC=$(CC)" \
345 "CFLAGS=$(CFLAGS)" \
346 "CXX=$(CXX)" \
347 "CXXFLAGS=$(CXXFLAGS)" \
348 "DLLTOOL=$(DLLTOOL)" \
349 "LDFLAGS=$(LDFLAGS)" \
350 "RANLIB=$(RANLIB)" \
351 "MAKEINFO=$(MAKEINFO)" \
352 "MAKEHTML=$(MAKEHTML)" \
353 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
354 "INSTALL=$(INSTALL)" \
355 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
356 "INSTALL_DATA=$(INSTALL_DATA)" \
357 "RUNTEST=$(RUNTEST)" \
358 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
359
fd9bb8b8 360# All generated files which can be included by another file.
1a627e7e 361generated_files = config.h
fd9bb8b8 362
fa593d66 363all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
c906108c
SS
364
365# Traditionally "install" depends on "all". But it may be useful
1b3f6016 366# not to; for example, if the user has made some trivial change to a
c906108c
SS
367# source file and doesn't care about rebuilding or just wants to save the
368# time it takes for make to check that all is up to date.
369# install-only is intended to address that need.
f474844c
JZ
370install: all
371 @$(MAKE) $(FLAGS_TO_PASS) install-only
372
1b3f6016 373install-only:
c906108c
SS
374 n=`echo gdbserver | sed '$(program_transform_name)'`; \
375 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
12ac6819 376 if [ x"$(IPA_DEPFILES)" != x ]; then \
919adfe8 377 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libdir); \
48189bec 378 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
fa593d66 379 fi; \
919adfe8 380 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
48189bec 381 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
c906108c 382
bdaed379
HD
383install-strip:
384 $(MAKE) $(FLAGS_TO_PASS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
385 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
386 `test -z '$(STRIP)' || \
387 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
388
c906108c
SS
389uninstall: force
390 n=`echo gdbserver | sed '$(program_transform_name)'`; \
391 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
f1048712 392 rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
c906108c
SS
393
394installcheck:
395check:
9453113a 396info dvi pdf:
c906108c 397install-info:
9453113a 398install-pdf:
085dd6e6
JM
399html:
400install-html:
1a627e7e 401clean-info:
c906108c 402
8ff03f0b 403gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
39be3c7e
SM
404 $(SILENCE) rm -f gdbserver$(EXEEXT)
405 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
406 -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
407 $(GDBSERVER_LIBS) $(XM_CLIBS)
c9a1864a 408
8ff03f0b 409gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
39be3c7e
SM
410 $(SILENCE) rm -f gdbreplay$(EXEEXT)
411 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
412 -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
413 $(LIBIBERTY)
c906108c 414
a206891a 415IPA_OBJS = \
08f10e02 416 alloc-ipa.o \
a206891a 417 ax-ipa.o \
268a13a5
TT
418 gdbsupport/common-utils-ipa.o \
419 gdbsupport/errors-ipa.o \
420 gdbsupport/format-ipa.o \
421 gdbsupport/print-utils-ipa.o \
422 gdbsupport/rsp-low-ipa.o \
ab7d13f0 423 gdbsupport/safe-strerror-ipa.o \
268a13a5 424 gdbsupport/tdesc-ipa.o \
a206891a
SM
425 regcache-ipa.o \
426 remote-utils-ipa.o \
a206891a
SM
427 tdesc-ipa.o \
428 tracepoint-ipa.o \
429 utils-ipa.o \
ef87c8bb 430 ${IPA_DEPFILES}
fa593d66 431
8629c02c 432IPA_LIB = libinproctrace.so
fa593d66 433
8ff03f0b 434$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
39be3c7e
SM
435 $(SILENCE) rm -f $(IPA_LIB)
436 $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
437 -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
438 -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
fa593d66 439
c906108c
SS
440# Put the proper machine-specific files first, so M-. on a machine
441# specific routine gets the one for the correct machine.
442# The xyzzy stuff below deals with empty DEPFILES
443TAGS: ${TAGFILES}
42ba50ec 444 etags \
c906108c
SS
445 `for i in yzzy ${DEPFILES}; do \
446 if [ x$$i != xyzzy ]; then \
feacfcac 447 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
42cd72aa
MR
448 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
449 -e 's,/\(gdbsupport\)/,/../../\1/,'; \
c906108c
SS
450 fi; \
451 done` \
452 ${TAGFILES}
453tags: TAGS
454
455clean:
456 rm -f *.o ${ADD_FILES} *~
de7c3b4a 457 rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
fa593d66 458 rm -f $(IPA_LIB)
feacfcac 459 rm -f *-generated.cc
8fa5b777 460 rm -f stamp-xml
65dd1e59 461 rm -f $(DEPDIR)/*.Po
60d6cfc9
YQ
462 for i in $(CONFIG_SRC_SUBDIR); do \
463 rm -f $$i/*.o; \
464 rm -f $$i/$(DEPDIR)/*; \
465 done
c906108c 466
a59d1c82 467maintainer-clean realclean distclean: clean
c971b7fa
PA
468 rm -f Makefile config.status config.h stamp-h config.log
469 rm -f Makefile
60d6cfc9
YQ
470 for i in $(CONFIG_SRC_SUBDIR); do \
471 rmdir $$i/$(DEPDIR); \
472 done
c971b7fa 473
c3a3ccc7
DJ
474config.h: stamp-h ; @true
475stamp-h: config.in config.status
c5adaa19 476 $(SHELL) ./config.status config.h
0729219d 477
7ea81414 478Makefile: Makefile.in config.status
c5adaa19 479 $(SHELL) ./config.status $@
c906108c 480
919adfe8 481config.status: configure configure.srv $(srcdir)/../bfd/development.sh
d6e9fb05
JK
482 $(SHELL) ./config.status --recheck
483
c9a1864a
YQ
484# automatic rebuilding in automake-generated Makefiles requires
485# this rule in the toplevel Makefile, which, with GNU make, causes
486# the desired updates through the implicit regeneration of the Makefile
487# and all of its prerequisites.
488am--refresh:
489 @:
490
c906108c
SS
491force:
492
feacfcac 493version-generated.cc: Makefile $(srcdir)/../gdb/version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
919adfe8 494 $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/../gdb \
39be3c7e 495 $(host_alias) $(target_alias) $@
c906108c 496
feacfcac 497xml-builtin-generated.cc: stamp-xml; @true
fb1e4ffc 498stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
39be3c7e
SM
499 $(SILENCE) rm -f xml-builtin.tmp
500 $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
501 xml-builtin.tmp $(XML_FILES)
feacfcac 502 $(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin-generated.cc
39be3c7e 503 $(SILENCE) echo stamp > stamp-xml
fb1e4ffc 504
feacfcac 505.PRECIOUS: xml-builtin.cc
fb1e4ffc 506
c906108c
SS
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)
510# in GNU Make 4.0.
511.NOEXPORT:
512
513# GNU Make 3.63 has a different problem: it keeps tacking command line
514# overrides onto the definition of $(MAKE). This variable setting
515# will remove them.
8629c02c 516MAKEOVERRIDES =
c906108c 517
919adfe8 518regdat_sh = $(srcdir)/../gdb/regformats/regdat.sh
7a60ad40 519
0fb4aa4b
PA
520UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
521
956cc47c
SN
522# Undo gnulib replacements for the IPA shared library build.
523# The gnulib headers are still needed, but gnulib is not linked
524# into the IPA lib so replacement apis don't work.
ab7d13f0 525UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
956cc47c 526
fa593d66
PA
527# Note, we only build the IPA if -fvisibility=hidden is supported in
528# the first place.
bffc0964 529IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
956cc47c 530 $(UNDO_GNULIB_CFLAGS) \
3ba6ad0f 531 -fPIC -DIN_PROCESS_AGENT \
fa593d66
PA
532 -fvisibility=hidden
533
39be3c7e 534IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
61c125b9 535
1a01e7c6
SM
536# Rules for special cases.
537
feacfcac 538ax-ipa.o: ax.cc
61c125b9
TT
539 $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
540 $(POSTCOMPILE)
61c125b9 541
feacfcac 542ax.o: ax.cc
61c125b9
TT
543 $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
544 $(POSTCOMPILE)
545
a543c5ca
AH
546# Rules for objects that go in the in-process agent.
547
919adfe8 548arch/%-ipa.o: ../gdb/arch/%.c
feacfcac 549 $(IPAGENT_COMPILE) -x c++ $<
b4570e4b
YQ
550 $(POSTCOMPILE)
551
06b3c5bd 552gdbsupport/%-ipa.o: ../gdbsupport/%.cc
a543c5ca
AH
553 $(IPAGENT_COMPILE) $<
554 $(POSTCOMPILE)
a8ebe3d5 555
feacfcac 556%-ipa.o: %-generated.cc
8fa5b777
SM
557 $(IPAGENT_COMPILE) $<
558 $(POSTCOMPILE)
559
feacfcac 560%-ipa.o: %.cc
a8ebe3d5
SM
561 $(IPAGENT_COMPILE) $<
562 $(POSTCOMPILE)
563
919adfe8 564%-ipa.o: ../gdb/%.c
feacfcac 565 $(IPAGENT_COMPILE) -x c++ $<
1ee7b812
BE
566 $(POSTCOMPILE)
567
1a01e7c6 568# Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
feacfcac
SM
569# Therefore, this one needs to be before "%.o: %.cc" for it to be considered for
570# files such as linux-amd64-ipa.o generated from linux-amd64-ipa.cc.
1a01e7c6
SM
571#
572# Later versions of GNU Make choose the rule with the shortest stem, so it would
573# work in any order.
574
feacfcac 575%-ipa.o: %-ipa.cc
1a01e7c6
SM
576 $(IPAGENT_COMPILE) $<
577 $(POSTCOMPILE)
578
a543c5ca 579# Rules for objects that go in the gdbserver binary.
36bc18a8 580
919adfe8 581arch/%.o: ../gdb/arch/%.c
feacfcac 582 $(COMPILE) -x c++ $<
5f035c07
YQ
583 $(POSTCOMPILE)
584
06b3c5bd 585gdbsupport/%.o: ../gdbsupport/%.cc
8fa5b777
SM
586 $(COMPILE) $<
587 $(POSTCOMPILE)
588
feacfcac 589%.o: %-generated.cc
21122961
SM
590 $(COMPILE) $<
591 $(POSTCOMPILE)
592
feacfcac 593%.o: %.cc
6bda016b
SM
594 $(COMPILE) $<
595 $(POSTCOMPILE)
596
919adfe8 597nat/%.o: ../gdb/nat/%.c
feacfcac 598 $(COMPILE) -x c++ $<
c5a22423
SM
599 $(POSTCOMPILE)
600
919adfe8 601target/%.o: ../gdb/target/%.c
feacfcac 602 $(COMPILE) -x c++ $<
21122961 603 $(POSTCOMPILE)
08f10e02 604
919adfe8 605%.o: ../gdb/%.c
feacfcac 606 $(COMPILE) -x c++ $<
08f10e02 607 $(POSTCOMPILE)
21122961 608
8fa5b777
SM
609# Rules for register format descriptions. Suffix destination files with
610# -generated to identify and clean them easily.
c362e621 611
feacfcac 612%-generated.cc: ../gdb/regformats/%.dat $(regdat_sh)
39be3c7e 613 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
c362e621 614
feacfcac 615%-generated.cc: ../gdb/regformats/arm/%.dat $(regdat_sh)
39be3c7e 616 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
c362e621 617
feacfcac 618%-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
39be3c7e 619 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
61c125b9
TT
620
621#
3b165252 622# Dependency tracking.
61c125b9
TT
623#
624
3b165252 625ifeq ($(DEPMODE),depmode=gcc3)
61c125b9
TT
626# Note that we put the dependencies into a .Tpo file, then move them
627# into place if the compile succeeds. We need this because gcc does
628# not atomically write the dependency output file.
3b165252 629override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
60d6cfc9
YQ
630 -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
631override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
632 $(@D)/$(DEPDIR)/$(basename $(@F)).Po
3b165252
SM
633else
634override COMPILE.pre = source='$<' object='$@' libtool=no \
60d6cfc9 635 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
feacfcac 636 $(CXX) $(CXX_DIALECT)
61c125b9
TT
637# depcomp handles atomicity for us, so we don't need a postcompile
638# step.
3b165252
SM
639override POSTCOMPILE =
640endif
61c125b9
TT
641
642# A list of all the objects we might care about in this build, for
643# dependency tracking.
1798301e 644all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
61c125b9
TT
645
646# Ensure that generated files are created early. Use order-only
647# dependencies if available. They require GNU make 3.80 or newer,
648# and the .VARIABLES variable was introduced at the same time.
3b165252
SM
649ifdef .VARIABLES
650$(all_object_files): | $(generated_files)
651else
61c125b9 652$(all_object_files) : $(generated_files)
3b165252 653endif
61c125b9 654
f31c089e
SM
655# All the .deps files to include.
656all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
657 $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
658
61c125b9 659# Dependencies.
f31c089e 660-include $(all_deps_files)
61c125b9 661
ad02e4fe 662# Disable implicit make rules.
919adfe8 663include $(srcdir)/../gdb/disable-implicit-rules.mk
ad02e4fe 664
feacfcac 665# Do not delete intermediate files (e.g. *-generated.cc).
50a421ac
SM
666.SECONDARY:
667
c906108c 668# This is the end of "Makefile.in".
This page took 2.283236 seconds and 4 git commands to generate.