[gdb/symtab] Workaround PR gas/31115
[binutils-gdb.git] / gdb / data-directory / Makefile.in
blob2a40be4ade0acbdcb448bacafc74563a09425d8a
1 # Copyright (C) 2010-2024 Free Software Foundation, Inc.
3 # Makefile for building a staged copy of the data-directory.
4 # This file is part of GDB.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Please keep lists in this file sorted alphabetically, with one item per line.
20 # See gdb/Makefile.in for guidelines on ordering files and directories.
22 srcdir = @srcdir@
23 SYSCALLS_SRCDIR = $(srcdir)/../syscalls
24 PYTHON_SRCDIR = $(srcdir)/../python/lib
25 GUILE_SRCDIR = $(srcdir)/../guile/lib
26 SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit
27 VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(GUILE_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR)
28 XSLTPROC = @XSLTPROC@
30 top_srcdir = @top_srcdir@
31 top_builddir = @top_builddir@
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
36 datarootdir = @datarootdir@
37 datadir = @datadir@
39 SHELL = @SHELL@
41 LN_S = @LN_S@
43 INSTALL = @INSTALL@
44 INSTALL_DATA = @INSTALL_DATA@
45 INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs
47 GDB_DATADIR = @GDB_DATADIR@
49 SYSCALLS_DIR = syscalls
50 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
51 GEN_SYSCALLS_FILES = \
52 aarch64-linux.xml \
53 amd64-linux.xml \
54 arm-linux.xml \
55 i386-linux.xml \
56 mips-n32-linux.xml \
57 mips-n64-linux.xml \
58 mips-o32-linux.xml \
59 ppc-linux.xml \
60 ppc64-linux.xml \
61 s390-linux.xml \
62 s390x-linux.xml \
63 sparc-linux.xml \
64 sparc64-linux.xml
66 SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml netbsd.xml $(GEN_SYSCALLS_FILES)
68 PYTHON_DIR = python
69 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
70 PYTHON_FILE_LIST = \
71 gdb/__init__.py \
72 gdb/disassembler.py \
73 gdb/FrameDecorator.py \
74 gdb/FrameIterator.py \
75 gdb/frames.py \
76 gdb/missing_debug.py \
77 gdb/printing.py \
78 gdb/prompt.py \
79 gdb/styling.py \
80 gdb/types.py \
81 gdb/unwinder.py \
82 gdb/xmethod.py \
83 gdb/command/__init__.py \
84 gdb/command/explore.py \
85 gdb/command/frame_filters.py \
86 gdb/command/missing_debug.py \
87 gdb/command/pretty_printers.py \
88 gdb/command/prompt.py \
89 gdb/command/type_printers.py \
90 gdb/command/unwinders.py \
91 gdb/command/xmethods.py \
92 gdb/dap/breakpoint.py \
93 gdb/dap/bt.py \
94 gdb/dap/disassemble.py \
95 gdb/dap/evaluate.py \
96 gdb/dap/events.py \
97 gdb/dap/frames.py \
98 gdb/dap/__init__.py \
99 gdb/dap/io.py \
100 gdb/dap/launch.py \
101 gdb/dap/locations.py \
102 gdb/dap/memory.py \
103 gdb/dap/modules.py \
104 gdb/dap/next.py \
105 gdb/dap/pause.py \
106 gdb/dap/scopes.py \
107 gdb/dap/server.py \
108 gdb/dap/sources.py \
109 gdb/dap/startup.py \
110 gdb/dap/state.py \
111 gdb/dap/threads.py \
112 gdb/dap/typecheck.py \
113 gdb/dap/varref.py \
114 gdb/function/__init__.py \
115 gdb/function/as_string.py \
116 gdb/function/caller_is.py \
117 gdb/function/strfns.py \
118 gdb/printer/__init__.py \
119 gdb/printer/bound_registers.py
121 @HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST)
122 @HAVE_PYTHON_FALSE@PYTHON_FILES =
124 GUILE_DIR = guile
125 GUILE_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(GUILE_DIR)
127 GUILE_SOURCE_FILES = \
128 ./gdb.scm \
129 gdb/boot.scm \
130 gdb/experimental.scm \
131 gdb/init.scm \
132 gdb/iterator.scm \
133 gdb/printing.scm \
134 gdb/support.scm \
135 gdb/types.scm
137 GUILE_COMPILED_FILES = \
138 ./gdb.go \
139 gdb/experimental.go \
140 gdb/iterator.go \
141 gdb/printing.go \
142 gdb/support.go \
143 gdb/types.go
145 @HAVE_GUILE_TRUE@GUILE_FILES = $(GUILE_SOURCE_FILES) $(GUILE_COMPILED_FILES)
146 @HAVE_GUILE_FALSE@GUILE_FILES =
148 GUILD = @GUILD@
149 GUILD_TARGET_FLAG = @GUILD_TARGET_FLAG@
151 # Flags passed to 'guild compile'.
152 # Note: We can't use -Wunbound-variable because all the variables
153 # defined in C aren't visible when we compile.
154 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
155 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
156 # We still need to pass "-L ." so that other modules are found.
157 GUILD_COMPILE_FLAGS = \
158 $(GUILD_TARGET_FLAG) \
159 -Warity-mismatch -Wformat -Wunused-toplevel \
160 -L .
162 SYSTEM_GDBINIT_DIR = system-gdbinit
163 SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR)
164 SYSTEM_GDBINIT_FILES = \
165 elinos.py \
166 wrs-linux.py
168 FLAGS_TO_PASS = \
169 "prefix=$(prefix)" \
170 "exec_prefix=$(exec_prefix)" \
171 "infodir=$(infodir)" \
172 "datarootdir=$(datarootdir)" \
173 "docdir=$(docdir)" \
174 "htmldir=$(htmldir)" \
175 "pdfdir=$(pdfdir)" \
176 "libdir=$(libdir)" \
177 "mandir=$(mandir)" \
178 "datadir=$(datadir)" \
179 "includedir=$(includedir)" \
180 "against=$(against)" \
181 "DESTDIR=$(DESTDIR)" \
182 "AR=$(AR)" \
183 "AR_FLAGS=$(AR_FLAGS)" \
184 "CC=$(CC)" \
185 "CFLAGS=$(CFLAGS)" \
186 "CXX=$(CXX)" \
187 "CXXFLAGS=$(CXXFLAGS)" \
188 "DLLTOOL=$(DLLTOOL)" \
189 "LDFLAGS=$(LDFLAGS)" \
190 "RANLIB=$(RANLIB)" \
191 "MAKEINFO=$(MAKEINFO)" \
192 "MAKEHTML=$(MAKEHTML)" \
193 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
194 "INSTALL=$(INSTALL)" \
195 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
196 "INSTALL_DATA=$(INSTALL_DATA)" \
197 "RUNTEST=$(RUNTEST)" \
198 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
200 .PHONY: all
201 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
203 %.xml: @MAINTAINER_MODE_TRUE@ %.xml.in apply-defaults.xsl linux-defaults.xml.in
204 $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl\
205 $(SYSCALLS_SRCDIR)/$@.in
207 .PHONY: syscall-xml
208 syscall-xml: $(GEN_SYSCALLS_FILES)
210 .PHONY: clean-syscall-xml
211 # Only clean files generated XML files.
212 clean-syscall-xml:
213 files='$(GEN_SYSCALLS_FILES)' ; \
214 for file in $$files; do \
215 rm -f "$(SYSCALLS_SRCDIR)/$$file"; \
216 done
218 # For portability's sake, we need to handle systems that don't have
219 # symbolic links.
220 stamp-syscalls: Makefile $(SYSCALLS_FILES)
221 rm -rf ./$(SYSCALLS_DIR)
222 mkdir ./$(SYSCALLS_DIR)
223 files='$(SYSCALLS_FILES)' ; \
224 for file in $$files ; do \
225 f=$(SYSCALLS_SRCDIR)/$$file ; \
226 if test -f $$f ; then \
227 $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
228 fi ; \
229 done
230 touch $@
232 .PHONY: clean-syscalls
233 clean-syscalls:
234 rm -rf $(SYSCALLS_DIR)
235 rm -f stamp-syscalls
237 # This target is responsible for properly installing the syscalls'
238 # XML files in the system.
239 .PHONY: install-syscalls
240 install-syscalls:
241 $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR)
242 files='$(SYSCALLS_FILES)' ; \
243 for file in $$files; do \
244 f=$(SYSCALLS_SRCDIR)/$$file ; \
245 if test -f $$f ; then \
246 $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
247 fi ; \
248 done
250 .PHONY: uninstall-syscalls
251 uninstall-syscalls:
252 files='$(SYSCALLS_FILES)' ; \
253 for file in $$files ; do \
254 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
255 rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \
256 while test "x$$file" != "x$$slashdir" ; do \
257 rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
258 file="$$slashdir" ; \
259 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
260 done \
261 done
263 stamp-python: Makefile $(PYTHON_FILES)
264 rm -rf ./$(PYTHON_DIR)
265 files='$(PYTHON_FILES)' ; \
266 if test "x$$files" != x ; then \
267 for file in $$files ; do \
268 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
269 $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \
270 $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
271 done ; \
273 touch $@
275 .PHONY: clean-python
276 clean-python:
277 rm -rf $(PYTHON_DIR)
278 rm -f stamp-python
280 .PHONY: install-python
281 install-python:
282 files='$(PYTHON_FILES)' ; \
283 if test "x$$files" != x ; then \
284 for file in $$files ; do \
285 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
286 $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \
287 $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \
288 done ; \
291 .PHONY: uninstall-python
292 uninstall-python:
293 files='$(PYTHON_FILES)' ; \
294 if test "x$$files" != x ; then \
295 for file in $$files ; do \
296 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
297 rm -f $(PYTHON_INSTALL_DIR)/$$file ; \
298 while test "x$$file" != "x$$slashdir" ; do \
299 rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \
300 file="$$slashdir" ; \
301 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
302 done \
303 done ; \
306 stamp-guile: Makefile $(GUILE_SOURCE_FILES)
307 rm -rf ./$(GUILE_DIR)
308 if test "x$(GUILE_FILES)" != x ; then \
309 files='$(GUILE_SOURCE_FILES)' ; \
310 for file in $$files ; do \
311 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
312 $(INSTALL_DIR) ./$(GUILE_DIR)/$$dir ; \
313 $(INSTALL_DATA) $(GUILE_SRCDIR)/$$file ./$(GUILE_DIR)/$$dir ; \
314 done ; \
315 files='$(GUILE_COMPILED_FILES)' ; \
316 cd ./$(GUILE_DIR) ; \
317 for go in $$files ; do \
318 source="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
319 echo $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" ; \
320 $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" || exit 1 ; \
321 done ; \
323 touch $@
325 .PHONY: clean-guile
326 clean-guile:
327 rm -rf $(GUILE_DIR)
328 rm -f stamp-guile
330 .PHONY: install-guile
331 install-guile:
332 files='$(GUILE_FILES)' ; \
333 if test "x$$files" != x ; then \
334 for file in $$files ; do \
335 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
336 $(INSTALL_DIR) $(GUILE_INSTALL_DIR)/$$dir ; \
337 $(INSTALL_DATA) ./$(GUILE_DIR)/$$file $(GUILE_INSTALL_DIR)/$$dir ; \
338 done ; \
341 .PHONY: uninstall-guile
342 uninstall-guile:
343 files='$(GUILE_FILES)' ; \
344 if test "x$$files" != x ; then \
345 for file in $$files ; do \
346 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
347 rm -f $(GUILE_INSTALL_DIR)/$$file ; \
348 while test "x$$file" != "x$$slashdir" ; do \
349 rmdir 2>/dev/null "$(GUILE_INSTALL_DIR)$$slashdir" ; \
350 file="$$slashdir" ; \
351 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
352 done \
353 done ; \
356 stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES)
357 rm -rf ./$(SYSTEM_GDBINIT_DIR)
358 mkdir ./$(SYSTEM_GDBINIT_DIR)
359 files='$(SYSTEM_GDBINIT_FILES)' ; \
360 for file in $$files ; do \
361 f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
362 if test -f $$f ; then \
363 $(INSTALL_DATA) $$f ./$(SYSTEM_GDBINIT_DIR) ; \
364 fi ; \
365 done
366 touch $@
368 .PHONY: clean-system-gdbinit
369 clean-system-gdbinit:
370 rm -rf $(SYSTEM_GDBINIT_DIR)
371 rm -f stamp-system-gdbinit
373 .PHONY: install-system-gdbinit
374 install-system-gdbinit:
375 $(INSTALL_DIR) $(SYSTEM_GDBINIT_INSTALL_DIR)
376 files='$(SYSTEM_GDBINIT_FILES)' ; \
377 for file in $$files; do \
378 f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
379 if test -f $$f ; then \
380 $(INSTALL_DATA) $$f $(SYSTEM_GDBINIT_INSTALL_DIR) ; \
381 fi ; \
382 done
384 .PHONY: uninstall-system-gdbinit
385 uninstall-system-gdbinit:
386 files='$(SYSTEM_GDBINIT_FILES)' ; \
387 for file in $$files ; do \
388 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
389 rm -f $(SYSTEM_GDBINIT_INSTALL_DIR)/$$file ; \
390 while test "x$$file" != "x$$slashdir" ; do \
391 rmdir 2>/dev/null "$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
392 file="$$slashdir" ; \
393 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
394 done \
395 done
397 # Traditionally "install" depends on "all". But it may be useful
398 # not to; for example, if the user has made some trivial change to a
399 # source file and doesn't care about rebuilding or just wants to save the
400 # time it takes for make to check that all is up to date.
401 # install-only is intended to address that need.
402 .PHONY: install
403 install: all
404 @$(MAKE) $(FLAGS_TO_PASS) install-only
406 .PHONY: install-only
407 install-only: install-syscalls install-python install-guile \
408 install-system-gdbinit
410 .PHONY: uninstall
411 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
412 uninstall-system-gdbinit
414 .PHONY: clean
415 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
417 .PHONY: maintainer-clean realclean distclean
418 maintainer-clean realclean distclean: clean
419 rm -f Makefile
421 .PHONY: check installcheck info dvi pdf html
422 .PHONY: install-info install-pdf install-html clean-info
423 check installcheck:
424 info dvi pdf html:
425 install-info install-pdf install-html:
426 clean-info:
428 # GNU Make has an annoying habit of putting *all* the Makefile variables
429 # into the environment, unless you include this target as a circumvention.
430 # Rumor is that this will be fixed (and this target can be removed)
431 # in GNU Make 4.0.
432 .NOEXPORT:
434 # GNU Make 3.63 has a different problem: it keeps tacking command line
435 # overrides onto the definition of $(MAKE). This variable setting
436 # will remove them.
437 MAKEOVERRIDES=
439 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
440 cd .. && $(SHELL) ./config.status data-directory/Makefile
442 # Disable implicit make rules.
443 include $(srcdir)/../disable-implicit-rules.mk