1 # Copyright (C) 2010-2023 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 \
82 gdb
/command
/__init__.py \
83 gdb
/command
/explore.py \
84 gdb
/command
/frame_filters.py \
85 gdb
/command
/pretty_printers.py \
86 gdb
/command
/prompt.py \
87 gdb
/command
/type_printers.py \
88 gdb
/command
/unwinders.py \
89 gdb
/command
/xmethods.py \
90 gdb
/dap
/breakpoint.py \
92 gdb
/dap
/disassemble.py \
99 gdb
/dap
/locations.py \
110 gdb
/dap
/typecheck.py \
112 gdb
/function
/__init__.py \
113 gdb
/function
/as_string.py \
114 gdb
/function
/caller_is.py \
115 gdb
/function
/strfns.py \
116 gdb
/printer
/__init__.py \
117 gdb
/printer
/bound_registers.py
119 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
120 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
123 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
125 GUILE_SOURCE_FILES
= \
128 gdb
/experimental.scm \
135 GUILE_COMPILED_FILES
= \
137 gdb
/experimental.go \
143 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
144 @HAVE_GUILE_FALSE@GUILE_FILES
=
147 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
149 # Flags passed to 'guild compile'.
150 # Note: We can't use -Wunbound-variable because all the variables
151 # defined in C aren't visible when we compile.
152 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
153 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
154 # We still need to pass "-L ." so that other modules are found.
155 GUILD_COMPILE_FLAGS
= \
156 $(GUILD_TARGET_FLAG
) \
157 -Warity-mismatch
-Wformat
-Wunused-toplevel \
160 SYSTEM_GDBINIT_DIR
= system-gdbinit
161 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
162 SYSTEM_GDBINIT_FILES
= \
168 "exec_prefix=$(exec_prefix)" \
169 "infodir=$(infodir)" \
170 "datarootdir=$(datarootdir)" \
172 "htmldir=$(htmldir)" \
176 "datadir=$(datadir)" \
177 "includedir=$(includedir)" \
178 "against=$(against)" \
179 "DESTDIR=$(DESTDIR)" \
181 "AR_FLAGS=$(AR_FLAGS)" \
185 "CXXFLAGS=$(CXXFLAGS)" \
186 "DLLTOOL=$(DLLTOOL)" \
187 "LDFLAGS=$(LDFLAGS)" \
189 "MAKEINFO=$(MAKEINFO)" \
190 "MAKEHTML=$(MAKEHTML)" \
191 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
192 "INSTALL=$(INSTALL)" \
193 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
194 "INSTALL_DATA=$(INSTALL_DATA)" \
195 "RUNTEST=$(RUNTEST)" \
196 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
199 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
201 %.xml
: @MAINTAINER_MODE_TRUE@
%.xml.in apply-defaults.xsl linux-defaults.xml.in
202 $(XSLTPROC
) -o
$(SYSCALLS_SRCDIR
)/$@
$(SYSCALLS_SRCDIR
)/apply-defaults.xsl\
203 $(SYSCALLS_SRCDIR
)/$@.in
206 syscall-xml
: $(GEN_SYSCALLS_FILES
)
208 .PHONY
: clean-syscall-xml
209 # Only clean files generated XML files.
211 files
='$(GEN_SYSCALLS_FILES)' ; \
212 for file in
$$files; do \
213 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
216 # For portability's sake, we need to handle systems that don't have
218 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
219 rm -rf .
/$(SYSCALLS_DIR
)
220 mkdir .
/$(SYSCALLS_DIR
)
221 files
='$(SYSCALLS_FILES)' ; \
222 for file in
$$files ; do \
223 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
224 if
test -f
$$f ; then \
225 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
230 .PHONY
: clean-syscalls
232 rm -rf
$(SYSCALLS_DIR
)
235 # This target is responsible for properly installing the syscalls'
236 # XML files in the system.
237 .PHONY
: install-syscalls
239 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
240 files
='$(SYSCALLS_FILES)' ; \
241 for file in
$$files; do \
242 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
243 if
test -f
$$f ; then \
244 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
248 .PHONY
: uninstall-syscalls
250 files
='$(SYSCALLS_FILES)' ; \
251 for file in
$$files ; do \
252 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
253 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
254 while
test "x$$file" != "x$$slashdir" ; do \
255 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
256 file
="$$slashdir" ; \
257 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
261 stamp-python
: Makefile
$(PYTHON_FILES
)
262 rm -rf .
/$(PYTHON_DIR
)
263 files
='$(PYTHON_FILES)' ; \
264 if
test "x$$files" != x
; then \
265 for file in
$$files ; do \
266 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
267 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
268 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
278 .PHONY
: install-python
280 files
='$(PYTHON_FILES)' ; \
281 if
test "x$$files" != x
; then \
282 for file in
$$files ; do \
283 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
284 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
285 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
289 .PHONY
: uninstall-python
291 files
='$(PYTHON_FILES)' ; \
292 if
test "x$$files" != x
; then \
293 for file in
$$files ; do \
294 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
295 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
296 while
test "x$$file" != "x$$slashdir" ; do \
297 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
298 file
="$$slashdir" ; \
299 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
304 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
305 rm -rf .
/$(GUILE_DIR
)
306 if
test "x$(GUILE_FILES)" != x
; then \
307 files
='$(GUILE_SOURCE_FILES)' ; \
308 for file in
$$files ; do \
309 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
310 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
311 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
313 files
='$(GUILE_COMPILED_FILES)' ; \
314 cd .
/$(GUILE_DIR
) ; \
315 for go in
$$files ; do \
316 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
317 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
318 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
328 .PHONY
: install-guile
330 files
='$(GUILE_FILES)' ; \
331 if
test "x$$files" != x
; then \
332 for file in
$$files ; do \
333 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
334 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
335 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
339 .PHONY
: uninstall-guile
341 files
='$(GUILE_FILES)' ; \
342 if
test "x$$files" != x
; then \
343 for file in
$$files ; do \
344 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
345 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
346 while
test "x$$file" != "x$$slashdir" ; do \
347 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
348 file
="$$slashdir" ; \
349 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
354 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
355 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
356 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
357 files
='$(SYSTEM_GDBINIT_FILES)' ; \
358 for file in
$$files ; do \
359 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
360 if
test -f
$$f ; then \
361 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
366 .PHONY
: clean-system-gdbinit
367 clean-system-gdbinit
:
368 rm -rf
$(SYSTEM_GDBINIT_DIR
)
369 rm -f stamp-system-gdbinit
371 .PHONY
: install-system-gdbinit
372 install-system-gdbinit
:
373 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
374 files
='$(SYSTEM_GDBINIT_FILES)' ; \
375 for file in
$$files; do \
376 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
377 if
test -f
$$f ; then \
378 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
382 .PHONY
: uninstall-system-gdbinit
383 uninstall-system-gdbinit
:
384 files
='$(SYSTEM_GDBINIT_FILES)' ; \
385 for file in
$$files ; do \
386 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
387 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
388 while
test "x$$file" != "x$$slashdir" ; do \
389 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
390 file
="$$slashdir" ; \
391 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
395 # Traditionally "install" depends on "all". But it may be useful
396 # not to; for example, if the user has made some trivial change to a
397 # source file and doesn't care about rebuilding or just wants to save the
398 # time it takes for make to check that all is up to date.
399 # install-only is intended to address that need.
402 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
405 install-only
: install-syscalls install-python install-guile \
406 install-system-gdbinit
409 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
410 uninstall-system-gdbinit
413 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
415 .PHONY
: maintainer-clean
realclean distclean
416 maintainer-clean
realclean distclean: clean
419 .PHONY
: check installcheck info dvi pdf html
420 .PHONY
: install-info install-pdf install-html clean-info
423 install-info install-pdf install-html
:
426 # GNU Make has an annoying habit of putting *all* the Makefile variables
427 # into the environment, unless you include this target as a circumvention.
428 # Rumor is that this will be fixed (and this target can be removed)
432 # GNU Make 3.63 has a different problem: it keeps tacking command line
433 # overrides onto the definition of $(MAKE). This variable setting
437 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
438 cd ..
&& $(SHELL
) .
/config.status data-directory
/Makefile
440 # Disable implicit make rules.
441 include $(srcdir)/..
/disable-implicit-rules.mk