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.
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
)
30 top_srcdir
= @top_srcdir@
31 top_builddir
= @top_builddir@
34 exec_prefix = @
exec_prefix@
36 datarootdir
= @datarootdir@
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
= \
66 SYSCALLS_FILES
= gdb-syscalls.dtd freebsd.xml netbsd.xml
$(GEN_SYSCALLS_FILES
)
69 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
73 gdb
/FrameDecorator.py \
74 gdb
/FrameIterator.py \
76 gdb
/missing_debug.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 \
94 gdb
/dap
/disassemble.py \
101 gdb
/dap
/locations.py \
112 gdb
/dap
/typecheck.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
=
125 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
127 GUILE_SOURCE_FILES
= \
130 gdb
/experimental.scm \
137 GUILE_COMPILED_FILES
= \
139 gdb
/experimental.go \
145 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
146 @HAVE_GUILE_FALSE@GUILE_FILES
=
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 \
162 SYSTEM_GDBINIT_DIR
= system-gdbinit
163 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
164 SYSTEM_GDBINIT_FILES
= \
170 "exec_prefix=$(exec_prefix)" \
171 "infodir=$(infodir)" \
172 "datarootdir=$(datarootdir)" \
174 "htmldir=$(htmldir)" \
178 "datadir=$(datadir)" \
179 "includedir=$(includedir)" \
180 "against=$(against)" \
181 "DESTDIR=$(DESTDIR)" \
183 "AR_FLAGS=$(AR_FLAGS)" \
187 "CXXFLAGS=$(CXXFLAGS)" \
188 "DLLTOOL=$(DLLTOOL)" \
189 "LDFLAGS=$(LDFLAGS)" \
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)"
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
208 syscall-xml
: $(GEN_SYSCALLS_FILES
)
210 .PHONY
: clean-syscall-xml
211 # Only clean files generated XML files.
213 files
='$(GEN_SYSCALLS_FILES)' ; \
214 for file in
$$files; do \
215 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
218 # For portability's sake, we need to handle systems that don't have
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
) ; \
232 .PHONY
: clean-syscalls
234 rm -rf
$(SYSCALLS_DIR
)
237 # This target is responsible for properly installing the syscalls'
238 # XML files in the system.
239 .PHONY
: 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
) ; \
250 .PHONY
: 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,/[^/]*$$,,'` ; \
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 ; \
280 .PHONY
: 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 ; \
291 .PHONY
: 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,/[^/]*$$,,'` ; \
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 ; \
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 ; \
330 .PHONY
: 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 ; \
341 .PHONY
: 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,/[^/]*$$,,'` ; \
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
) ; \
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
) ; \
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,/[^/]*$$,,'` ; \
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.
404 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
407 install-only
: install-syscalls install-python install-guile \
408 install-system-gdbinit
411 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
412 uninstall-system-gdbinit
415 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
417 .PHONY
: maintainer-clean
realclean distclean
418 maintainer-clean
realclean distclean: clean
421 .PHONY
: check installcheck info dvi pdf html
422 .PHONY
: install-info install-pdf install-html clean-info
425 install-info install-pdf install-html
:
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)
434 # GNU Make 3.63 has a different problem: it keeps tacking command line
435 # overrides onto the definition of $(MAKE). This variable setting
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