1 # Copyright (C) 2010-2016 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/>.
20 SYSCALLS_SRCDIR
= $(srcdir)/..
/syscalls
21 PYTHON_SRCDIR
= $(srcdir)/..
/python
/lib
22 GUILE_SRCDIR
= $(srcdir)/..
/guile
/lib
23 SYSTEM_GDBINIT_SRCDIR
= $(srcdir)/..
/system-gdbinit
24 VPATH
= $(srcdir):$(SYSCALLS_SRCDIR
):$(PYTHON_SRCDIR
):$(GUILE_SRCDIR
):$(SYSTEM_GDBINIT_SRCDIR
)
27 top_srcdir
= @top_srcdir@
28 top_builddir
= @top_builddir@
31 exec_prefix = @
exec_prefix@
33 datarootdir
= @datarootdir@
41 INSTALL_DATA
= @INSTALL_DATA@
42 INSTALL_DIR
= $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
44 GDB_DATADIR
= @GDB_DATADIR@
46 SYSCALLS_DIR
= syscalls
47 SYSCALLS_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSCALLS_DIR
)
48 GEN_SYSCALLS_FILES
= arm-linux.xml aarch64-linux.xml \
49 ppc-linux.xml ppc64-linux.xml \
50 i386-linux.xml amd64-linux.xml \
51 sparc-linux.xml sparc64-linux.xml \
52 mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
53 s390-linux.xml s390x-linux.xml
55 SYSCALLS_FILES
= gdb-syscalls.dtd freebsd.xml
$(GEN_SYSCALLS_FILES
)
58 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
62 gdb
/FrameIterator.py \
63 gdb
/FrameDecorator.py \
69 gdb
/command
/__init__.py \
70 gdb
/command
/xmethods.py \
71 gdb
/command
/frame_filters.py \
72 gdb
/command
/unwinders.py \
73 gdb
/command
/type_printers.py \
74 gdb
/command
/pretty_printers.py \
75 gdb
/command
/prompt.py \
76 gdb
/command
/explore.py \
77 gdb
/function
/__init__.py \
78 gdb
/function
/as_string.py \
79 gdb
/function
/caller_is.py \
80 gdb
/function
/strfns.py \
81 gdb
/printer
/__init__.py \
82 gdb
/printer
/bound_registers.py
84 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
85 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
88 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
90 GUILE_SOURCE_FILES
= \
93 gdb
/experimental.scm \
100 GUILE_COMPILED_FILES
= \
102 gdb
/experimental.go \
108 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
109 @HAVE_GUILE_FALSE@GUILE_FILES
=
112 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
114 # Flags passed to 'guild compile'.
115 # Note: We can't use -Wunbound-variable because all the variables
116 # defined in C aren't visible when we compile.
117 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
118 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
119 # We still need to pass "-L ." so that other modules are found.
120 GUILD_COMPILE_FLAGS
= \
121 $(GUILD_TARGET_FLAG
) \
122 -Warity-mismatch
-Wformat
-Wunused-toplevel \
125 SYSTEM_GDBINIT_DIR
= system-gdbinit
126 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
127 SYSTEM_GDBINIT_FILES
= \
133 "exec_prefix=$(exec_prefix)" \
134 "infodir=$(infodir)" \
135 "datarootdir=$(datarootdir)" \
137 "htmldir=$(htmldir)" \
141 "datadir=$(datadir)" \
142 "includedir=$(includedir)" \
143 "against=$(against)" \
144 "DESTDIR=$(DESTDIR)" \
146 "AR_FLAGS=$(AR_FLAGS)" \
150 "CXXFLAGS=$(CXXFLAGS)" \
151 "DLLTOOL=$(DLLTOOL)" \
152 "LDFLAGS=$(LDFLAGS)" \
154 "MAKEINFO=$(MAKEINFO)" \
155 "MAKEHTML=$(MAKEHTML)" \
156 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
157 "INSTALL=$(INSTALL)" \
158 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
159 "INSTALL_DATA=$(INSTALL_DATA)" \
160 "RUNTEST=$(RUNTEST)" \
161 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
164 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
166 %.xml
: @MAINTAINER_MODE_TRUE@
%.xml.in apply-defaults.xsl linux-defaults.xml.in
167 $(XSLTPROC
) -o
$(SYSCALLS_SRCDIR
)/$@
$(SYSCALLS_SRCDIR
)/apply-defaults.xsl\
168 $(SYSCALLS_SRCDIR
)/$@.in
171 syscall-xml
: $(GEN_SYSCALLS_FILES
)
173 .PHONY
: clean-syscall-xml
174 # Only clean files generated XML files.
176 files
='$(GEN_SYSCALLS_FILES)' ; \
177 for file in
$$files; do \
178 rm -f
"$(SYSCALLS_SRCDIR)/$$file"; \
181 # For portability's sake, we need to handle systems that don't have
183 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
184 rm -rf .
/$(SYSCALLS_DIR
)
185 mkdir .
/$(SYSCALLS_DIR
)
186 files
='$(SYSCALLS_FILES)' ; \
187 for file in
$$files ; do \
188 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
189 if
test -f
$$f ; then \
190 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
195 .PHONY
: clean-syscalls
197 rm -rf
$(SYSCALLS_DIR
)
200 # This target is responsible for properly installing the syscalls'
201 # XML files in the system.
202 .PHONY
: install-syscalls
204 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
205 files
='$(SYSCALLS_FILES)' ; \
206 for file in
$$files; do \
207 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
208 if
test -f
$$f ; then \
209 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
213 .PHONY
: uninstall-syscalls
215 files
='$(SYSCALLS_FILES)' ; \
216 for file in
$$files ; do \
217 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
218 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
219 while
test "x$$file" != "x$$slashdir" ; do \
220 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
221 file
="$$slashdir" ; \
222 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
226 stamp-python
: Makefile
$(PYTHON_FILES
)
227 rm -rf .
/$(PYTHON_DIR
)
228 files
='$(PYTHON_FILES)' ; \
229 if
test "x$$files" != x
; then \
230 for file in
$$files ; do \
231 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
232 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
233 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
243 .PHONY
: install-python
245 files
='$(PYTHON_FILES)' ; \
246 if
test "x$$files" != x
; then \
247 for file in
$$files ; do \
248 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
249 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
250 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
254 .PHONY
: uninstall-python
256 files
='$(PYTHON_FILES)' ; \
257 if
test "x$$files" != x
; then \
258 for file in
$$files ; do \
259 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
260 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
261 while
test "x$$file" != "x$$slashdir" ; do \
262 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
263 file
="$$slashdir" ; \
264 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
269 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
270 rm -rf .
/$(GUILE_DIR
)
271 if
test "x$(GUILE_FILES)" != x
; then \
272 files
='$(GUILE_SOURCE_FILES)' ; \
273 for file in
$$files ; do \
274 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
275 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
276 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
278 files
='$(GUILE_COMPILED_FILES)' ; \
279 cd .
/$(GUILE_DIR
) ; \
280 for go in
$$files ; do \
281 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
282 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
283 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
293 .PHONY
: install-guile
295 files
='$(GUILE_FILES)' ; \
296 if
test "x$$files" != x
; then \
297 for file in
$$files ; do \
298 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
299 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
300 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
304 .PHONY
: uninstall-guile
306 files
='$(GUILE_FILES)' ; \
307 if
test "x$$files" != x
; then \
308 for file in
$$files ; do \
309 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
310 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
311 while
test "x$$file" != "x$$slashdir" ; do \
312 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
313 file
="$$slashdir" ; \
314 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
319 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
320 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
321 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
322 files
='$(SYSTEM_GDBINIT_FILES)' ; \
323 for file in
$$files ; do \
324 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
325 if
test -f
$$f ; then \
326 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
331 .PHONY
: clean-system-gdbinit
332 clean-system-gdbinit
:
333 rm -rf
$(SYSTEM_GDBINIT_DIR
)
334 rm -f stamp-system-gdbinit
336 .PHONY
: install-system-gdbinit
337 install-system-gdbinit
:
338 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
339 files
='$(SYSTEM_GDBINIT_FILES)' ; \
340 for file in
$$files; do \
341 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
342 if
test -f
$$f ; then \
343 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
347 .PHONY
: uninstall-system-gdbinit
348 uninstall-system-gdbinit
:
349 files
='$(SYSTEM_GDBINIT_FILES)' ; \
350 for file in
$$files ; do \
351 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
352 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
353 while
test "x$$file" != "x$$slashdir" ; do \
354 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
355 file
="$$slashdir" ; \
356 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
360 # Traditionally "install" depends on "all". But it may be useful
361 # not to; for example, if the user has made some trivial change to a
362 # source file and doesn't care about rebuilding or just wants to save the
363 # time it takes for make to check that all is up to date.
364 # install-only is intended to address that need.
367 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
370 install-only
: install-syscalls install-python install-guile \
371 install-system-gdbinit
374 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
375 uninstall-system-gdbinit
378 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
380 .PHONY
: maintainer-clean
realclean distclean
381 maintainer-clean
realclean distclean: clean
384 .PHONY
: check installcheck info dvi pdf html
385 .PHONY
: install-info install-pdf install-html clean-info
388 install-info install-pdf install-html
:
391 # GNU Make has an annoying habit of putting *all* the Makefile variables
392 # into the environment, unless you include this target as a circumvention.
393 # Rumor is that this will be fixed (and this target can be removed)
397 # GNU Make 3.63 has a different problem: it keeps tacking command line
398 # overrides onto the definition of $(MAKE). This variable setting
402 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
403 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile