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 \
66 gdb
/command
/bound_registers.py \
67 gdb
/command
/__init__.py \
68 gdb
/command
/frame_filters.py \
69 gdb
/command
/type_printers.py \
70 gdb
/command
/pretty_printers.py \
71 gdb
/command
/prompt.py \
72 gdb
/command
/explore.py \
73 gdb
/function
/__init__.py \
74 gdb
/function
/strfns.py
77 GUILE_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(GUILE_DIR
)
81 gdb
/experimental.scm \
87 SYSTEM_GDBINIT_DIR
= system-gdbinit
88 SYSTEM_GDBINIT_INSTALL_DIR
= $(DESTDIR
)$(GDB_DATADIR
)/$(SYSTEM_GDBINIT_DIR
)
89 SYSTEM_GDBINIT_FILES
= \
95 "exec_prefix=$(exec_prefix)" \
96 "infodir=$(infodir)" \
97 "datarootdir=$(datarootdir)" \
99 "htmldir=$(htmldir)" \
103 "datadir=$(datadir)" \
104 "includedir=$(includedir)" \
105 "against=$(against)" \
106 "DESTDIR=$(DESTDIR)" \
108 "AR_FLAGS=$(AR_FLAGS)" \
112 "CXXFLAGS=$(CXXFLAGS)" \
113 "DLLTOOL=$(DLLTOOL)" \
114 "LDFLAGS=$(LDFLAGS)" \
116 "MAKEINFO=$(MAKEINFO)" \
117 "MAKEHTML=$(MAKEHTML)" \
118 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
119 "INSTALL=$(INSTALL)" \
120 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
121 "INSTALL_DATA=$(INSTALL_DATA)" \
122 "RUNTEST=$(RUNTEST)" \
123 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
126 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
128 # For portability's sake, we need to handle systems that don't have
130 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
131 rm -rf .
/$(SYSCALLS_DIR
)
132 mkdir .
/$(SYSCALLS_DIR
)
133 files
='$(SYSCALLS_FILES)' ; \
134 for file in
$$files ; do \
135 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
136 if
test -f
$$f ; then \
137 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
142 .PHONY
: clean-syscalls
144 rm -rf
$(SYSCALLS_DIR
)
147 # This target is responsible for properly installing the syscalls'
148 # XML files in the system.
149 .PHONY
: install-syscalls
151 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
152 files
='$(SYSCALLS_FILES)' ; \
153 for file in
$$files; do \
154 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
155 if
test -f
$$f ; then \
156 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
160 .PHONY
: uninstall-syscalls
162 files
='$(SYSCALLS_FILES)' ; \
163 for file in
$$files ; do \
164 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
165 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
166 while
test "x$$file" != "x$$slashdir" ; do \
167 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
168 file
="$$slashdir" ; \
169 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
173 stamp-python
: Makefile
$(PYTHON_FILES
)
174 rm -rf .
/$(PYTHON_DIR
)
175 files
='$(PYTHON_FILES)' ; \
176 for file in
$$files ; do \
177 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
178 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
179 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
188 .PHONY
: install-python
190 files
='$(PYTHON_FILES)' ; \
191 for file in
$$files ; do \
192 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
193 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
194 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
197 .PHONY
: uninstall-python
199 files
='$(PYTHON_FILES)' ; \
200 for file in
$$files ; do \
201 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
202 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
203 while
test "x$$file" != "x$$slashdir" ; do \
204 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
205 file
="$$slashdir" ; \
206 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
210 stamp-guile
: Makefile
$(GUILE_FILES
)
211 rm -rf .
/$(GUILE_DIR
)
212 files
='$(GUILE_FILES)' ; \
213 for file in
$$files ; do \
214 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
215 $(INSTALL_DIR
) .
/$(GUILE_DIR
)/$$dir ; \
216 $(INSTALL_DATA
) $(GUILE_SRCDIR
)/$$file .
/$(GUILE_DIR
)/$$dir ; \
225 .PHONY
: install-guile
227 files
='$(GUILE_FILES)' ; \
228 for file in
$$files ; do \
229 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
230 $(INSTALL_DIR
) $(GUILE_INSTALL_DIR
)/$$dir ; \
231 $(INSTALL_DATA
) .
/$(GUILE_DIR
)/$$file $(GUILE_INSTALL_DIR
)/$$dir ; \
234 .PHONY
: uninstall-guile
236 files
='$(GUILE_FILES)' ; \
237 for file in
$$files ; do \
238 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
239 rm -f
$(GUILE_INSTALL_DIR
)/$$file ; \
240 while
test "x$$file" != "x$$slashdir" ; do \
241 rmdir
2>/dev
/null
"$(GUILE_INSTALL_DIR)$$slashdir" ; \
242 file
="$$slashdir" ; \
243 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
247 stamp-system-gdbinit
: Makefile
$(SYSTEM_GDBINIT_FILES
)
248 rm -rf .
/$(SYSTEM_GDBINIT_DIR
)
249 mkdir .
/$(SYSTEM_GDBINIT_DIR
)
250 files
='$(SYSTEM_GDBINIT_FILES)' ; \
251 for file in
$$files ; do \
252 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
253 if
test -f
$$f ; then \
254 $(INSTALL_DATA
) $$f .
/$(SYSTEM_GDBINIT_DIR
) ; \
259 .PHONY
: clean-system-gdbinit
260 clean-system-gdbinit
:
261 rm -rf
$(SYSTEM_GDBINIT_DIR
)
262 rm -f stamp-system-gdbinit
264 .PHONY
: install-system-gdbinit
265 install-system-gdbinit
:
266 $(INSTALL_DIR
) $(SYSTEM_GDBINIT_INSTALL_DIR
)
267 files
='$(SYSTEM_GDBINIT_FILES)' ; \
268 for file in
$$files; do \
269 f
=$(SYSTEM_GDBINIT_SRCDIR
)/$$file ; \
270 if
test -f
$$f ; then \
271 $(INSTALL_DATA
) $$f $(SYSTEM_GDBINIT_INSTALL_DIR
) ; \
275 .PHONY
: uninstall-system-gdbinit
276 uninstall-system-gdbinit
:
277 files
='$(SYSTEM_GDBINIT_FILES)' ; \
278 for file in
$$files ; do \
279 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
280 rm -f
$(SYSTEM_GDBINIT_INSTALL_DIR
)/$$file ; \
281 while
test "x$$file" != "x$$slashdir" ; do \
282 rmdir
2>/dev
/null
"$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
283 file
="$$slashdir" ; \
284 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
288 # Traditionally "install" depends on "all". But it may be useful
289 # not to; for example, if the user has made some trivial change to a
290 # source file and doesn't care about rebuilding or just wants to save the
291 # time it takes for make to check that all is up to date.
292 # install-only is intended to address that need.
295 @
$(MAKE
) $(FLAGS_TO_PASS
) install-only
298 install-only
: install-syscalls install-python install-guile \
299 install-system-gdbinit
302 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
303 uninstall-system-gdbinit
306 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
308 .PHONY
: maintainer-clean
realclean distclean
309 maintainer-clean
realclean distclean: clean
312 .PHONY
: check installcheck info dvi pdf html
313 .PHONY
: install-info install-pdf install-html clean-info
316 install-info install-pdf install-html
:
319 # GNU Make has an annoying habit of putting *all* the Makefile variables
320 # into the environment, unless you include this target as a circumvention.
321 # Rumor is that this will be fixed (and this target can be removed)
325 # GNU Make 3.63 has a different problem: it keeps tacking command line
326 # overrides onto the definition of $(MAKE). This variable setting
330 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
331 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile