gdb/ChangeLog:
[binutils-gdb.git] / gdb / data-directory / Makefile.in
1 # Copyright (C) 2010-2014 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 SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit
23 VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR)
24
25 top_srcdir = @top_srcdir@
26 top_builddir = @top_builddir@
27
28 prefix = @prefix@
29 exec_prefix = @exec_prefix@
30
31 datarootdir = @datarootdir@
32 datadir = @datadir@
33
34 SHELL = @SHELL@
35
36 LN_S = @LN_S@
37
38 INSTALL = @INSTALL@
39 INSTALL_DATA = @INSTALL_DATA@
40 INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs
41
42 GDB_DATADIR = @GDB_DATADIR@
43
44 SYSCALLS_DIR = syscalls
45 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
46 SYSCALLS_FILES = \
47 gdb-syscalls.dtd \
48 arm-linux.xml \
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
54
55 PYTHON_DIR = python
56 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
57 PYTHON_FILES = \
58 gdb/__init__.py \
59 gdb/frames.py \
60 gdb/FrameIterator.py \
61 gdb/FrameDecorator.py \
62 gdb/types.py \
63 gdb/printing.py \
64 gdb/prompt.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
74
75 SYSTEM_GDBINIT_DIR = system-gdbinit
76 SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR)
77 SYSTEM_GDBINIT_FILES = \
78 elinos.py \
79 wrs-linux.py
80
81 FLAGS_TO_PASS = \
82 "prefix=$(prefix)" \
83 "exec_prefix=$(exec_prefix)" \
84 "infodir=$(infodir)" \
85 "datarootdir=$(datarootdir)" \
86 "docdir=$(docdir)" \
87 "htmldir=$(htmldir)" \
88 "pdfdir=$(pdfdir)" \
89 "libdir=$(libdir)" \
90 "mandir=$(mandir)" \
91 "datadir=$(datadir)" \
92 "includedir=$(includedir)" \
93 "against=$(against)" \
94 "DESTDIR=$(DESTDIR)" \
95 "AR=$(AR)" \
96 "AR_FLAGS=$(AR_FLAGS)" \
97 "CC=$(CC)" \
98 "CFLAGS=$(CFLAGS)" \
99 "CXX=$(CXX)" \
100 "CXXFLAGS=$(CXXFLAGS)" \
101 "DLLTOOL=$(DLLTOOL)" \
102 "LDFLAGS=$(LDFLAGS)" \
103 "RANLIB=$(RANLIB)" \
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)"
112
113 .PHONY: all
114 all: stamp-syscalls stamp-python stamp-system-gdbinit
115
116 # For portability's sake, we need to handle systems that don't have
117 # symbolic links.
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) ; \
126 fi ; \
127 done
128 touch $@
129
130 .PHONY: clean-syscalls
131 clean-syscalls:
132 rm -rf $(SYSCALLS_DIR)
133 rm -f stamp-syscalls
134
135 # This target is responsible for properly installing the syscalls'
136 # XML files in the system.
137 .PHONY: install-syscalls
138 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) ; \
145 fi ; \
146 done
147
148 .PHONY: uninstall-syscalls
149 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,/[^/]*$$,,'` ; \
158 done \
159 done
160
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 ; \
168 done
169 touch $@
170
171 .PHONY: clean-python
172 clean-python:
173 rm -rf $(PYTHON_DIR)
174 rm -f stamp-python
175
176 .PHONY: install-python
177 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 ; \
183 done
184
185 .PHONY: uninstall-python
186 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,/[^/]*$$,,'` ; \
195 done \
196 done
197
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) ; \
206 fi ; \
207 done
208 touch $@
209
210 .PHONY: clean-system-gdbinit
211 clean-system-gdbinit:
212 rm -rf $(SYSTEM_GDBINIT_DIR)
213 rm -f stamp-system-gdbinit
214
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) ; \
223 fi ; \
224 done
225
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,/[^/]*$$,,'` ; \
236 done \
237 done
238
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.
244 .PHONY: install
245 install: all
246 @$(MAKE) $(FLAGS_TO_PASS) install-only
247
248 .PHONY: install-only
249 install-only: install-syscalls install-python install-system-gdbinit
250
251 .PHONY: uninstall
252 uninstall: uninstall-syscalls uninstall-python uninstall-system-gdbinit
253
254 .PHONY: clean
255 clean: clean-syscalls clean-python clean-system-gdbinit
256
257 .PHONY: maintainer-clean realclean distclean
258 maintainer-clean realclean distclean: clean
259 rm -f Makefile
260
261 .PHONY: check installcheck info dvi pdf html
262 .PHONY: install-info install-pdf install-html clean-info
263 check installcheck:
264 info dvi pdf html:
265 install-info install-pdf install-html:
266 clean-info:
267
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)
271 # in GNU Make 4.0.
272 .NOEXPORT:
273
274 # GNU Make 3.63 has a different problem: it keeps tacking command line
275 # overrides onto the definition of $(MAKE). This variable setting
276 # will remove them.
277 MAKEOVERRIDES=
278
279 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
280 cd $(top_builddir) && $(MAKE) data-directory/Makefile