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