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 \
108 gdb
/dap
/typecheck.py \
110 gdb
/function
/__init__.py \
111 gdb
/function
/as_string.py \
112 gdb
/function
/caller_is.py \
113 gdb
/function
/strfns.py \
114 gdb
/printer
/__init__.py \
115 gdb
/printer
/bound_registers.py
117 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
118 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
121 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
123 GUILE_SOURCE_FILES
= \
126 gdb
/experimental.scm \
133 GUILE_COMPILED_FILES
= \
135 gdb
/experimental.go \
141 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
142 @HAVE_GUILE_FALSE@GUILE_FILES
=
145 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
147 # Flags passed to 'guild compile'.
148 # Note: We can't use -Wunbound-variable because all the variables
149 # defined in C aren't visible when we compile.
150 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
151 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
152 # We still need to pass "-L ." so that other modules are found.
153 GUILD_COMPILE_FLAGS
= \
154 $(GUILD_TARGET_FLAG
) \
155 -Warity-mismatch
-Wformat
-Wunused-toplevel \
158 SYSTEM_GDBINIT_DIR
= system-gdbinit
159 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
160 SYSTEM_GDBINIT_FILES
= \
166 "exec_prefix=$(exec_prefix)" \
167 "infodir=$(infodir)" \
168 "datarootdir=$(datarootdir)" \
170 "htmldir=$(htmldir)" \
174 "datadir=$(datadir)" \
175 "includedir=$(includedir)" \
176 "against=$(against)" \
177 "DESTDIR=$(DESTDIR)" \
179 "AR_FLAGS=$(AR_FLAGS)" \
183 "CXXFLAGS=$(CXXFLAGS)" \
184 "DLLTOOL=$(DLLTOOL)" \
185 "LDFLAGS=$(LDFLAGS)" \
187 "MAKEINFO=$(MAKEINFO)" \
188 "MAKEHTML=$(MAKEHTML)" \
189 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
190 "INSTALL=$(INSTALL)" \
191 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
192 "INSTALL_DATA=$(INSTALL_DATA)" \
193 "RUNTEST=$(RUNTEST)" \
194 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
197 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
199 %.xml
: @MAINTAINER_MODE_TRUE@
%.xml.in apply-defaults.xsl linux-defaults.xml.in
200 $(XSLTPROC
) -o
$(SYSCALLS_SRCDIR
)/$@
$(SYSCALLS_SRCDIR
)/apply-defaults.xsl\
201 $(SYSCALLS_SRCDIR
)/$@.in
204 syscall-xml
: $(GEN_SYSCALLS_FILES
)
206 .PHONY
: clean-syscall-xml
207 # Only clean files generated XML files.
209 files
='$(GEN_SYSCALLS_FILES)' ; \
210 for file in
$$files; do \
211 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
214 # For portability's sake, we need to handle systems that don't have
216 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
217 rm -rf .
/$(SYSCALLS_DIR
)
218 mkdir .
/$(SYSCALLS_DIR
)
219 files
='$(SYSCALLS_FILES)' ; \
220 for file in
$$files ; do \
221 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
222 if
test -f
$$f ; then \
223 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
228 .PHONY
: clean-syscalls
230 rm -rf
$(SYSCALLS_DIR
)
233 # This target is responsible for properly installing the syscalls'
234 # XML files in the system.
235 .PHONY
: install-syscalls
237 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
238 files
='$(SYSCALLS_FILES)' ; \
239 for file in
$$files; do \
240 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
241 if
test -f
$$f ; then \
242 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
246 .PHONY
: uninstall-syscalls
248 files
='$(SYSCALLS_FILES)' ; \
249 for file in
$$files ; do \
250 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
251 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
252 while
test "x$$file" != "x$$slashdir" ; do \
253 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
254 file
="$$slashdir" ; \
255 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
259 stamp-python
: Makefile
$(PYTHON_FILES
)
260 rm -rf .
/$(PYTHON_DIR
)
261 files
='$(PYTHON_FILES)' ; \
262 if
test "x$$files" != x
; then \
263 for file in
$$files ; do \
264 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
265 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
266 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
276 .PHONY
: install-python
278 files
='$(PYTHON_FILES)' ; \
279 if
test "x$$files" != x
; then \
280 for file in
$$files ; do \
281 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
282 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
283 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
287 .PHONY
: uninstall-python
289 files
='$(PYTHON_FILES)' ; \
290 if
test "x$$files" != x
; then \
291 for file in
$$files ; do \
292 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
293 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
294 while
test "x$$file" != "x$$slashdir" ; do \
295 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
296 file
="$$slashdir" ; \
297 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
302 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
303 rm -rf .
/$(GUILE_DIR
)
304 if
test "x$(GUILE_FILES)" != x
; then \
305 files
='$(GUILE_SOURCE_FILES)' ; \
306 for file in
$$files ; do \
307 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
308 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
309 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
311 files
='$(GUILE_COMPILED_FILES)' ; \
312 cd .
/$(GUILE_DIR
) ; \
313 for go in
$$files ; do \
314 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
315 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
316 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
326 .PHONY
: install-guile
328 files
='$(GUILE_FILES)' ; \
329 if
test "x$$files" != x
; then \
330 for file in
$$files ; do \
331 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
332 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
333 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
337 .PHONY
: uninstall-guile
339 files
='$(GUILE_FILES)' ; \
340 if
test "x$$files" != x
; then \
341 for file in
$$files ; do \
342 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
343 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
344 while
test "x$$file" != "x$$slashdir" ; do \
345 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
346 file
="$$slashdir" ; \
347 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
352 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
353 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
354 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
355 files
='$(SYSTEM_GDBINIT_FILES)' ; \
356 for file in
$$files ; do \
357 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
358 if
test -f
$$f ; then \
359 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
364 .PHONY
: clean-system-gdbinit
365 clean-system-gdbinit
:
366 rm -rf
$(SYSTEM_GDBINIT_DIR
)
367 rm -f stamp-system-gdbinit
369 .PHONY
: install-system-gdbinit
370 install-system-gdbinit
:
371 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
372 files
='$(SYSTEM_GDBINIT_FILES)' ; \
373 for file in
$$files; do \
374 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
375 if
test -f
$$f ; then \
376 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
380 .PHONY
: uninstall-system-gdbinit
381 uninstall-system-gdbinit
:
382 files
='$(SYSTEM_GDBINIT_FILES)' ; \
383 for file in
$$files ; do \
384 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
385 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
386 while
test "x$$file" != "x$$slashdir" ; do \
387 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
388 file
="$$slashdir" ; \
389 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
393 # Traditionally "install" depends on "all". But it may be useful
394 # not to; for example, if the user has made some trivial change to a
395 # source file and doesn't care about rebuilding or just wants to save the
396 # time it takes for make to check that all is up to date.
397 # install-only is intended to address that need.
400 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
403 install-only
: install-syscalls install-python install-guile \
404 install-system-gdbinit
407 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
408 uninstall-system-gdbinit
411 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
413 .PHONY
: maintainer-clean
realclean distclean
414 maintainer-clean
realclean distclean: clean
417 .PHONY
: check installcheck info dvi pdf html
418 .PHONY
: install-info install-pdf install-html clean-info
421 install-info install-pdf install-html
:
424 # GNU Make has an annoying habit of putting *all* the Makefile variables
425 # into the environment, unless you include this target as a circumvention.
426 # Rumor is that this will be fixed (and this target can be removed)
430 # GNU Make 3.63 has a different problem: it keeps tacking command line
431 # overrides onto the definition of $(MAKE). This variable setting
435 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
436 cd ..
&& $(SHELL
) .
/config.status data-directory
/Makefile
438 # Disable implicit make rules.
439 include $(srcdir)/..
/disable-implicit-rules.mk