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