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 \
106 gdb
/function
/__init__.py \
107 gdb
/function
/as_string.py \
108 gdb
/function
/caller_is.py \
109 gdb
/function
/strfns.py \
110 gdb
/printer
/__init__.py \
111 gdb
/printer
/bound_registers.py
113 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
114 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
117 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
119 GUILE_SOURCE_FILES
= \
122 gdb
/experimental.scm \
129 GUILE_COMPILED_FILES
= \
131 gdb
/experimental.go \
137 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
138 @HAVE_GUILE_FALSE@GUILE_FILES
=
141 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
143 # Flags passed to 'guild compile'.
144 # Note: We can't use -Wunbound-variable because all the variables
145 # defined in C aren't visible when we compile.
146 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
147 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
148 # We still need to pass "-L ." so that other modules are found.
149 GUILD_COMPILE_FLAGS
= \
150 $(GUILD_TARGET_FLAG
) \
151 -Warity-mismatch
-Wformat
-Wunused-toplevel \
154 SYSTEM_GDBINIT_DIR
= system-gdbinit
155 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
156 SYSTEM_GDBINIT_FILES
= \
162 "exec_prefix=$(exec_prefix)" \
163 "infodir=$(infodir)" \
164 "datarootdir=$(datarootdir)" \
166 "htmldir=$(htmldir)" \
170 "datadir=$(datadir)" \
171 "includedir=$(includedir)" \
172 "against=$(against)" \
173 "DESTDIR=$(DESTDIR)" \
175 "AR_FLAGS=$(AR_FLAGS)" \
179 "CXXFLAGS=$(CXXFLAGS)" \
180 "DLLTOOL=$(DLLTOOL)" \
181 "LDFLAGS=$(LDFLAGS)" \
183 "MAKEINFO=$(MAKEINFO)" \
184 "MAKEHTML=$(MAKEHTML)" \
185 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
186 "INSTALL=$(INSTALL)" \
187 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
188 "INSTALL_DATA=$(INSTALL_DATA)" \
189 "RUNTEST=$(RUNTEST)" \
190 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
193 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
195 %.xml
: @MAINTAINER_MODE_TRUE@
%.xml.in apply-defaults.xsl linux-defaults.xml.in
196 $(XSLTPROC
) -o
$(SYSCALLS_SRCDIR
)/$@
$(SYSCALLS_SRCDIR
)/apply-defaults.xsl\
197 $(SYSCALLS_SRCDIR
)/$@.in
200 syscall-xml
: $(GEN_SYSCALLS_FILES
)
202 .PHONY
: clean-syscall-xml
203 # Only clean files generated XML files.
205 files
='$(GEN_SYSCALLS_FILES)' ; \
206 for file in
$$files; do \
207 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
210 # For portability's sake, we need to handle systems that don't have
212 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
213 rm -rf .
/$(SYSCALLS_DIR
)
214 mkdir .
/$(SYSCALLS_DIR
)
215 files
='$(SYSCALLS_FILES)' ; \
216 for file in
$$files ; do \
217 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
218 if
test -f
$$f ; then \
219 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
224 .PHONY
: clean-syscalls
226 rm -rf
$(SYSCALLS_DIR
)
229 # This target is responsible for properly installing the syscalls'
230 # XML files in the system.
231 .PHONY
: install-syscalls
233 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
234 files
='$(SYSCALLS_FILES)' ; \
235 for file in
$$files; do \
236 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
237 if
test -f
$$f ; then \
238 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
242 .PHONY
: uninstall-syscalls
244 files
='$(SYSCALLS_FILES)' ; \
245 for file in
$$files ; do \
246 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
247 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
248 while
test "x$$file" != "x$$slashdir" ; do \
249 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
250 file
="$$slashdir" ; \
251 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
255 stamp-python
: Makefile
$(PYTHON_FILES
)
256 rm -rf .
/$(PYTHON_DIR
)
257 files
='$(PYTHON_FILES)' ; \
258 if
test "x$$files" != x
; then \
259 for file in
$$files ; do \
260 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
261 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
262 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
272 .PHONY
: install-python
274 files
='$(PYTHON_FILES)' ; \
275 if
test "x$$files" != x
; then \
276 for file in
$$files ; do \
277 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
278 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
279 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
283 .PHONY
: uninstall-python
285 files
='$(PYTHON_FILES)' ; \
286 if
test "x$$files" != x
; then \
287 for file in
$$files ; do \
288 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
289 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
290 while
test "x$$file" != "x$$slashdir" ; do \
291 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
292 file
="$$slashdir" ; \
293 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
298 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
299 rm -rf .
/$(GUILE_DIR
)
300 if
test "x$(GUILE_FILES)" != x
; then \
301 files
='$(GUILE_SOURCE_FILES)' ; \
302 for file in
$$files ; do \
303 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
304 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
305 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
307 files
='$(GUILE_COMPILED_FILES)' ; \
308 cd .
/$(GUILE_DIR
) ; \
309 for go in
$$files ; do \
310 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
311 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
312 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
322 .PHONY
: install-guile
324 files
='$(GUILE_FILES)' ; \
325 if
test "x$$files" != x
; then \
326 for file in
$$files ; do \
327 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
328 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
329 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
333 .PHONY
: uninstall-guile
335 files
='$(GUILE_FILES)' ; \
336 if
test "x$$files" != x
; then \
337 for file in
$$files ; do \
338 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
339 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
340 while
test "x$$file" != "x$$slashdir" ; do \
341 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
342 file
="$$slashdir" ; \
343 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
348 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
349 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
350 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
351 files
='$(SYSTEM_GDBINIT_FILES)' ; \
352 for file in
$$files ; do \
353 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
354 if
test -f
$$f ; then \
355 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
360 .PHONY
: clean-system-gdbinit
361 clean-system-gdbinit
:
362 rm -rf
$(SYSTEM_GDBINIT_DIR
)
363 rm -f stamp-system-gdbinit
365 .PHONY
: install-system-gdbinit
366 install-system-gdbinit
:
367 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
368 files
='$(SYSTEM_GDBINIT_FILES)' ; \
369 for file in
$$files; do \
370 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
371 if
test -f
$$f ; then \
372 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
376 .PHONY
: uninstall-system-gdbinit
377 uninstall-system-gdbinit
:
378 files
='$(SYSTEM_GDBINIT_FILES)' ; \
379 for file in
$$files ; do \
380 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
381 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
382 while
test "x$$file" != "x$$slashdir" ; do \
383 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
384 file
="$$slashdir" ; \
385 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
389 # Traditionally "install" depends on "all". But it may be useful
390 # not to; for example, if the user has made some trivial change to a
391 # source file and doesn't care about rebuilding or just wants to save the
392 # time it takes for make to check that all is up to date.
393 # install-only is intended to address that need.
396 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
399 install-only
: install-syscalls install-python install-guile \
400 install-system-gdbinit
403 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
404 uninstall-system-gdbinit
407 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
409 .PHONY
: maintainer-clean
realclean distclean
410 maintainer-clean
realclean distclean: clean
413 .PHONY
: check installcheck info dvi pdf html
414 .PHONY
: install-info install-pdf install-html clean-info
417 install-info install-pdf install-html
:
420 # GNU Make has an annoying habit of putting *all* the Makefile variables
421 # into the environment, unless you include this target as a circumvention.
422 # Rumor is that this will be fixed (and this target can be removed)
426 # GNU Make 3.63 has a different problem: it keeps tacking command line
427 # overrides onto the definition of $(MAKE). This variable setting
431 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
432 cd ..
&& $(SHELL
) .
/config.status data-directory
/Makefile
434 # Disable implicit make rules.
435 include $(srcdir)/..
/disable-implicit-rules.mk