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