1 # Copyright (C) 2010-2015 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
)
26 top_srcdir
= @top_srcdir@
27 top_builddir
= @top_builddir@
30 exec_prefix = @
exec_prefix@
32 datarootdir
= @datarootdir@
40 INSTALL_DATA
= @INSTALL_DATA@
41 INSTALL_DIR
= $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
43 GDB_DATADIR
= @GDB_DATADIR@
45 SYSCALLS_DIR
= syscalls
46 SYSCALLS_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSCALLS_DIR
)
49 arm-linux.xml aarch64-linux.xml \
50 ppc-linux.xml ppc64-linux.xml \
51 i386-linux.xml amd64-linux.xml \
52 sparc-linux.xml sparc64-linux.xml \
53 mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
54 s390-linux.xml s390x-linux.xml
57 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
61 gdb
/FrameIterator.py \
62 gdb
/FrameDecorator.py \
68 gdb
/command
/__init__.py \
69 gdb
/command
/xmethods.py \
70 gdb
/command
/frame_filters.py \
71 gdb
/command
/unwinders.py \
72 gdb
/command
/type_printers.py \
73 gdb
/command
/pretty_printers.py \
74 gdb
/command
/prompt.py \
75 gdb
/command
/explore.py \
76 gdb
/function
/__init__.py \
77 gdb
/function
/caller_is.py \
78 gdb
/function
/strfns.py \
79 gdb
/printer
/__init__.py \
80 gdb
/printer
/bound_registers.py
82 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
83 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
86 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
88 GUILE_SOURCE_FILES
= \
91 gdb
/experimental.scm \
98 GUILE_COMPILED_FILES
= \
100 gdb
/experimental.go \
106 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
107 @HAVE_GUILE_FALSE@GUILE_FILES
=
110 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
112 # Flags passed to 'guild compile'.
113 # Note: We can't use -Wunbound-variable because all the variables
114 # defined in C aren't visible when we compile.
115 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
116 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
117 # We still need to pass "-L ." so that other modules are found.
118 GUILD_COMPILE_FLAGS
= \
119 $(GUILD_TARGET_FLAG
) \
120 -Warity-mismatch
-Wformat
-Wunused-toplevel \
123 SYSTEM_GDBINIT_DIR
= system-gdbinit
124 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
125 SYSTEM_GDBINIT_FILES
= \
131 "exec_prefix=$(exec_prefix)" \
132 "infodir=$(infodir)" \
133 "datarootdir=$(datarootdir)" \
135 "htmldir=$(htmldir)" \
139 "datadir=$(datadir)" \
140 "includedir=$(includedir)" \
141 "against=$(against)" \
142 "DESTDIR=$(DESTDIR)" \
144 "AR_FLAGS=$(AR_FLAGS)" \
148 "CXXFLAGS=$(CXXFLAGS)" \
149 "DLLTOOL=$(DLLTOOL)" \
150 "LDFLAGS=$(LDFLAGS)" \
152 "MAKEINFO=$(MAKEINFO)" \
153 "MAKEHTML=$(MAKEHTML)" \
154 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
155 "INSTALL=$(INSTALL)" \
156 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
157 "INSTALL_DATA=$(INSTALL_DATA)" \
158 "RUNTEST=$(RUNTEST)" \
159 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
162 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
164 # For portability's sake, we need to handle systems that don't have
166 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
167 rm -rf .
/$(SYSCALLS_DIR
)
168 mkdir .
/$(SYSCALLS_DIR
)
169 files
='$(SYSCALLS_FILES)' ; \
170 for file in
$$files ; do \
171 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
172 if
test -f
$$f ; then \
173 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
178 .PHONY
: clean-syscalls
180 rm -rf
$(SYSCALLS_DIR
)
183 # This target is responsible for properly installing the syscalls'
184 # XML files in the system.
185 .PHONY
: install-syscalls
187 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
188 files
='$(SYSCALLS_FILES)' ; \
189 for file in
$$files; do \
190 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
191 if
test -f
$$f ; then \
192 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
196 .PHONY
: uninstall-syscalls
198 files
='$(SYSCALLS_FILES)' ; \
199 for file in
$$files ; do \
200 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
201 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
202 while
test "x$$file" != "x$$slashdir" ; do \
203 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
204 file
="$$slashdir" ; \
205 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
209 stamp-python
: Makefile
$(PYTHON_FILES
)
210 rm -rf .
/$(PYTHON_DIR
)
211 files
='$(PYTHON_FILES)' ; \
212 if
test "x$$files" != x
; then \
213 for file in
$$files ; do \
214 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
215 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
216 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
226 .PHONY
: install-python
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_INSTALL_DIR
)/$$dir ; \
233 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
237 .PHONY
: uninstall-python
239 files
='$(PYTHON_FILES)' ; \
240 if
test "x$$files" != x
; then \
241 for file in
$$files ; do \
242 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
243 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
244 while
test "x$$file" != "x$$slashdir" ; do \
245 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
246 file
="$$slashdir" ; \
247 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
252 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
253 rm -rf .
/$(GUILE_DIR
)
254 if
test "x$(GUILE_FILES)" != x
; then \
255 files
='$(GUILE_SOURCE_FILES)' ; \
256 for file in
$$files ; do \
257 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
258 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
259 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
261 files
='$(GUILE_COMPILED_FILES)' ; \
262 cd .
/$(GUILE_DIR
) ; \
263 for go in
$$files ; do \
264 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
265 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
266 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
276 .PHONY
: install-guile
278 files
='$(GUILE_FILES)' ; \
279 if
test "x$$files" != x
; then \
280 for file in
$$files ; do \
281 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
282 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
283 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
287 .PHONY
: uninstall-guile
289 files
='$(GUILE_FILES)' ; \
290 if
test "x$$files" != x
; then \
291 for file in
$$files ; do \
292 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
293 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
294 while
test "x$$file" != "x$$slashdir" ; do \
295 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
296 file
="$$slashdir" ; \
297 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
302 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
303 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
304 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
305 files
='$(SYSTEM_GDBINIT_FILES)' ; \
306 for file in
$$files ; do \
307 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
308 if
test -f
$$f ; then \
309 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
314 .PHONY
: clean-system-gdbinit
315 clean-system-gdbinit
:
316 rm -rf
$(SYSTEM_GDBINIT_DIR
)
317 rm -f stamp-system-gdbinit
319 .PHONY
: install-system-gdbinit
320 install-system-gdbinit
:
321 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_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_INSTALL_DIR
) ; \
330 .PHONY
: uninstall-system-gdbinit
331 uninstall-system-gdbinit
:
332 files
='$(SYSTEM_GDBINIT_FILES)' ; \
333 for file in
$$files ; do \
334 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
335 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
336 while
test "x$$file" != "x$$slashdir" ; do \
337 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
338 file
="$$slashdir" ; \
339 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
343 # Traditionally "install" depends on "all". But it may be useful
344 # not to; for example, if the user has made some trivial change to a
345 # source file and doesn't care about rebuilding or just wants to save the
346 # time it takes for make to check that all is up to date.
347 # install-only is intended to address that need.
350 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
353 install-only
: install-syscalls install-python install-guile \
354 install-system-gdbinit
357 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
358 uninstall-system-gdbinit
361 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
363 .PHONY
: maintainer-clean
realclean distclean
364 maintainer-clean
realclean distclean: clean
367 .PHONY
: check installcheck info dvi pdf html
368 .PHONY
: install-info install-pdf install-html clean-info
371 install-info install-pdf install-html
:
374 # GNU Make has an annoying habit of putting *all* the Makefile variables
375 # into the environment, unless you include this target as a circumvention.
376 # Rumor is that this will be fixed (and this target can be removed)
380 # GNU Make 3.63 has a different problem: it keeps tacking command line
381 # overrides onto the definition of $(MAKE). This variable setting
385 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
386 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile