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