]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/gdbserver/Makefile.in
Ptrace support for Aarch64 SVE
[thirdparty/binutils-gdb.git] / gdb / gdbserver / Makefile.in
1 # Copyright (C) 1989-2018 Free Software Foundation, Inc.
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
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
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.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
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
21 prefix = @prefix@
22 exec_prefix = @exec_prefix@
23
24 host_alias = @host_noncanonical@
25 target_alias = @target_noncanonical@
26 program_transform_name = @program_transform_name@
27 bindir = @bindir@
28 libdir = @libdir@
29 tooldir = $(libdir)/$(target_alias)
30
31 datarootdir = @datarootdir@
32 datadir = @datadir@
33 mandir = @mandir@
34 man1dir = $(mandir)/man1
35 man2dir = $(mandir)/man2
36 man3dir = $(mandir)/man3
37 man4dir = $(mandir)/man4
38 man5dir = $(mandir)/man5
39 man6dir = $(mandir)/man6
40 man7dir = $(mandir)/man7
41 man8dir = $(mandir)/man8
42 man9dir = $(mandir)/man9
43 infodir = @infodir@
44 htmldir = $(prefix)/html
45 includedir = @includedir@
46 CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
47
48 SHELL = @SHELL@
49 EXEEXT = @EXEEXT@
50
51 INSTALL = @INSTALL@
52 INSTALL_PROGRAM = @INSTALL_PROGRAM@
53 INSTALL_DATA = @INSTALL_DATA@
54 RANLIB = @RANLIB@
55
56 CC = @CC@
57 CXX = @CXX@
58 CXX_DIALECT = @CXX_DIALECT@
59 AR = @AR@
60 AR_FLAGS = rc
61
62 # Dependency tracking information.
63 DEPMODE = @CCDEPMODE@
64 DEPDIR = @DEPDIR@
65 depcomp = $(SHELL) $(srcdir)/../../depcomp
66
67 # Directory containing source files. Don't clean up the spacing,
68 # this exact string is matched for by the "configure" script.
69 srcdir = @srcdir@
70 abs_top_srcdir = @abs_top_srcdir@
71 abs_srcdir = @abs_srcdir@
72 VPATH = @srcdir@
73
74 include $(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.
78 COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
79 COMPILE.post = -c -o $@
80 COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
81 POSTCOMPILE = @true
82
83 # It is also possible that you will need to add -I/usr/include/sys to the
84 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
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.
89 #CC_LD = g++ -static
90 CC_LD = $(CXX) $(CXX_DIALECT)
91
92 # Where is the "include" directory? Traditionally ../include or ./include
93 INCLUDE_DIR = ${srcdir}/../../include
94 INCLUDE_DEP = $$(INCLUDE_DIR)
95
96 LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
97 LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
98
99 # Where is ust? These will be empty if ust was not available.
100 ustlibs = @ustlibs@
101 ustinc = @ustinc@
102
103 # gnulib
104 GNULIB_BUILDDIR = build-gnulib-gdbserver
105 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
106 INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
107
108 # Generated headers in the gnulib directory. These must be listed
109 # so that they are generated before other files are compiled.
110 GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
111
112 # All the includes used for CFLAGS and for lint.
113 # -I. for config files.
114 # -I${srcdir} for our headers.
115 # -I$(srcdir)/../regformats for regdef.h.
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 #
121 INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../common \
122 -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
123 $(INCGNU)
124
125 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
126 # from the config/ directory.
127 GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
128 #PROFILE_CFLAGS = -pg
129
130 WARN_CFLAGS = @WARN_CFLAGS@
131 WERROR_CFLAGS = @WERROR_CFLAGS@
132
133 WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
134 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
135
136 # These are specifically reserved for setting from the command line
137 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
138 CFLAGS = @CFLAGS@
139 CXXFLAGS = @CXXFLAGS@
140 CPPFLAGS = @CPPFLAGS@
141
142 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
143 INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
144 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
145 INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
146 INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
147
148 # LDFLAGS is specifically reserved for setting from the command line
149 # when running make.
150 LDFLAGS = @LDFLAGS@
151 INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
152
153 # All source files that go into linking GDB remote server.
154
155 SFILES = \
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 \
163 $(srcdir)/linux-aarch64-low.c \
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 \
170 $(srcdir)/linux-m32r-low.c \
171 $(srcdir)/linux-m68k-low.c \
172 $(srcdir)/linux-mips-low.c \
173 $(srcdir)/linux-nios2-low.c \
174 $(srcdir)/linux-ppc-low.c \
175 $(srcdir)/linux-s390-low.c \
176 $(srcdir)/linux-sh-low.c \
177 $(srcdir)/linux-sparc-low.c \
178 $(srcdir)/linux-tile-low.c \
179 $(srcdir)/linux-x86-low.c \
180 $(srcdir)/linux-xtensa-low.c \
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 \
199 $(srcdir)/arch/ppc-linux-common.c \
200 $(srcdir)/common/btrace-common.c \
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 \
208 $(srcdir)/common/environ.c \
209 $(srcdir)/common/fileio.c \
210 $(srcdir)/common/filestuff.c \
211 $(srcdir)/common/job-control.c \
212 $(srcdir)/common/gdb_tilde_expand.c \
213 $(srcdir)/common/gdb_vecs.c \
214 $(srcdir)/common/new-op.c \
215 $(srcdir)/common/pathstuff.c \
216 $(srcdir)/common/print-utils.c \
217 $(srcdir)/common/ptid.c \
218 $(srcdir)/common/rsp-low.c \
219 $(srcdir)/common/tdesc.c \
220 $(srcdir)/common/vec.c \
221 $(srcdir)/common/xml-utils.c \
222 $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
223 $(srcdir)/nat/linux-btrace.c \
224 $(srcdir)/nat/linux-namespaces.c \
225 $(srcdir)/nat/linux-osdata.c \
226 $(srcdir)/nat/linux-personality.c \
227 $(srcdir)/nat/mips-linux-watch.c \
228 $(srcdir)/nat/ppc-linux.c \
229 $(srcdir)/nat/fork-inferior.c \
230 $(srcdir)/target/waitstatus.c
231
232 DEPFILES = @GDBSERVER_DEPFILES@
233
234 LIBOBJS = @LIBOBJS@
235
236 SOURCES = $(SFILES)
237 TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
238
239 OBS = \
240 ax.o \
241 common/agent.o \
242 common/btrace-common.o \
243 common/buffer.o \
244 common/cleanups.o \
245 common/common-debug.o \
246 common/common-exceptions.o \
247 common/job-control.o \
248 common/common-regcache.o \
249 common/common-utils.o \
250 common/errors.o \
251 common/environ.o \
252 common/fileio.o \
253 common/filestuff.o \
254 common/format.o \
255 common/gdb_tilde_expand.o \
256 common/gdb_vecs.o \
257 common/new-op.o \
258 common/pathstuff.o \
259 common/print-utils.o \
260 common/ptid.o \
261 common/rsp-low.o \
262 common/signals.o \
263 common/signals-state-save-restore.o \
264 common/tdesc.o \
265 common/vec.o \
266 common/xml-utils.o \
267 debug.o \
268 dll.o \
269 event-loop.o \
270 hostio.o \
271 inferiors.o \
272 mem-break.o \
273 notif.o \
274 regcache.o \
275 remote-utils.o \
276 server.o \
277 symbol.o \
278 target.o \
279 tdesc.o \
280 tracepoint.o \
281 utils.o \
282 version.o \
283 waitstatus.o \
284 $(DEPFILES) \
285 $(LIBOBJS) \
286 $(XML_BUILTIN)
287
288 GDBREPLAY_OBS = gdbreplay.o version.o
289 GDBSERVER_LIBS = @GDBSERVER_LIBS@
290 XM_CLIBS = @LIBS@
291 CDEPS = $(srcdir)/proc-service.list
292
293 # XML files to compile in to gdbserver, if any.
294 XML_DIR = $(srcdir)/../features
295 XML_FILES = @srv_xmlfiles@
296 XML_BUILTIN = @srv_xmlbuiltin@
297
298 IPA_DEPFILES = @IPA_DEPFILES@
299 extra_libraries = @extra_libraries@
300
301 SUBDIRS = $(GNULIB_BUILDDIR) $(LIBIBERTY_BUILDDIR)
302 CLEANDIRS = $(SUBDIRS)
303
304 # List of subdirectories in the build tree that must exist.
305 # This is used to force build failures in existing trees when
306 # a new directory is added.
307 # The format here is for the `case' shell command.
308 REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
309
310 FLAGS_TO_PASS = \
311 "prefix=$(prefix)" \
312 "exec_prefix=$(exec_prefix)" \
313 "infodir=$(infodir)" \
314 "datarootdir=$(datarootdir)" \
315 "docdir=$(docdir)" \
316 "htmldir=$(htmldir)" \
317 "pdfdir=$(pdfdir)" \
318 "libdir=$(libdir)" \
319 "mandir=$(mandir)" \
320 "datadir=$(datadir)" \
321 "includedir=$(includedir)" \
322 "against=$(against)" \
323 "DESTDIR=$(DESTDIR)" \
324 "AR=$(AR)" \
325 "AR_FLAGS=$(AR_FLAGS)" \
326 "CC=$(CC)" \
327 "CFLAGS=$(CFLAGS)" \
328 "CXX=$(CXX)" \
329 "CXXFLAGS=$(CXXFLAGS)" \
330 "DLLTOOL=$(DLLTOOL)" \
331 "LDFLAGS=$(LDFLAGS)" \
332 "RANLIB=$(RANLIB)" \
333 "MAKEINFO=$(MAKEINFO)" \
334 "MAKEHTML=$(MAKEHTML)" \
335 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
336 "INSTALL=$(INSTALL)" \
337 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
338 "INSTALL_DATA=$(INSTALL_DATA)" \
339 "RUNTEST=$(RUNTEST)" \
340 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
341
342 # All generated files which can be included by another file.
343 generated_files = config.h $(GNULIB_H)
344
345 all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
346 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
347
348 # Traditionally "install" depends on "all". But it may be useful
349 # not to; for example, if the user has made some trivial change to a
350 # source file and doesn't care about rebuilding or just wants to save the
351 # time it takes for make to check that all is up to date.
352 # install-only is intended to address that need.
353 install: all
354 @$(MAKE) $(FLAGS_TO_PASS) install-only
355
356 install-only:
357 n=`echo gdbserver | sed '$(program_transform_name)'`; \
358 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
359 if [ x"$(IPA_DEPFILES)" != x ]; then \
360 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \
361 $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
362 fi; \
363 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
364 $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
365 # Note that we run install and not install-only, as the latter
366 # is not part of GNU standards and in particular not provided
367 # in libiberty.
368 @$(MAKE) $(FLAGS_TO_PASS) DO=install "DODIRS=$(SUBDIRS)" subdir_do
369
370 uninstall: force
371 n=`echo gdbserver | sed '$(program_transform_name)'`; \
372 if [ x$$n = x ]; then n=gdbserver; else true; fi; \
373 rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
374 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
375
376 installcheck:
377 check:
378 info dvi pdf:
379 install-info:
380 install-pdf:
381 html:
382 install-html:
383 clean-info: force
384 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
385
386 gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY)
387 $(SILENCE) rm -f gdbserver$(EXEEXT)
388 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
389 -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
390 $(GDBSERVER_LIBS) $(XM_CLIBS)
391
392 $(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
393 all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
394 @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS="$(SUBDIRS)" subdir_do
395 .PHONY: all-lib
396
397 gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY)
398 $(SILENCE) rm -f gdbreplay$(EXEEXT)
399 $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
400 -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
401 $(LIBIBERTY)
402
403 IPA_OBJS = \
404 ax-ipa.o \
405 common/common-utils-ipa.o \
406 common/errors-ipa.o \
407 common/format-ipa.o \
408 common/print-utils-ipa.o \
409 common/rsp-low-ipa.o \
410 common/tdesc-ipa.o \
411 common/vec-ipa.o \
412 regcache-ipa.o \
413 remote-utils-ipa.o \
414 tdesc-ipa.o \
415 tracepoint-ipa.o \
416 utils-ipa.o \
417 ${IPA_DEPFILES}
418
419 IPA_LIB = libinproctrace.so
420
421 $(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS}
422 $(SILENCE) rm -f $(IPA_LIB)
423 $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
424 -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
425 -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
426
427 # Put the proper machine-specific files first, so M-. on a machine
428 # specific routine gets the one for the correct machine.
429 # The xyzzy stuff below deals with empty DEPFILES
430 TAGS: ${TAGFILES}
431 etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
432 `find ${srcdir}/../config -name ${XM_FILE} -print` \
433 `find ${srcdir}/../config -name ${NAT_FILE} -print` \
434 `for i in yzzy ${DEPFILES}; do \
435 if [ x$$i != xyzzy ]; then \
436 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
437 fi; \
438 done` \
439 ${TAGFILES}
440 tags: TAGS
441
442 clean:
443 rm -f *.o ${ADD_FILES} *~
444 rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
445 rm -f $(IPA_LIB)
446 rm -f *-generated.c
447 rm -f stamp-xml
448 rm -f $(DEPDIR)/*.Po
449 for i in $(CONFIG_SRC_SUBDIR); do \
450 rm -f $$i/*.o; \
451 rm -f $$i/$(DEPDIR)/*; \
452 done
453 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
454
455 maintainer-clean realclean distclean: clean
456 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
457 rm -rf $(GNULIB_BUILDDIR)
458 rm -f Makefile config.status config.h stamp-h config.log
459 rm -f Makefile
460 for i in $(CONFIG_SRC_SUBDIR); do \
461 rmdir $$i/$(DEPDIR); \
462 done
463
464 subdir_do: force
465 @for i in $(DODIRS); do \
466 case $$i in \
467 $(REQUIRED_SUBDIRS)) \
468 if [ ! -f ./$$i/Makefile ] ; then \
469 echo "Missing $$i/Makefile" >&2 ; \
470 exit 1 ; \
471 fi ;; \
472 esac ; \
473 if [ -f ./$$i/Makefile ] ; then \
474 if (cd ./$$i; \
475 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
476 else exit 1 ; fi ; \
477 else true ; fi ; \
478 done
479
480 config.h: stamp-h ; @true
481 stamp-h: config.in config.status
482 CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
483
484 Makefile: Makefile.in config.status
485 CONFIG_HEADERS="" $(SHELL) ./config.status
486
487 $(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../gnulib/Makefile.in config.status
488 @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
489 CONFIG_COMMANDS="depfiles" \
490 CONFIG_HEADERS= \
491 CONFIG_LINKS= \
492 $(SHELL) config.status
493
494 config.status: configure configure.srv $(srcdir)/../../bfd/development.sh
495 $(SHELL) ./config.status --recheck
496
497 # automatic rebuilding in automake-generated Makefiles requires
498 # this rule in the toplevel Makefile, which, with GNU make, causes
499 # the desired updates through the implicit regeneration of the Makefile
500 # and all of its prerequisites.
501 am--refresh:
502 @:
503
504 force:
505
506 version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
507 $(ECHO_GEN) $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
508 $(host_alias) $(target_alias) $@
509
510 xml-builtin-generated.c: stamp-xml; @true
511 stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
512 $(SILENCE) rm -f xml-builtin.tmp
513 $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
514 xml-builtin.tmp $(XML_FILES)
515 $(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c
516 $(SILENCE) echo stamp > stamp-xml
517
518 .PRECIOUS: xml-builtin.c
519
520 # GNU Make has an annoying habit of putting *all* the Makefile variables
521 # into the environment, unless you include this target as a circumvention.
522 # Rumor is that this will be fixed (and this target can be removed)
523 # in GNU Make 4.0.
524 .NOEXPORT:
525
526 # GNU Make 3.63 has a different problem: it keeps tacking command line
527 # overrides onto the definition of $(MAKE). This variable setting
528 # will remove them.
529 MAKEOVERRIDES =
530
531 regdat_sh = $(srcdir)/../regformats/regdat.sh
532
533 UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
534
535 # Note, we only build the IPA if -fvisibility=hidden is supported in
536 # the first place.
537 IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
538 -fPIC -DIN_PROCESS_AGENT \
539 -fvisibility=hidden
540
541 IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
542
543 # Rules for special cases.
544
545 ax-ipa.o: ax.c
546 $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
547 $(POSTCOMPILE)
548
549 ax.o: ax.c
550 $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
551 $(POSTCOMPILE)
552
553 # Rules for objects that go in the in-process agent.
554
555 arch/%-ipa.o: ../arch/%.c
556 $(IPAGENT_COMPILE) $<
557 $(POSTCOMPILE)
558
559 common/%-ipa.o: ../common/%.c
560 $(IPAGENT_COMPILE) $<
561 $(POSTCOMPILE)
562
563 %-ipa.o: %-generated.c
564 $(IPAGENT_COMPILE) $<
565 $(POSTCOMPILE)
566
567 %-ipa.o: %.c
568 $(IPAGENT_COMPILE) $<
569 $(POSTCOMPILE)
570
571 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
572 # Therefore, this one needs to be before "%.o: %.c" for it to be considered for
573 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
574 #
575 # Later versions of GNU Make choose the rule with the shortest stem, so it would
576 # work in any order.
577
578 %-ipa.o: %-ipa.c
579 $(IPAGENT_COMPILE) $<
580 $(POSTCOMPILE)
581
582 # Rules for objects that go in the gdbserver binary.
583
584 arch/%.o: ../arch/%.c
585 $(COMPILE) $<
586 $(POSTCOMPILE)
587
588 common/%.o: ../common/%.c
589 $(COMPILE) $<
590 $(POSTCOMPILE)
591
592 %.o: %-generated.c
593 $(COMPILE) $<
594 $(POSTCOMPILE)
595
596 %.o: %.c
597 $(COMPILE) $<
598 $(POSTCOMPILE)
599
600 %.o: ../nat/%.c
601 $(COMPILE) $<
602 $(POSTCOMPILE)
603
604 %.o: ../target/%.c
605 $(COMPILE) $<
606 $(POSTCOMPILE)
607
608 # Rules for register format descriptions. Suffix destination files with
609 # -generated to identify and clean them easily.
610
611 %-generated.c: ../regformats/%.dat | $(regdat_sh)
612 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
613
614 %-generated.c: ../regformats/arm/%.dat | $(regdat_sh)
615 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
616
617 %-generated.c: ../regformats/i386/%.dat | $(regdat_sh)
618 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
619
620 %-generated.c: ../regformats/rs6000/%.dat | $(regdat_sh)
621 $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
622
623 #
624 # Dependency tracking.
625 #
626
627 ifeq ($(DEPMODE),depmode=gcc3)
628 # Note that we put the dependencies into a .Tpo file, then move them
629 # into place if the compile succeeds. We need this because gcc does
630 # not atomically write the dependency output file.
631 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
632 -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
633 override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
634 $(@D)/$(DEPDIR)/$(basename $(@F)).Po
635 else
636 override COMPILE.pre = source='$<' object='$@' libtool=no \
637 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
638 $(CXX) -x c++ $(CXX_DIALECT)
639 # depcomp handles atomicity for us, so we don't need a postcompile
640 # step.
641 override POSTCOMPILE =
642 endif
643
644 # A list of all the objects we might care about in this build, for
645 # dependency tracking.
646 all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
647
648 # Ensure that generated files are created early. Use order-only
649 # dependencies if available. They require GNU make 3.80 or newer,
650 # and the .VARIABLES variable was introduced at the same time.
651 ifdef .VARIABLES
652 $(all_object_files): | $(generated_files)
653 else
654 $(all_object_files) : $(generated_files)
655 endif
656
657 # All the .deps files to include.
658 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
659 $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
660
661 # Dependencies.
662 -include $(all_deps_files)
663
664 # Disable implicit make rules.
665 include $(srcdir)/../disable-implicit-rules.mk
666
667 # Do not delete intermediate files (e.g. *-generated.c).
668 .SECONDARY:
669
670 # This is the end of "Makefile.in".