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
/bound_registers.py \
68 gdb
/command
/__init__.py \
69 gdb
/command
/xmethods.py \
70 gdb
/command
/frame_filters.py \
71 gdb
/command
/type_printers.py \
72 gdb
/command
/pretty_printers.py \
73 gdb
/command
/prompt.py \
74 gdb
/command
/explore.py \
75 gdb
/function
/__init__.py \
76 gdb
/function
/strfns.py
78 @HAVE_PYTHON_TRUE@PYTHON_FILES
= $(PYTHON_FILE_LIST
)
79 @HAVE_PYTHON_FALSE@PYTHON_FILES
=
82 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
84 GUILE_SOURCE_FILES
= \
87 gdb
/experimental.scm \
94 GUILE_COMPILED_FILES
= \
102 @HAVE_GUILE_TRUE@GUILE_FILES
= $(GUILE_SOURCE_FILES
) $(GUILE_COMPILED_FILES
)
103 @HAVE_GUILE_FALSE@GUILE_FILES
=
106 GUILD_TARGET_FLAG
= @GUILD_TARGET_FLAG@
108 # Flags passed to 'guild compile'.
109 # Note: We can't use -Wunbound-variable because all the variables
110 # defined in C aren't visible when we compile.
111 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
112 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
113 # We still need to pass "-L ." so that other modules are found.
114 GUILD_COMPILE_FLAGS
= \
115 $(GUILD_TARGET_FLAG
) \
116 -Warity-mismatch
-Wformat
-Wunused-toplevel \
119 SYSTEM_GDBINIT_DIR
= system-gdbinit
120 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
121 SYSTEM_GDBINIT_FILES
= \
127 "exec_prefix=$(exec_prefix)" \
128 "infodir=$(infodir)" \
129 "datarootdir=$(datarootdir)" \
131 "htmldir=$(htmldir)" \
135 "datadir=$(datadir)" \
136 "includedir=$(includedir)" \
137 "against=$(against)" \
138 "DESTDIR=$(DESTDIR)" \
140 "AR_FLAGS=$(AR_FLAGS)" \
144 "CXXFLAGS=$(CXXFLAGS)" \
145 "DLLTOOL=$(DLLTOOL)" \
146 "LDFLAGS=$(LDFLAGS)" \
148 "MAKEINFO=$(MAKEINFO)" \
149 "MAKEHTML=$(MAKEHTML)" \
150 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
151 "INSTALL=$(INSTALL)" \
152 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
153 "INSTALL_DATA=$(INSTALL_DATA)" \
154 "RUNTEST=$(RUNTEST)" \
155 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
158 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
160 # For portability's sake, we need to handle systems that don't have
162 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
163 rm -rf .
/$(SYSCALLS_DIR
)
164 mkdir .
/$(SYSCALLS_DIR
)
165 files
='$(SYSCALLS_FILES)' ; \
166 for file in
$$files ; do \
167 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
168 if
test -f
$$f ; then \
169 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
174 .PHONY
: clean-syscalls
176 rm -rf
$(SYSCALLS_DIR
)
179 # This target is responsible for properly installing the syscalls'
180 # XML files in the system.
181 .PHONY
: install-syscalls
183 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
184 files
='$(SYSCALLS_FILES)' ; \
185 for file in
$$files; do \
186 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
187 if
test -f
$$f ; then \
188 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
192 .PHONY
: uninstall-syscalls
194 files
='$(SYSCALLS_FILES)' ; \
195 for file in
$$files ; do \
196 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
197 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
198 while
test "x$$file" != "x$$slashdir" ; do \
199 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
200 file
="$$slashdir" ; \
201 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
205 stamp-python
: Makefile
$(PYTHON_FILES
)
206 rm -rf .
/$(PYTHON_DIR
)
207 files
='$(PYTHON_FILES)' ; \
208 if
test "x$$files" != x
; then \
209 for file in
$$files ; do \
210 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
211 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
212 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
222 .PHONY
: install-python
224 files
='$(PYTHON_FILES)' ; \
225 if
test "x$$files" != x
; then \
226 for file in
$$files ; do \
227 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
228 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
229 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
233 .PHONY
: uninstall-python
235 files
='$(PYTHON_FILES)' ; \
236 if
test "x$$files" != x
; then \
237 for file in
$$files ; do \
238 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
239 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
240 while
test "x$$file" != "x$$slashdir" ; do \
241 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
242 file
="$$slashdir" ; \
243 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
248 stamp-guile
: Makefile
$(GUILE_SOURCE_FILES
)
249 rm -rf .
/$(GUILE_DIR
)
250 if
test "x$(GUILE_FILES)" != x
; then \
251 files
='$(GUILE_SOURCE_FILES)' ; \
252 for file in
$$files ; do \
253 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
254 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
255 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
257 files
='$(GUILE_COMPILED_FILES)' ; \
258 cd .
/$(GUILE_DIR
) ; \
259 for go in
$$files ; do \
260 source
="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
261 echo
$(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" ; \
262 $(GUILD
) compile
$(GUILD_COMPILE_FLAGS
) -o
"$$go" "$$source" || exit
1 ; \
272 .PHONY
: install-guile
274 files
='$(GUILE_FILES)' ; \
275 if
test "x$$files" != x
; then \
276 for file in
$$files ; do \
277 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
278 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
279 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
283 .PHONY
: uninstall-guile
285 files
='$(GUILE_FILES)' ; \
286 if
test "x$$files" != x
; then \
287 for file in
$$files ; do \
288 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
289 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
290 while
test "x$$file" != "x$$slashdir" ; do \
291 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
292 file
="$$slashdir" ; \
293 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
298 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
299 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
300 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
301 files
='$(SYSTEM_GDBINIT_FILES)' ; \
302 for file in
$$files ; do \
303 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
304 if
test -f
$$f ; then \
305 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
310 .PHONY
: clean-system-gdbinit
311 clean-system-gdbinit
:
312 rm -rf
$(SYSTEM_GDBINIT_DIR
)
313 rm -f stamp-system-gdbinit
315 .PHONY
: install-system-gdbinit
316 install-system-gdbinit
:
317 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
318 files
='$(SYSTEM_GDBINIT_FILES)' ; \
319 for file in
$$files; do \
320 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
321 if
test -f
$$f ; then \
322 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
326 .PHONY
: uninstall-system-gdbinit
327 uninstall-system-gdbinit
:
328 files
='$(SYSTEM_GDBINIT_FILES)' ; \
329 for file in
$$files ; do \
330 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
331 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
332 while
test "x$$file" != "x$$slashdir" ; do \
333 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
334 file
="$$slashdir" ; \
335 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
339 # Traditionally "install" depends on "all". But it may be useful
340 # not to; for example, if the user has made some trivial change to a
341 # source file and doesn't care about rebuilding or just wants to save the
342 # time it takes for make to check that all is up to date.
343 # install-only is intended to address that need.
346 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
349 install-only
: install-syscalls install-python install-guile \
350 install-system-gdbinit
353 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
354 uninstall-system-gdbinit
357 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
359 .PHONY
: maintainer-clean
realclean distclean
360 maintainer-clean
realclean distclean: clean
363 .PHONY
: check installcheck info dvi pdf html
364 .PHONY
: install-info install-pdf install-html clean-info
367 install-info install-pdf install-html
:
370 # GNU Make has an annoying habit of putting *all* the Makefile variables
371 # into the environment, unless you include this target as a circumvention.
372 # Rumor is that this will be fixed (and this target can be removed)
376 # GNU Make 3.63 has a different problem: it keeps tacking command line
377 # overrides onto the definition of $(MAKE). This variable setting
381 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
382 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile