1 # Copyright (C) 2010-2014 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
)
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 \
67 gdb
/command
/__init__.py \
68 gdb
/command
/xmethods.py \
69 gdb
/command
/frame_filters.py \
70 gdb
/command
/type_printers.py \
71 gdb
/command
/pretty_printers.py \
72 gdb
/command
/prompt.py \
73 gdb
/command
/explore.py \
74 gdb
/function
/__init__.py \
75 gdb
/function
/caller_is.py \
76 gdb
/function
/strfns.py \
77 gdb
/printer
/__init__.py \
78 gdb
/printer
/bound_registers.py
80 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
81 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
84 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
86 GUILE_SOURCE_FILES
= \
89 gdb
/experimental.scm \
96 GUILE_COMPILED_FILES
= \
104 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
105 @HAVE_GUILE_FALSE@GUILE_FILES
=
108 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
110 # Flags passed to 'guild compile'.
111 # Note: We can't use -Wunbound-variable because all the variables
112 # defined in C aren't visible when we compile.
113 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
114 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
115 # We still need to pass "-L ." so that other modules are found.
116 GUILD_COMPILE_FLAGS
= \
117 $(GUILD_TARGET_FLAG
) \
118 -Warity-mismatch
-Wformat
-Wunused-toplevel \
121 SYSTEM_GDBINIT_DIR
= system-gdbinit
122 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
123 SYSTEM_GDBINIT_FILES
= \
129 "exec_prefix=$(exec_prefix)" \
130 "infodir=$(infodir)" \
131 "datarootdir=$(datarootdir)" \
133 "htmldir=$(htmldir)" \
137 "datadir=$(datadir)" \
138 "includedir=$(includedir)" \
139 "against=$(against)" \
140 "DESTDIR=$(DESTDIR)" \
142 "AR_FLAGS=$(AR_FLAGS)" \
146 "CXXFLAGS=$(CXXFLAGS)" \
147 "DLLTOOL=$(DLLTOOL)" \
148 "LDFLAGS=$(LDFLAGS)" \
150 "MAKEINFO=$(MAKEINFO)" \
151 "MAKEHTML=$(MAKEHTML)" \
152 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
153 "INSTALL=$(INSTALL)" \
154 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
155 "INSTALL_DATA=$(INSTALL_DATA)" \
156 "RUNTEST=$(RUNTEST)" \
157 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
160 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
162 # For portability's sake, we need to handle systems that don't have
164 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
165 rm -rf .
/$(SYSCALLS_DIR
)
166 mkdir .
/$(SYSCALLS_DIR
)
167 files
='$(SYSCALLS_FILES)' ; \
168 for file in
$$files ; do \
169 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
170 if
test -f
$$f ; then \
171 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
176 .PHONY
: clean-syscalls
178 rm -rf
$(SYSCALLS_DIR
)
181 # This target is responsible for properly installing the syscalls'
182 # XML files in the system.
183 .PHONY
: install-syscalls
185 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_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_INSTALL_DIR
) ; \
194 .PHONY
: uninstall-syscalls
196 files
='$(SYSCALLS_FILES)' ; \
197 for file in
$$files ; do \
198 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
199 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
200 while
test "x$$file" != "x$$slashdir" ; do \
201 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
202 file
="$$slashdir" ; \
203 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
207 stamp-python
: Makefile
$(PYTHON_FILES
)
208 rm -rf .
/$(PYTHON_DIR
)
209 files
='$(PYTHON_FILES)' ; \
210 if
test "x$$files" != x
; then \
211 for file in
$$files ; do \
212 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
213 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
214 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
224 .PHONY
: install-python
226 files
='$(PYTHON_FILES)' ; \
227 if
test "x$$files" != x
; then \
228 for file in
$$files ; do \
229 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
230 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
231 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
235 .PHONY
: uninstall-python
237 files
='$(PYTHON_FILES)' ; \
238 if
test "x$$files" != x
; then \
239 for file in
$$files ; do \
240 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
241 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
242 while
test "x$$file" != "x$$slashdir" ; do \
243 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
244 file
="$$slashdir" ; \
245 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
250 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
251 rm -rf .
/$(GUILE_DIR
)
252 if
test "x$(GUILE_FILES)" != x
; then \
253 files
='$(GUILE_SOURCE_FILES)' ; \
254 for file in
$$files ; do \
255 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
256 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
257 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
259 files
='$(GUILE_COMPILED_FILES)' ; \
260 cd .
/$(GUILE_DIR
) ; \
261 for go in
$$files ; do \
262 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
263 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
264 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
274 .PHONY
: install-guile
276 files
='$(GUILE_FILES)' ; \
277 if
test "x$$files" != x
; then \
278 for file in
$$files ; do \
279 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
280 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
281 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
285 .PHONY
: uninstall-guile
287 files
='$(GUILE_FILES)' ; \
288 if
test "x$$files" != x
; then \
289 for file in
$$files ; do \
290 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
291 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
292 while
test "x$$file" != "x$$slashdir" ; do \
293 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
294 file
="$$slashdir" ; \
295 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
300 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
301 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
302 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
303 files
='$(SYSTEM_GDBINIT_FILES)' ; \
304 for file in
$$files ; do \
305 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
306 if
test -f
$$f ; then \
307 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
312 .PHONY
: clean-system-gdbinit
313 clean-system-gdbinit
:
314 rm -rf
$(SYSTEM_GDBINIT_DIR
)
315 rm -f stamp-system-gdbinit
317 .PHONY
: install-system-gdbinit
318 install-system-gdbinit
:
319 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
320 files
='$(SYSTEM_GDBINIT_FILES)' ; \
321 for file in
$$files; do \
322 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
323 if
test -f
$$f ; then \
324 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
328 .PHONY
: uninstall-system-gdbinit
329 uninstall-system-gdbinit
:
330 files
='$(SYSTEM_GDBINIT_FILES)' ; \
331 for file in
$$files ; do \
332 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
333 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
334 while
test "x$$file" != "x$$slashdir" ; do \
335 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
336 file
="$$slashdir" ; \
337 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
341 # Traditionally "install" depends on "all". But it may be useful
342 # not to; for example, if the user has made some trivial change to a
343 # source file and doesn't care about rebuilding or just wants to save the
344 # time it takes for make to check that all is up to date.
345 # install-only is intended to address that need.
348 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
351 install-only
: install-syscalls install-python install-guile \
352 install-system-gdbinit
355 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
356 uninstall-system-gdbinit
359 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
361 .PHONY
: maintainer-clean
realclean distclean
362 maintainer-clean
realclean distclean: clean
365 .PHONY
: check installcheck info dvi pdf html
366 .PHONY
: install-info install-pdf install-html clean-info
369 install-info install-pdf install-html
:
372 # GNU Make has an annoying habit of putting *all* the Makefile variables
373 # into the environment, unless you include this target as a circumvention.
374 # Rumor is that this will be fixed (and this target can be removed)
378 # GNU Make 3.63 has a different problem: it keeps tacking command line
379 # overrides onto the definition of $(MAKE). This variable setting
383 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
384 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile