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
)
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 \
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 # For portability's sake, we need to handle systems that don't have
168 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
169 rm -rf .
/$(SYSCALLS_DIR
)
170 mkdir .
/$(SYSCALLS_DIR
)
171 files
='$(SYSCALLS_FILES)' ; \
172 for file in
$$files ; do \
173 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
174 if
test -f
$$f ; then \
175 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
180 .PHONY
: clean-syscalls
182 rm -rf
$(SYSCALLS_DIR
)
185 # This target is responsible for properly installing the syscalls'
186 # XML files in the system.
187 .PHONY
: install-syscalls
189 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
190 files
='$(SYSCALLS_FILES)' ; \
191 for file in
$$files; do \
192 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
193 if
test -f
$$f ; then \
194 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
198 .PHONY
: uninstall-syscalls
200 files
='$(SYSCALLS_FILES)' ; \
201 for file in
$$files ; do \
202 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
203 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
204 while
test "x$$file" != "x$$slashdir" ; do \
205 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
206 file
="$$slashdir" ; \
207 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
211 stamp-python
: Makefile
$(PYTHON_FILES
)
212 rm -rf .
/$(PYTHON_DIR
)
213 files
='$(PYTHON_FILES)' ; \
214 if
test "x$$files" != x
; then \
215 for file in
$$files ; do \
216 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
217 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
218 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
228 .PHONY
: install-python
230 files
='$(PYTHON_FILES)' ; \
231 if
test "x$$files" != x
; then \
232 for file in
$$files ; do \
233 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
234 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
235 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
239 .PHONY
: uninstall-python
241 files
='$(PYTHON_FILES)' ; \
242 if
test "x$$files" != x
; then \
243 for file in
$$files ; do \
244 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
245 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
246 while
test "x$$file" != "x$$slashdir" ; do \
247 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
248 file
="$$slashdir" ; \
249 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
254 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
255 rm -rf .
/$(GUILE_DIR
)
256 if
test "x$(GUILE_FILES)" != x
; then \
257 files
='$(GUILE_SOURCE_FILES)' ; \
258 for file in
$$files ; do \
259 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
260 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
261 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
263 files
='$(GUILE_COMPILED_FILES)' ; \
264 cd .
/$(GUILE_DIR
) ; \
265 for go in
$$files ; do \
266 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
267 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
268 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
278 .PHONY
: install-guile
280 files
='$(GUILE_FILES)' ; \
281 if
test "x$$files" != x
; then \
282 for file in
$$files ; do \
283 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
284 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
285 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
289 .PHONY
: uninstall-guile
291 files
='$(GUILE_FILES)' ; \
292 if
test "x$$files" != x
; then \
293 for file in
$$files ; do \
294 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
295 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
296 while
test "x$$file" != "x$$slashdir" ; do \
297 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
298 file
="$$slashdir" ; \
299 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
304 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
305 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
306 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
307 files
='$(SYSTEM_GDBINIT_FILES)' ; \
308 for file in
$$files ; do \
309 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
310 if
test -f
$$f ; then \
311 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
316 .PHONY
: clean-system-gdbinit
317 clean-system-gdbinit
:
318 rm -rf
$(SYSTEM_GDBINIT_DIR
)
319 rm -f stamp-system-gdbinit
321 .PHONY
: install-system-gdbinit
322 install-system-gdbinit
:
323 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
324 files
='$(SYSTEM_GDBINIT_FILES)' ; \
325 for file in
$$files; do \
326 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
327 if
test -f
$$f ; then \
328 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
332 .PHONY
: uninstall-system-gdbinit
333 uninstall-system-gdbinit
:
334 files
='$(SYSTEM_GDBINIT_FILES)' ; \
335 for file in
$$files ; do \
336 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
337 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
338 while
test "x$$file" != "x$$slashdir" ; do \
339 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
340 file
="$$slashdir" ; \
341 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
345 # Traditionally "install" depends on "all". But it may be useful
346 # not to; for example, if the user has made some trivial change to a
347 # source file and doesn't care about rebuilding or just wants to save the
348 # time it takes for make to check that all is up to date.
349 # install-only is intended to address that need.
352 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
355 install-only
: install-syscalls install-python install-guile \
356 install-system-gdbinit
359 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
360 uninstall-system-gdbinit
363 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
365 .PHONY
: maintainer-clean
realclean distclean
366 maintainer-clean
realclean distclean: clean
369 .PHONY
: check installcheck info dvi pdf html
370 .PHONY
: install-info install-pdf install-html clean-info
373 install-info install-pdf install-html
:
376 # GNU Make has an annoying habit of putting *all* the Makefile variables
377 # into the environment, unless you include this target as a circumvention.
378 # Rumor is that this will be fixed (and this target can be removed)
382 # GNU Make 3.63 has a different problem: it keeps tacking command line
383 # overrides onto the definition of $(MAKE). This variable setting
387 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
388 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile