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