Move gdbsupport to the top level
[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
01027315
TT
112INCSUPPORT = -I$(srcdir)/../.. -I../..
113
c906108c
SS
114# All the includes used for CFLAGS and for lint.
115# -I. for config files.
7ea81414
DJ
116# -I${srcdir} for our headers.
117# -I$(srcdir)/../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} \
66af0f44 124 -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
01027315 125 $(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
SM
160SFILES = \
161 $(srcdir)/debug.c \
162 $(srcdir)/dll.c \
163 $(srcdir)/gdbreplay.c \
164 $(srcdir)/hostio.c \
165 $(srcdir)/hostio-errno.c \
166 $(srcdir)/i387-fp.c \
167 $(srcdir)/inferiors.c \
98fc70d6 168 $(srcdir)/linux-aarch64-low.c \
b593ecca
SM
169 $(srcdir)/linux-arm-low.c \
170 $(srcdir)/linux-bfin-low.c \
171 $(srcdir)/linux-cris-low.c \
172 $(srcdir)/linux-crisv32-low.c \
173 $(srcdir)/linux-ia64-low.c \
174 $(srcdir)/linux-low.c \
7cfbc4a0 175 $(srcdir)/linux-m32r-low.c \
b593ecca
SM
176 $(srcdir)/linux-m68k-low.c \
177 $(srcdir)/linux-mips-low.c \
68f5f838 178 $(srcdir)/linux-nios2-low.c \
b593ecca 179 $(srcdir)/linux-ppc-low.c \
eee84df1 180 $(srcdir)/linux-s390-low.c \
b593ecca
SM
181 $(srcdir)/linux-sh-low.c \
182 $(srcdir)/linux-sparc-low.c \
183 $(srcdir)/linux-tile-low.c \
d0722149 184 $(srcdir)/linux-x86-low.c \
1525d545 185 $(srcdir)/linux-xtensa-low.c \
b593ecca
SM
186 $(srcdir)/mem-break.c \
187 $(srcdir)/proc-service.c \
188 $(srcdir)/proc-service.list \
189 $(srcdir)/regcache.c \
190 $(srcdir)/remote-utils.c \
191 $(srcdir)/server.c \
192 $(srcdir)/symbol.c \
193 $(srcdir)/target.c \
194 $(srcdir)/thread-db.c \
195 $(srcdir)/utils.c \
196 $(srcdir)/win32-arm-low.c \
197 $(srcdir)/win32-i386-low.c \
198 $(srcdir)/win32-low.c \
199 $(srcdir)/wincecompat.c \
200 $(srcdir)/x86-low.c \
201 $(srcdir)/arch/arm.c \
202 $(srcdir)/arch/arm-get-next-pcs.c \
203 $(srcdir)/arch/arm-linux.c \
bd64614e 204 $(srcdir)/arch/ppc-linux-common.c \
08f10e02 205 $(srcdir)/../alloc.c \
01027315
TT
206 $(srcdir)/../../gdbsupport/btrace-common.c \
207 $(srcdir)/../../gdbsupport/buffer.c \
208 $(srcdir)/../../gdbsupport/cleanups.c \
209 $(srcdir)/../../gdbsupport/common-debug.c \
210 $(srcdir)/../../gdbsupport/common-exceptions.c \
211 $(srcdir)/../../gdbsupport/common-inferior.c \
212 $(srcdir)/../../gdbsupport/common-regcache.c \
213 $(srcdir)/../../gdbsupport/common-utils.c \
214 $(srcdir)/../../gdbsupport/errors.c \
215 $(srcdir)/../../gdbsupport/environ.c \
216 $(srcdir)/../../gdbsupport/fileio.c \
217 $(srcdir)/../../gdbsupport/filestuff.c \
218 $(srcdir)/../../gdbsupport/job-control.c \
219 $(srcdir)/../../gdbsupport/gdb-dlfcn.c \
220 $(srcdir)/../../gdbsupport/gdb_tilde_expand.c \
221 $(srcdir)/../../gdbsupport/gdb_vecs.c \
222 $(srcdir)/../../gdbsupport/gdb_wait.c \
223 $(srcdir)/../../gdbsupport/netstuff.c \
224 $(srcdir)/../../gdbsupport/new-op.c \
225 $(srcdir)/../../gdbsupport/pathstuff.c \
226 $(srcdir)/../../gdbsupport/print-utils.c \
227 $(srcdir)/../../gdbsupport/ptid.c \
228 $(srcdir)/../../gdbsupport/rsp-low.c \
229 $(srcdir)/../../gdbsupport/safe-strerror.c \
230 $(srcdir)/../../gdbsupport/tdesc.c \
231 $(srcdir)/../../gdbsupport/xml-utils.c \
e9902bfc 232 $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
b593ecca
SM
233 $(srcdir)/nat/linux-btrace.c \
234 $(srcdir)/nat/linux-namespaces.c \
235 $(srcdir)/nat/linux-osdata.c \
236 $(srcdir)/nat/linux-personality.c \
237 $(srcdir)/nat/mips-linux-watch.c \
238 $(srcdir)/nat/ppc-linux.c \
2090129c 239 $(srcdir)/nat/fork-inferior.c \
b593ecca 240 $(srcdir)/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
SM
297 version.o \
298 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
DJ
320# XML files to compile in to gdbserver, if any.
321XML_DIR = $(srcdir)/../features
fb1e4ffc
DJ
322XML_FILES = @srv_xmlfiles@
323XML_BUILTIN = @srv_xmlbuiltin@
324
fa593d66
PA
325IPA_DEPFILES = @IPA_DEPFILES@
326extra_libraries = @extra_libraries@
327
0b04e523 328SUBDIRS = $(GNULIB_BUILDDIR) $(LIBIBERTY_BUILDDIR)
c971b7fa
PA
329CLEANDIRS = $(SUBDIRS)
330
331# List of subdirectories in the build tree that must exist.
332# This is used to force build failures in existing trees when
333# a new directory is added.
334# The format here is for the `case' shell command.
0b04e523 335REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
c971b7fa 336
f474844c
JZ
337FLAGS_TO_PASS = \
338 "prefix=$(prefix)" \
339 "exec_prefix=$(exec_prefix)" \
340 "infodir=$(infodir)" \
341 "datarootdir=$(datarootdir)" \
342 "docdir=$(docdir)" \
343 "htmldir=$(htmldir)" \
344 "pdfdir=$(pdfdir)" \
345 "libdir=$(libdir)" \
346 "mandir=$(mandir)" \
347 "datadir=$(datadir)" \
348 "includedir=$(includedir)" \
349 "against=$(against)" \
350 "DESTDIR=$(DESTDIR)" \
351 "AR=$(AR)" \
352 "AR_FLAGS=$(AR_FLAGS)" \
353 "CC=$(CC)" \
354 "CFLAGS=$(CFLAGS)" \
355 "CXX=$(CXX)" \
356 "CXXFLAGS=$(CXXFLAGS)" \
357 "DLLTOOL=$(DLLTOOL)" \
358 "LDFLAGS=$(LDFLAGS)" \
359 "RANLIB=$(RANLIB)" \
360 "MAKEINFO=$(MAKEINFO)" \
361 "MAKEHTML=$(MAKEHTML)" \
362 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
363 "INSTALL=$(INSTALL)" \
364 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
365 "INSTALL_DATA=$(INSTALL_DATA)" \
366 "RUNTEST=$(RUNTEST)" \
367 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
368
fd9bb8b8
PA
369# All generated files which can be included by another file.
370generated_files = config.h $(GNULIB_H)
371
fa593d66 372all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
c971b7fa 373 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
c906108c
SS
374
375# Traditionally "install" depends on "all". But it may be useful
1b3f6016 376# not to; for example, if the user has made some trivial change to a
c906108c
SS
377# source file and doesn't care about rebuilding or just wants to save the
378# time it takes for make to check that all is up to date.
379# install-only is intended to address that need.
f474844c
JZ
380install: all
381 @$(MAKE) $(FLAGS_TO_PASS) install-only
382
1b3f6016 383install-only:
c906108c
SS
384 n=`echo gdbserver | sed '$(program_transform_name)'`; \
385 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
12ac6819 386 if [ x"$(IPA_DEPFILES)" != x ]; then \
fa593d66 387 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \
48189bec 388 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
fa593d66 389 fi; \
c938e9b0 390 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
48189bec 391 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
0b04e523
TT
392 # Note that we run install and not install-only, as the latter
393 # is not part of GNU standards and in particular not provided
394 # in libiberty.
395 @$(MAKE) $(FLAGS_TO_PASS) DO=install "DODIRS=$(SUBDIRS)" subdir_do
c906108c
SS
396
397uninstall: force
398 n=`echo gdbserver | sed '$(program_transform_name)'`; \
399 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
f1048712 400 rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
c971b7fa 401 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
c906108c
SS
402
403installcheck:
404check:
9453113a 405info dvi pdf:
c906108c 406install-info:
9453113a 407install-pdf:
085dd6e6
JM
408html:
409install-html:
c9a1864a 410clean-info: force
c971b7fa 411 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
c906108c 412
8ff03f0b 413gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
39be3c7e
SM
414 $(SILENCE) rm -f gdbserver$(EXEEXT)
415 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
416 -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
417 $(GDBSERVER_LIBS) $(XM_CLIBS)
c9a1864a 418
0b04e523
TT
419$(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
420all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
421 @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS="$(SUBDIRS)" subdir_do
c9a1864a 422.PHONY: all-lib
c906108c 423
8ff03f0b 424gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
39be3c7e
SM
425 $(SILENCE) rm -f gdbreplay$(EXEEXT)
426 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
427 -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
428 $(LIBIBERTY)
c906108c 429
a206891a 430IPA_OBJS = \
08f10e02 431 alloc-ipa.o \
a206891a 432 ax-ipa.o \
268a13a5
TT
433 gdbsupport/common-utils-ipa.o \
434 gdbsupport/errors-ipa.o \
435 gdbsupport/format-ipa.o \
436 gdbsupport/print-utils-ipa.o \
437 gdbsupport/rsp-low-ipa.o \
ab7d13f0 438 gdbsupport/safe-strerror-ipa.o \
268a13a5 439 gdbsupport/tdesc-ipa.o \
a206891a
SM
440 regcache-ipa.o \
441 remote-utils-ipa.o \
a206891a
SM
442 tdesc-ipa.o \
443 tracepoint-ipa.o \
444 utils-ipa.o \
ef87c8bb 445 ${IPA_DEPFILES}
fa593d66 446
8629c02c 447IPA_LIB = libinproctrace.so
fa593d66 448
8ff03f0b 449$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
39be3c7e
SM
450 $(SILENCE) rm -f $(IPA_LIB)
451 $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
452 -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
453 -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
fa593d66 454
c906108c
SS
455# Put the proper machine-specific files first, so M-. on a machine
456# specific routine gets the one for the correct machine.
457# The xyzzy stuff below deals with empty DEPFILES
458TAGS: ${TAGFILES}
2c0fc042 459 etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
c906108c
SS
460 `find ${srcdir}/../config -name ${XM_FILE} -print` \
461 `find ${srcdir}/../config -name ${NAT_FILE} -print` \
462 `for i in yzzy ${DEPFILES}; do \
463 if [ x$$i != xyzzy ]; then \
464 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
465 fi; \
466 done` \
467 ${TAGFILES}
468tags: TAGS
469
470clean:
471 rm -f *.o ${ADD_FILES} *~
de7c3b4a 472 rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
fa593d66 473 rm -f $(IPA_LIB)
8fa5b777
SM
474 rm -f *-generated.c
475 rm -f stamp-xml
65dd1e59 476 rm -f $(DEPDIR)/*.Po
60d6cfc9
YQ
477 for i in $(CONFIG_SRC_SUBDIR); do \
478 rm -f $$i/*.o; \
479 rm -f $$i/$(DEPDIR)/*; \
480 done
c971b7fa 481 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
c906108c 482
a59d1c82 483maintainer-clean realclean distclean: clean
c971b7fa
PA
484 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
485 rm -rf $(GNULIB_BUILDDIR)
486 rm -f Makefile config.status config.h stamp-h config.log
487 rm -f Makefile
60d6cfc9
YQ
488 for i in $(CONFIG_SRC_SUBDIR); do \
489 rmdir $$i/$(DEPDIR); \
490 done
c971b7fa
PA
491
492subdir_do: force
493 @for i in $(DODIRS); do \
494 case $$i in \
495 $(REQUIRED_SUBDIRS)) \
496 if [ ! -f ./$$i/Makefile ] ; then \
497 echo "Missing $$i/Makefile" >&2 ; \
498 exit 1 ; \
499 fi ;; \
500 esac ; \
501 if [ -f ./$$i/Makefile ] ; then \
502 if (cd ./$$i; \
503 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
504 else exit 1 ; fi ; \
505 else true ; fi ; \
506 done
c906108c 507
c3a3ccc7
DJ
508config.h: stamp-h ; @true
509stamp-h: config.in config.status
c5adaa19 510 $(SHELL) ./config.status config.h
0729219d 511
7ea81414 512Makefile: Makefile.in config.status
c5adaa19 513 $(SHELL) ./config.status $@
c906108c 514
73cc7272 515$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../../gnulib/Makefile.in config.status
c971b7fa 516 @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
c9a1864a
YQ
517 CONFIG_COMMANDS="depfiles" \
518 CONFIG_HEADERS= \
519 CONFIG_LINKS= \
c971b7fa 520 $(SHELL) config.status
c9a1864a 521
270c9937 522config.status: configure configure.srv $(srcdir)/../../bfd/development.sh
d6e9fb05
JK
523 $(SHELL) ./config.status --recheck
524
c9a1864a
YQ
525# automatic rebuilding in automake-generated Makefiles requires
526# this rule in the toplevel Makefile, which, with GNU make, causes
527# the desired updates through the implicit regeneration of the Makefile
528# and all of its prerequisites.
529am--refresh:
530 @:
531
c906108c
SS
532force:
533
01027315
TT
534version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../../gdbsupport/create-version.sh
535 $(ECHO_GEN) $(SHELL) $(srcdir)/../../gdbsupport/create-version.sh $(srcdir)/.. \
39be3c7e 536 $(host_alias) $(target_alias) $@
c906108c 537
8fa5b777 538xml-builtin-generated.c: stamp-xml; @true
fb1e4ffc 539stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
39be3c7e
SM
540 $(SILENCE) rm -f xml-builtin.tmp
541 $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
542 xml-builtin.tmp $(XML_FILES)
543 $(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c
544 $(SILENCE) echo stamp > stamp-xml
fb1e4ffc 545
9b4b61c8 546.PRECIOUS: xml-builtin.c
fb1e4ffc 547
c906108c
SS
548# GNU Make has an annoying habit of putting *all* the Makefile variables
549# into the environment, unless you include this target as a circumvention.
550# Rumor is that this will be fixed (and this target can be removed)
551# in GNU Make 4.0.
552.NOEXPORT:
553
554# GNU Make 3.63 has a different problem: it keeps tacking command line
555# overrides onto the definition of $(MAKE). This variable setting
556# will remove them.
8629c02c 557MAKEOVERRIDES =
c906108c 558
0c74b2a7 559regdat_sh = $(srcdir)/../regformats/regdat.sh
7a60ad40 560
0fb4aa4b
PA
561UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
562
956cc47c
SN
563# Undo gnulib replacements for the IPA shared library build.
564# The gnulib headers are still needed, but gnulib is not linked
565# into the IPA lib so replacement apis don't work.
ab7d13f0 566UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
956cc47c 567
fa593d66
PA
568# Note, we only build the IPA if -fvisibility=hidden is supported in
569# the first place.
bffc0964 570IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
956cc47c 571 $(UNDO_GNULIB_CFLAGS) \
3ba6ad0f 572 -fPIC -DIN_PROCESS_AGENT \
fa593d66
PA
573 -fvisibility=hidden
574
39be3c7e 575IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
61c125b9 576
1a01e7c6
SM
577# Rules for special cases.
578
61c125b9
TT
579ax-ipa.o: ax.c
580 $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
581 $(POSTCOMPILE)
61c125b9
TT
582
583ax.o: ax.c
584 $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
585 $(POSTCOMPILE)
586
a543c5ca
AH
587# Rules for objects that go in the in-process agent.
588
589arch/%-ipa.o: ../arch/%.c
590 $(IPAGENT_COMPILE) $<
b4570e4b
YQ
591 $(POSTCOMPILE)
592
01027315 593gdbsupport/%-ipa.o: ../../gdbsupport/%.c
a543c5ca
AH
594 $(IPAGENT_COMPILE) $<
595 $(POSTCOMPILE)
a8ebe3d5 596
8fa5b777
SM
597%-ipa.o: %-generated.c
598 $(IPAGENT_COMPILE) $<
599 $(POSTCOMPILE)
600
a8ebe3d5
SM
601%-ipa.o: %.c
602 $(IPAGENT_COMPILE) $<
603 $(POSTCOMPILE)
604
1ee7b812
BE
605%-ipa.o: ../%.c
606 $(IPAGENT_COMPILE) $<
607 $(POSTCOMPILE)
608
1a01e7c6
SM
609# Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
610# Therefore, this one needs to be before "%.o: %.c" for it to be considered for
611# files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
612#
613# Later versions of GNU Make choose the rule with the shortest stem, so it would
614# work in any order.
615
616%-ipa.o: %-ipa.c
617 $(IPAGENT_COMPILE) $<
618 $(POSTCOMPILE)
619
a543c5ca 620# Rules for objects that go in the gdbserver binary.
36bc18a8 621
a543c5ca
AH
622arch/%.o: ../arch/%.c
623 $(COMPILE) $<
5f035c07
YQ
624 $(POSTCOMPILE)
625
01027315 626gdbsupport/%.o: ../../gdbsupport/%.c
8fa5b777
SM
627 $(COMPILE) $<
628 $(POSTCOMPILE)
629
a543c5ca 630%.o: %-generated.c
21122961
SM
631 $(COMPILE) $<
632 $(POSTCOMPILE)
633
a543c5ca 634%.o: %.c
6bda016b
SM
635 $(COMPILE) $<
636 $(POSTCOMPILE)
637
c5a22423
SM
638%.o: ../nat/%.c
639 $(COMPILE) $<
640 $(POSTCOMPILE)
641
21122961
SM
642%.o: ../target/%.c
643 $(COMPILE) $<
644 $(POSTCOMPILE)
08f10e02
TT
645
646%.o: ../%.c
647 $(COMPILE) $<
648 $(POSTCOMPILE)
21122961 649
8fa5b777
SM
650# Rules for register format descriptions. Suffix destination files with
651# -generated to identify and clean them easily.
c362e621 652
4025fa09 653%-generated.c: ../regformats/%.dat $(regdat_sh)
39be3c7e 654 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
c362e621 655
4025fa09 656%-generated.c: ../regformats/arm/%.dat $(regdat_sh)
39be3c7e 657 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
c362e621 658
4025fa09 659%-generated.c: ../regformats/rs6000/%.dat $(regdat_sh)
39be3c7e 660 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
61c125b9
TT
661
662#
3b165252 663# Dependency tracking.
61c125b9
TT
664#
665
3b165252 666ifeq ($(DEPMODE),depmode=gcc3)
61c125b9
TT
667# Note that we put the dependencies into a .Tpo file, then move them
668# into place if the compile succeeds. We need this because gcc does
669# not atomically write the dependency output file.
3b165252 670override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
60d6cfc9
YQ
671 -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
672override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
673 $(@D)/$(DEPDIR)/$(basename $(@F)).Po
3b165252
SM
674else
675override COMPILE.pre = source='$<' object='$@' libtool=no \
60d6cfc9
YQ
676 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
677 $(CXX) -x c++ $(CXX_DIALECT)
61c125b9
TT
678# depcomp handles atomicity for us, so we don't need a postcompile
679# step.
3b165252
SM
680override POSTCOMPILE =
681endif
61c125b9
TT
682
683# A list of all the objects we might care about in this build, for
684# dependency tracking.
1798301e 685all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
61c125b9
TT
686
687# Ensure that generated files are created early. Use order-only
688# dependencies if available. They require GNU make 3.80 or newer,
689# and the .VARIABLES variable was introduced at the same time.
3b165252
SM
690ifdef .VARIABLES
691$(all_object_files): | $(generated_files)
692else
61c125b9 693$(all_object_files) : $(generated_files)
3b165252 694endif
61c125b9 695
f31c089e
SM
696# All the .deps files to include.
697all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
698 $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
699
61c125b9 700# Dependencies.
f31c089e 701-include $(all_deps_files)
61c125b9 702
ad02e4fe
SM
703# Disable implicit make rules.
704include $(srcdir)/../disable-implicit-rules.mk
705
50a421ac
SM
706# Do not delete intermediate files (e.g. *-generated.c).
707.SECONDARY:
708
c906108c 709# This is the end of "Makefile.in".
This page took 1.791012 seconds and 4 git commands to generate.