Create subdir data-directory.
[binutils-gdb.git] / gdb / data-directory / Makefile.in
1 # Copyright (C) 2010 Free Software Foundation, Inc.
2
3 # Makefile for building a staged copy of the data-directory.
4 # This file is part of GDB.
5
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.
10 #
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.
15 #
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/>.
18
19 srcdir = @srcdir@
20 SYSCALLS_SRCDIR = $(srcdir)/../syscalls
21 PYTHON_SRCDIR = $(srcdir)/../python/lib
22 VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR)
23
24 top_srcdir = @top_srcdir@
25 top_builddir = @top_builddir@
26
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29
30 datarootdir = @datarootdir@
31 datadir = @datadir@
32
33 SHELL = @SHELL@
34
35 LN_S = @LN_S@
36
37 INSTALL = @INSTALL@
38 INSTALL_DATA = @INSTALL_DATA@
39 INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs
40
41 GDB_DATADIR = @GDB_DATADIR@
42
43 SYSCALLS_DIR = syscalls
44 SYSCALLS_INSTALL_DIR = $(DESTDIR)/$(GDB_DATADIR)/$(SYSCALLS_DIR)
45 SYSCALLS_FILES = \
46 gdb-syscalls.dtd \
47 ppc-linux.xml ppc64-linux.xml \
48 i386-linux.xml amd64-linux.xml \
49 sparc-linux.xml sparc64-linux.xml
50
51 PYTHON_DIR = python
52 PYTHON_INSTALL_DIR = $(DESTDIR)/$(GDB_DATADIR)/$(PYTHON_DIR)
53 PYTHON_FILES = \
54 gdb/__init__.py
55
56 # Host-dependent makefile fragment comes in here.
57 @host_makefile_frag@
58 # End of host-dependent makefile fragment
59
60 .PHONY: all
61 all: stamp-syscalls stamp-python
62
63 # For portability's sake, we need to handle systems that don't have
64 # symbolic links.
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) ; \
73 fi ; \
74 done
75 touch $@
76
77 .PHONY: clean-syscalls
78 clean-syscalls:
79 rm -rf $(SYSCALLS_DIR)
80 rm -f stamp-syscalls
81
82 # This target is responsible for properly installing the syscalls'
83 # XML files in the system.
84 .PHONY: install-syscalls
85 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) ; \
92 fi ; \
93 done
94
95 .PHONY: uninstall-syscalls
96 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,/[^/]*$$,,'` ; \
105 done \
106 done
107
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 ; \
115 done
116 touch $@
117
118 .PHONY: clean-python
119 clean-python:
120 rm -rf $(PYTHON_DIR)
121 rm -f stamp-python
122
123 .PHONY: install-python
124 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 ; \
130 done
131
132 .PHONY: uninstall-python
133 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,/[^/]*$$,,'` ; \
142 done \
143 done
144
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.
150 .PHONY: install
151 install: all
152 $(MAKE) install-only
153
154 .PHONY: install-only
155 install-only: install-syscalls install-python
156
157 .PHONY: uninstall
158 uninstall: uninstall-syscalls uninstall-python
159
160 .PHONY: clean
161 clean: clean-syscalls clean-python
162
163 .PHONY: maintainer-clean realclean distclean
164 maintainer-clean realclean distclean: clean
165 rm -f Makefile
166
167 .PHONY: check installcheck info dvi pdf html
168 .PHONY: install-info install-pdf install-html clean-info
169 check installcheck:
170 info dvi pdf html:
171 install-info install-pdf install-html:
172 clean-info:
173
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)
177 # in GNU Make 4.0.
178 .NOEXPORT:
179
180 # GNU Make 3.63 has a different problem: it keeps tacking command line
181 # overrides onto the definition of $(MAKE). This variable setting
182 # will remove them.
183 MAKEOVERRIDES=
184
185 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @frags@
186 cd $(top_builddir) && $(MAKE) data-directory/Makefile