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