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