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