1 # Copyright (C) 2010-2013 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 SYSTEM_GDBINIT_SRCDIR
= $(srcdir)/..
/system-gdbinit
23 VPATH
= $(srcdir):$(SYSCALLS_SRCDIR
):$(PYTHON_SRCDIR
):$(SYSTEM_GDBINIT_SRCDIR
)
25 top_srcdir
= @top_srcdir@
26 top_builddir
= @top_builddir@
29 exec_prefix = @
exec_prefix@
31 datarootdir
= @datarootdir@
39 INSTALL_DATA
= @INSTALL_DATA@
40 INSTALL_DIR
= $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
42 GDB_DATADIR
= @GDB_DATADIR@
44 SYSCALLS_DIR
= syscalls
45 SYSCALLS_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSCALLS_DIR
)
48 ppc-linux.xml ppc64-linux.xml \
49 i386-linux.xml amd64-linux.xml \
50 sparc-linux.xml sparc64-linux.xml \
51 mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml
54 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
58 gdb
/FrameIterator.py \
59 gdb
/FrameDecorator.py \
63 gdb
/command
/__init__.py \
64 gdb
/command
/frame_filters.py \
65 gdb
/command
/type_printers.py \
66 gdb
/command
/pretty_printers.py \
67 gdb
/command
/prompt.py \
68 gdb
/command
/explore.py \
69 gdb
/function
/__init__.py \
70 gdb
/function
/strfns.py
72 SYSTEM_GDBINIT_DIR
= system-gdbinit
73 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
74 SYSTEM_GDBINIT_FILES
= \
80 "exec_prefix=$(exec_prefix)" \
81 "infodir=$(infodir)" \
82 "datarootdir=$(datarootdir)" \
84 "htmldir=$(htmldir)" \
88 "datadir=$(datadir)" \
89 "includedir=$(includedir)" \
90 "against=$(against)" \
91 "DESTDIR=$(DESTDIR)" \
93 "AR_FLAGS=$(AR_FLAGS)" \
97 "CXXFLAGS=$(CXXFLAGS)" \
98 "DLLTOOL=$(DLLTOOL)" \
99 "LDFLAGS=$(LDFLAGS)" \
101 "MAKEINFO=$(MAKEINFO)" \
102 "MAKEHTML=$(MAKEHTML)" \
103 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
104 "INSTALL=$(INSTALL)" \
105 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
106 "INSTALL_DATA=$(INSTALL_DATA)" \
107 "RUNTEST=$(RUNTEST)" \
108 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
111 all: stamp-syscalls stamp-python stamp-system-gdbinit
113 # For portability's sake, we need to handle systems that don't have
115 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
116 rm -rf .
/$(SYSCALLS_DIR
)
117 mkdir .
/$(SYSCALLS_DIR
)
118 files
='$(SYSCALLS_FILES)' ; \
119 for file in
$$files ; do \
120 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
121 if
test -f
$$f ; then \
122 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
127 .PHONY
: clean-syscalls
129 rm -rf
$(SYSCALLS_DIR
)
132 # This target is responsible for properly installing the syscalls'
133 # XML files in the system.
134 .PHONY
: install-syscalls
136 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
137 files
='$(SYSCALLS_FILES)' ; \
138 for file in
$$files; do \
139 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
140 if
test -f
$$f ; then \
141 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
145 .PHONY
: uninstall-syscalls
147 files
='$(SYSCALLS_FILES)' ; \
148 for file in
$$files ; do \
149 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
150 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
151 while
test "x$$file" != "x$$slashdir" ; do \
152 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
153 file
="$$slashdir" ; \
154 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
158 stamp-python
: Makefile
$(PYTHON_FILES
)
159 rm -rf .
/$(PYTHON_DIR
)
160 files
='$(PYTHON_FILES)' ; \
161 for file in
$$files ; do \
162 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
163 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
164 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
173 .PHONY
: install-python
175 files
='$(PYTHON_FILES)' ; \
176 for file in
$$files ; do \
177 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
178 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
179 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
182 .PHONY
: uninstall-python
184 files
='$(PYTHON_FILES)' ; \
185 for file in
$$files ; do \
186 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
187 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
188 while
test "x$$file" != "x$$slashdir" ; do \
189 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
190 file
="$$slashdir" ; \
191 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
195 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
196 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
197 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
198 files
='$(SYSTEM_GDBINIT_FILES)' ; \
199 for file in
$$files ; do \
200 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
201 if
test -f
$$f ; then \
202 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
207 .PHONY
: clean-system-gdbinit
208 clean-system-gdbinit
:
209 rm -rf
$(SYSTEM_GDBINIT_DIR
)
210 rm -f stamp-system-gdbinit
212 .PHONY
: install-system-gdbinit
213 install-system-gdbinit
:
214 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
215 files
='$(SYSTEM_GDBINIT_FILES)' ; \
216 for file in
$$files; do \
217 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
218 if
test -f
$$f ; then \
219 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
223 .PHONY
: uninstall-system-gdbinit
224 uninstall-system-gdbinit
:
225 files
='$(SYSTEM_GDBINIT_FILES)' ; \
226 for file in
$$files ; do \
227 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
228 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
229 while
test "x$$file" != "x$$slashdir" ; do \
230 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
231 file
="$$slashdir" ; \
232 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
236 # Traditionally "install" depends on "all". But it may be useful
237 # not to; for example, if the user has made some trivial change to a
238 # source file and doesn't care about rebuilding or just wants to save the
239 # time it takes for make to check that all is up to date.
240 # install-only is intended to address that need.
243 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
246 install-only
: install-syscalls install-python install-system-gdbinit
249 uninstall: uninstall-syscalls uninstall-python uninstall-system-gdbinit
252 clean: clean-syscalls clean-python clean-system-gdbinit
254 .PHONY
: maintainer-clean
realclean distclean
255 maintainer-clean
realclean distclean: clean
258 .PHONY
: check installcheck info dvi pdf html
259 .PHONY
: install-info install-pdf install-html clean-info
262 install-info install-pdf install-html
:
265 # GNU Make has an annoying habit of putting *all* the Makefile variables
266 # into the environment, unless you include this target as a circumvention.
267 # Rumor is that this will be fixed (and this target can be removed)
271 # GNU Make 3.63 has a different problem: it keeps tacking command line
272 # overrides onto the definition of $(MAKE). This variable setting
276 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
277 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile