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