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