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 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
)
49 ppc-linux.xml ppc64-linux.xml \
50 i386-linux.xml amd64-linux.xml \
51 sparc-linux.xml sparc64-linux.xml \
52 mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
53 s390-linux.xml s390x-linux.xml
56 PYTHON_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(PYTHON_DIR
)
60 gdb
/FrameIterator.py \
61 gdb
/FrameDecorator.py \
65 gdb
/command
/bound_registers.py \
66 gdb
/command
/__init__.py \
67 gdb
/command
/frame_filters.py \
68 gdb
/command
/type_printers.py \
69 gdb
/command
/pretty_printers.py \
70 gdb
/command
/prompt.py \
71 gdb
/command
/explore.py \
72 gdb
/function
/__init__.py \
73 gdb
/function
/strfns.py
75 SYSTEM_GDBINIT_DIR
= system-gdbinit
76 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
77 SYSTEM_GDBINIT_FILES
= \
83 "exec_prefix=$(exec_prefix)" \
84 "infodir=$(infodir)" \
85 "datarootdir=$(datarootdir)" \
87 "htmldir=$(htmldir)" \
91 "datadir=$(datadir)" \
92 "includedir=$(includedir)" \
93 "against=$(against)" \
94 "DESTDIR=$(DESTDIR)" \
96 "AR_FLAGS=$(AR_FLAGS)" \
100 "CXXFLAGS=$(CXXFLAGS)" \
101 "DLLTOOL=$(DLLTOOL)" \
102 "LDFLAGS=$(LDFLAGS)" \
104 "MAKEINFO=$(MAKEINFO)" \
105 "MAKEHTML=$(MAKEHTML)" \
106 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
107 "INSTALL=$(INSTALL)" \
108 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
109 "INSTALL_DATA=$(INSTALL_DATA)" \
110 "RUNTEST=$(RUNTEST)" \
111 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
114 all: stamp-syscalls stamp-python stamp-system-gdbinit
116 # For portability's sake, we need to handle systems that don't have
118 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
119 rm -rf .
/$(SYSCALLS_DIR
)
120 mkdir .
/$(SYSCALLS_DIR
)
121 files
='$(SYSCALLS_FILES)' ; \
122 for file in
$$files ; do \
123 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
124 if
test -f
$$f ; then \
125 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
130 .PHONY
: clean-syscalls
132 rm -rf
$(SYSCALLS_DIR
)
135 # This target is responsible for properly installing the syscalls'
136 # XML files in the system.
137 .PHONY
: install-syscalls
139 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
140 files
='$(SYSCALLS_FILES)' ; \
141 for file in
$$files; do \
142 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
143 if
test -f
$$f ; then \
144 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
148 .PHONY
: uninstall-syscalls
150 files
='$(SYSCALLS_FILES)' ; \
151 for file in
$$files ; do \
152 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
153 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
154 while
test "x$$file" != "x$$slashdir" ; do \
155 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
156 file
="$$slashdir" ; \
157 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
161 stamp-python
: Makefile
$(PYTHON_FILES
)
162 rm -rf .
/$(PYTHON_DIR
)
163 files
='$(PYTHON_FILES)' ; \
164 for file in
$$files ; do \
165 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
166 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
167 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
176 .PHONY
: install-python
178 files
='$(PYTHON_FILES)' ; \
179 for file in
$$files ; do \
180 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
181 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
182 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
185 .PHONY
: uninstall-python
187 files
='$(PYTHON_FILES)' ; \
188 for file in
$$files ; do \
189 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
190 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
191 while
test "x$$file" != "x$$slashdir" ; do \
192 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
193 file
="$$slashdir" ; \
194 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
198 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
199 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
200 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
201 files
='$(SYSTEM_GDBINIT_FILES)' ; \
202 for file in
$$files ; do \
203 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
204 if
test -f
$$f ; then \
205 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
210 .PHONY
: clean-system-gdbinit
211 clean-system-gdbinit
:
212 rm -rf
$(SYSTEM_GDBINIT_DIR
)
213 rm -f stamp-system-gdbinit
215 .PHONY
: install-system-gdbinit
216 install-system-gdbinit
:
217 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
218 files
='$(SYSTEM_GDBINIT_FILES)' ; \
219 for file in
$$files; do \
220 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
221 if
test -f
$$f ; then \
222 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
226 .PHONY
: uninstall-system-gdbinit
227 uninstall-system-gdbinit
:
228 files
='$(SYSTEM_GDBINIT_FILES)' ; \
229 for file in
$$files ; do \
230 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
231 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
232 while
test "x$$file" != "x$$slashdir" ; do \
233 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
234 file
="$$slashdir" ; \
235 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
239 # Traditionally "install" depends on "all". But it may be useful
240 # not to; for example, if the user has made some trivial change to a
241 # source file and doesn't care about rebuilding or just wants to save the
242 # time it takes for make to check that all is up to date.
243 # install-only is intended to address that need.
246 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
249 install-only
: install-syscalls install-python install-system-gdbinit
252 uninstall: uninstall-syscalls uninstall-python uninstall-system-gdbinit
255 clean: clean-syscalls clean-python clean-system-gdbinit
257 .PHONY
: maintainer-clean
realclean distclean
258 maintainer-clean
realclean distclean: clean
261 .PHONY
: check installcheck info dvi pdf html
262 .PHONY
: install-info install-pdf install-html clean-info
265 install-info install-pdf install-html
:
268 # GNU Make has an annoying habit of putting *all* the Makefile variables
269 # into the environment, unless you include this target as a circumvention.
270 # Rumor is that this will be fixed (and this target can be removed)
274 # GNU Make 3.63 has a different problem: it keeps tacking command line
275 # overrides onto the definition of $(MAKE). This variable setting
279 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
280 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile