1 # Copyright (C) 2010-2019 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
$(GEN_SYSCALLS_FILES
)
69 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
72 gdb
/FrameDecorator.py \
73 gdb
/FrameIterator.py \
80 gdb
/command
/__init__.py \
81 gdb
/command
/explore.py \
82 gdb
/command
/frame_filters.py \
83 gdb
/command
/pretty_printers.py \
84 gdb
/command
/prompt.py \
85 gdb
/command
/type_printers.py \
86 gdb
/command
/unwinders.py \
87 gdb
/command
/xmethods.py \
88 gdb
/function
/__init__.py \
89 gdb
/function
/as_string.py \
90 gdb
/function
/caller_is.py \
91 gdb
/function
/strfns.py \
92 gdb
/printer
/__init__.py \
93 gdb
/printer
/bound_registers.py
95 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
96 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
99 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
101 GUILE_SOURCE_FILES
= \
104 gdb
/experimental.scm \
111 GUILE_COMPILED_FILES
= \
113 gdb
/experimental.go \
119 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
120 @HAVE_GUILE_FALSE@GUILE_FILES
=
123 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
125 # Flags passed to 'guild compile'.
126 # Note: We can't use -Wunbound-variable because all the variables
127 # defined in C aren't visible when we compile.
128 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
129 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
130 # We still need to pass "-L ." so that other modules are found.
131 GUILD_COMPILE_FLAGS
= \
132 $(GUILD_TARGET_FLAG
) \
133 -Warity-mismatch
-Wformat
-Wunused-toplevel \
136 SYSTEM_GDBINIT_DIR
= system-gdbinit
137 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
138 SYSTEM_GDBINIT_FILES
= \
144 "exec_prefix=$(exec_prefix)" \
145 "infodir=$(infodir)" \
146 "datarootdir=$(datarootdir)" \
148 "htmldir=$(htmldir)" \
152 "datadir=$(datadir)" \
153 "includedir=$(includedir)" \
154 "against=$(against)" \
155 "DESTDIR=$(DESTDIR)" \
157 "AR_FLAGS=$(AR_FLAGS)" \
161 "CXXFLAGS=$(CXXFLAGS)" \
162 "DLLTOOL=$(DLLTOOL)" \
163 "LDFLAGS=$(LDFLAGS)" \
165 "MAKEINFO=$(MAKEINFO)" \
166 "MAKEHTML=$(MAKEHTML)" \
167 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
168 "INSTALL=$(INSTALL)" \
169 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
170 "INSTALL_DATA=$(INSTALL_DATA)" \
171 "RUNTEST=$(RUNTEST)" \
172 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
175 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
177 %.xml
: @MAINTAINER_MODE_TRUE@
%.xml.in apply-defaults.xsl linux-defaults.xml.in
178 $(XSLTPROC
) -o
$(SYSCALLS_SRCDIR
)/$@
$(SYSCALLS_SRCDIR
)/apply-defaults.xsl\
179 $(SYSCALLS_SRCDIR
)/$@.in
182 syscall-xml
: $(GEN_SYSCALLS_FILES
)
184 .PHONY
: clean-syscall-xml
185 # Only clean files generated XML files.
187 files
='$(GEN_SYSCALLS_FILES)' ; \
188 for file in
$$files; do \
189 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
192 # For portability's sake, we need to handle systems that don't have
194 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
195 rm -rf .
/$(SYSCALLS_DIR
)
196 mkdir .
/$(SYSCALLS_DIR
)
197 files
='$(SYSCALLS_FILES)' ; \
198 for file in
$$files ; do \
199 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
200 if
test -f
$$f ; then \
201 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
206 .PHONY
: clean-syscalls
208 rm -rf
$(SYSCALLS_DIR
)
211 # This target is responsible for properly installing the syscalls'
212 # XML files in the system.
213 .PHONY
: install-syscalls
215 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
216 files
='$(SYSCALLS_FILES)' ; \
217 for file in
$$files; do \
218 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
219 if
test -f
$$f ; then \
220 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
224 .PHONY
: uninstall-syscalls
226 files
='$(SYSCALLS_FILES)' ; \
227 for file in
$$files ; do \
228 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
229 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
230 while
test "x$$file" != "x$$slashdir" ; do \
231 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
232 file
="$$slashdir" ; \
233 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
237 stamp-python
: Makefile
$(PYTHON_FILES
)
238 rm -rf .
/$(PYTHON_DIR
)
239 files
='$(PYTHON_FILES)' ; \
240 if
test "x$$files" != x
; then \
241 for file in
$$files ; do \
242 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
243 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
244 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
254 .PHONY
: install-python
256 files
='$(PYTHON_FILES)' ; \
257 if
test "x$$files" != x
; then \
258 for file in
$$files ; do \
259 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
260 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
261 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
265 .PHONY
: uninstall-python
267 files
='$(PYTHON_FILES)' ; \
268 if
test "x$$files" != x
; then \
269 for file in
$$files ; do \
270 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
271 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
272 while
test "x$$file" != "x$$slashdir" ; do \
273 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
274 file
="$$slashdir" ; \
275 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
280 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
281 rm -rf .
/$(GUILE_DIR
)
282 if
test "x$(GUILE_FILES)" != x
; then \
283 files
='$(GUILE_SOURCE_FILES)' ; \
284 for file in
$$files ; do \
285 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
286 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
287 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
289 files
='$(GUILE_COMPILED_FILES)' ; \
290 cd .
/$(GUILE_DIR
) ; \
291 for go in
$$files ; do \
292 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
293 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
294 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
304 .PHONY
: install-guile
306 files
='$(GUILE_FILES)' ; \
307 if
test "x$$files" != x
; then \
308 for file in
$$files ; do \
309 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
310 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
311 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
315 .PHONY
: uninstall-guile
317 files
='$(GUILE_FILES)' ; \
318 if
test "x$$files" != x
; then \
319 for file in
$$files ; do \
320 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
321 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
322 while
test "x$$file" != "x$$slashdir" ; do \
323 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
324 file
="$$slashdir" ; \
325 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
330 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
331 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
332 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
333 files
='$(SYSTEM_GDBINIT_FILES)' ; \
334 for file in
$$files ; do \
335 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
336 if
test -f
$$f ; then \
337 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
342 .PHONY
: clean-system-gdbinit
343 clean-system-gdbinit
:
344 rm -rf
$(SYSTEM_GDBINIT_DIR
)
345 rm -f stamp-system-gdbinit
347 .PHONY
: install-system-gdbinit
348 install-system-gdbinit
:
349 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
350 files
='$(SYSTEM_GDBINIT_FILES)' ; \
351 for file in
$$files; do \
352 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
353 if
test -f
$$f ; then \
354 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
358 .PHONY
: uninstall-system-gdbinit
359 uninstall-system-gdbinit
:
360 files
='$(SYSTEM_GDBINIT_FILES)' ; \
361 for file in
$$files ; do \
362 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
363 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
364 while
test "x$$file" != "x$$slashdir" ; do \
365 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
366 file
="$$slashdir" ; \
367 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
371 # Traditionally "install" depends on "all". But it may be useful
372 # not to; for example, if the user has made some trivial change to a
373 # source file and doesn't care about rebuilding or just wants to save the
374 # time it takes for make to check that all is up to date.
375 # install-only is intended to address that need.
378 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
381 install-only
: install-syscalls install-python install-guile \
382 install-system-gdbinit
385 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
386 uninstall-system-gdbinit
389 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
391 .PHONY
: maintainer-clean
realclean distclean
392 maintainer-clean
realclean distclean: clean
395 .PHONY
: check installcheck info dvi pdf html
396 .PHONY
: install-info install-pdf install-html clean-info
399 install-info install-pdf install-html
:
402 # GNU Make has an annoying habit of putting *all* the Makefile variables
403 # into the environment, unless you include this target as a circumvention.
404 # Rumor is that this will be fixed (and this target can be removed)
408 # GNU Make 3.63 has a different problem: it keeps tacking command line
409 # overrides onto the definition of $(MAKE). This variable setting
413 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
414 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile
416 # Disable implicit make rules.
417 include $(srcdir)/..
/disable-implicit-rules.mk