1 # Copyright (C) 2010 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 VPATH
= $(srcdir):$(SYSCALLS_SRCDIR
):$(PYTHON_SRCDIR
)
24 top_srcdir
= @top_srcdir@
25 top_builddir
= @top_builddir@
28 exec_prefix = @
exec_prefix@
30 datarootdir
= @datarootdir@
38 INSTALL_DATA
= @INSTALL_DATA@
39 INSTALL_DIR
= $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
41 GDB_DATADIR
= @GDB_DATADIR@
43 SYSCALLS_DIR
= syscalls
44 SYSCALLS_INSTALL_DIR
= $(DESTDIR
)/$(GDB_DATADIR
)/$(SYSCALLS_DIR
)
47 ppc-linux.xml ppc64-linux.xml \
48 i386-linux.xml amd64-linux.xml \
49 sparc-linux.xml sparc64-linux.xml
52 PYTHON_INSTALL_DIR
= $(DESTDIR
)/$(GDB_DATADIR
)/$(PYTHON_DIR
)
56 # Host-dependent makefile fragment comes in here.
58 # End of host-dependent makefile fragment
61 all: stamp-syscalls stamp-python
63 # For portability's sake, we need to handle systems that don't have
65 stamp-syscalls
: Makefile
$(SYSCALLS_FILES
)
66 rm -rf .
/$(SYSCALLS_DIR
)
67 mkdir .
/$(SYSCALLS_DIR
)
68 files
='$(SYSCALLS_FILES)' ; \
69 for file in
$$files ; do \
70 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
71 if
test -f
$$f ; then \
72 $(INSTALL_DATA
) $$f .
/$(SYSCALLS_DIR
) ; \
77 .PHONY
: clean-syscalls
79 rm -rf
$(SYSCALLS_DIR
)
82 # This target is responsible for properly installing the syscalls'
83 # XML files in the system.
84 .PHONY
: install-syscalls
86 $(INSTALL_DIR
) $(SYSCALLS_INSTALL_DIR
)
87 files
='$(SYSCALLS_FILES)' ; \
88 for file in
$$files; do \
89 f
=$(SYSCALLS_SRCDIR
)/$$file ; \
90 if
test -f
$$f ; then \
91 $(INSTALL_DATA
) $$f $(SYSCALLS_INSTALL_DIR
) ; \
95 .PHONY
: uninstall-syscalls
97 files
='$(SYSCALLS_FILES)' ; \
98 for file in
$$files ; do \
99 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
100 rm -f
$(SYSCALLS_INSTALL_DIR
)/$$file ; \
101 while
test "x$$file" != "x$$slashdir" ; do \
102 rmdir
2>/dev
/null
"$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
103 file
="$$slashdir" ; \
104 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
108 stamp-python
: Makefile
$(PYTHON_FILES
)
109 rm -rf .
/$(PYTHON_DIR
)
110 files
='$(PYTHON_FILES)' ; \
111 for file in
$$files ; do \
112 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
113 $(INSTALL_DIR
) .
/$(PYTHON_DIR
)/$$dir ; \
114 $(INSTALL_DATA
) $(PYTHON_SRCDIR
)/$$file .
/$(PYTHON_DIR
)/$$dir ; \
123 .PHONY
: install-python
125 files
='$(PYTHON_FILES)' ; \
126 for file in
$$files ; do \
127 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
128 $(INSTALL_DIR
) $(PYTHON_INSTALL_DIR
)/$$dir ; \
129 $(INSTALL_DATA
) .
/$(PYTHON_DIR
)/$$file $(PYTHON_INSTALL_DIR
)/$$dir ; \
132 .PHONY
: uninstall-python
134 files
='$(PYTHON_FILES)' ; \
135 for file in
$$files ; do \
136 slashdir
=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
137 rm -f
$(PYTHON_INSTALL_DIR
)/$$file ; \
138 while
test "x$$file" != "x$$slashdir" ; do \
139 rmdir
2>/dev
/null
"$(PYTHON_INSTALL_DIR)$$slashdir" ; \
140 file
="$$slashdir" ; \
141 slashdir
=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
145 # Traditionally "install" depends on "all". But it may be useful
146 # not to; for example, if the user has made some trivial change to a
147 # source file and doesn't care about rebuilding or just wants to save the
148 # time it takes for make to check that all is up to date.
149 # install-only is intended to address that need.
155 install-only
: install-syscalls install-python
158 uninstall: uninstall-syscalls uninstall-python
161 clean: clean-syscalls clean-python
163 .PHONY
: maintainer-clean
realclean distclean
164 maintainer-clean
realclean distclean: clean
167 .PHONY
: check installcheck info dvi pdf html
168 .PHONY
: install-info install-pdf install-html clean-info
171 install-info install-pdf install-html
:
174 # GNU Make has an annoying habit of putting *all* the Makefile variables
175 # into the environment, unless you include this target as a circumvention.
176 # Rumor is that this will be fixed (and this target can be removed)
180 # GNU Make 3.63 has a different problem: it keeps tacking command line
181 # overrides onto the definition of $(MAKE). This variable setting
185 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status @frags@
186 cd
$(top_builddir
) && $(MAKE
) data-directory
/Makefile