PR build/17105.
[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 GUILE_SRCDIR = $(srcdir)/../guile/lib
23 SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit
24 VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(GUILE_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR)
25
26 top_srcdir = @top_srcdir@
27 top_builddir = @top_builddir@
28
29 prefix = @prefix@
30 exec_prefix = @exec_prefix@
31
32 datarootdir = @datarootdir@
33 datadir = @datadir@
34
35 SHELL = @SHELL@
36
37 LN_S = @LN_S@
38
39 INSTALL = @INSTALL@
40 INSTALL_DATA = @INSTALL_DATA@
41 INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs
42
43 GDB_DATADIR = @GDB_DATADIR@
44
45 SYSCALLS_DIR = syscalls
46 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
47 SYSCALLS_FILES = \
48 gdb-syscalls.dtd \
49 arm-linux.xml \
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
55
56 PYTHON_DIR = python
57 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
58 PYTHON_FILE_LIST = \
59 gdb/__init__.py \
60 gdb/frames.py \
61 gdb/FrameIterator.py \
62 gdb/FrameDecorator.py \
63 gdb/types.py \
64 gdb/printing.py \
65 gdb/prompt.py \
66 gdb/xmethod.py \
67 gdb/command/bound_registers.py \
68 gdb/command/__init__.py \
69 gdb/command/xmethods.py \
70 gdb/command/frame_filters.py \
71 gdb/command/type_printers.py \
72 gdb/command/pretty_printers.py \
73 gdb/command/prompt.py \
74 gdb/command/explore.py \
75 gdb/function/__init__.py \
76 gdb/function/strfns.py
77
78 @HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST)
79 @HAVE_PYTHON_FALSE@PYTHON_FILES =
80
81 GUILE_DIR = guile
82 GUILE_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(GUILE_DIR)
83 GUILE_FILE_LIST = \
84 ./gdb.scm \
85 gdb/boot.scm \
86 gdb/experimental.scm \
87 gdb/init.scm \
88 gdb/iterator.scm \
89 gdb/printing.scm \
90 gdb/types.scm
91
92 @HAVE_GUILE_TRUE@GUILE_FILES = $(GUILE_FILE_LIST)
93 @HAVE_GUILE_FALSE@GUILE_FILES =
94
95 SYSTEM_GDBINIT_DIR = system-gdbinit
96 SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR)
97 SYSTEM_GDBINIT_FILES = \
98 elinos.py \
99 wrs-linux.py
100
101 FLAGS_TO_PASS = \
102 "prefix=$(prefix)" \
103 "exec_prefix=$(exec_prefix)" \
104 "infodir=$(infodir)" \
105 "datarootdir=$(datarootdir)" \
106 "docdir=$(docdir)" \
107 "htmldir=$(htmldir)" \
108 "pdfdir=$(pdfdir)" \
109 "libdir=$(libdir)" \
110 "mandir=$(mandir)" \
111 "datadir=$(datadir)" \
112 "includedir=$(includedir)" \
113 "against=$(against)" \
114 "DESTDIR=$(DESTDIR)" \
115 "AR=$(AR)" \
116 "AR_FLAGS=$(AR_FLAGS)" \
117 "CC=$(CC)" \
118 "CFLAGS=$(CFLAGS)" \
119 "CXX=$(CXX)" \
120 "CXXFLAGS=$(CXXFLAGS)" \
121 "DLLTOOL=$(DLLTOOL)" \
122 "LDFLAGS=$(LDFLAGS)" \
123 "RANLIB=$(RANLIB)" \
124 "MAKEINFO=$(MAKEINFO)" \
125 "MAKEHTML=$(MAKEHTML)" \
126 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
127 "INSTALL=$(INSTALL)" \
128 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
129 "INSTALL_DATA=$(INSTALL_DATA)" \
130 "RUNTEST=$(RUNTEST)" \
131 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
132
133 .PHONY: all
134 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
135
136 # For portability's sake, we need to handle systems that don't have
137 # symbolic links.
138 stamp-syscalls: Makefile $(SYSCALLS_FILES)
139 rm -rf ./$(SYSCALLS_DIR)
140 mkdir ./$(SYSCALLS_DIR)
141 files='$(SYSCALLS_FILES)' ; \
142 for file in $$files ; do \
143 f=$(SYSCALLS_SRCDIR)/$$file ; \
144 if test -f $$f ; then \
145 $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
146 fi ; \
147 done
148 touch $@
149
150 .PHONY: clean-syscalls
151 clean-syscalls:
152 rm -rf $(SYSCALLS_DIR)
153 rm -f stamp-syscalls
154
155 # This target is responsible for properly installing the syscalls'
156 # XML files in the system.
157 .PHONY: install-syscalls
158 install-syscalls:
159 $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR)
160 files='$(SYSCALLS_FILES)' ; \
161 for file in $$files; do \
162 f=$(SYSCALLS_SRCDIR)/$$file ; \
163 if test -f $$f ; then \
164 $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
165 fi ; \
166 done
167
168 .PHONY: uninstall-syscalls
169 uninstall-syscalls:
170 files='$(SYSCALLS_FILES)' ; \
171 for file in $$files ; do \
172 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
173 rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \
174 while test "x$$file" != "x$$slashdir" ; do \
175 rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
176 file="$$slashdir" ; \
177 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
178 done \
179 done
180
181 stamp-python: Makefile $(PYTHON_FILES)
182 rm -rf ./$(PYTHON_DIR)
183 files='$(PYTHON_FILES)' ; \
184 if test "x$$files" != x ; then \
185 for file in $$files ; do \
186 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
187 $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \
188 $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
189 done ; \
190 fi
191 touch $@
192
193 .PHONY: clean-python
194 clean-python:
195 rm -rf $(PYTHON_DIR)
196 rm -f stamp-python
197
198 .PHONY: install-python
199 install-python:
200 files='$(PYTHON_FILES)' ; \
201 if test "x$$files" != x ; then \
202 for file in $$files ; do \
203 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
204 $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \
205 $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \
206 done ; \
207 fi
208
209 .PHONY: uninstall-python
210 uninstall-python:
211 files='$(PYTHON_FILES)' ; \
212 if test "x$$files" != x ; then \
213 for file in $$files ; do \
214 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
215 rm -f $(PYTHON_INSTALL_DIR)/$$file ; \
216 while test "x$$file" != "x$$slashdir" ; do \
217 rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \
218 file="$$slashdir" ; \
219 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
220 done \
221 done ; \
222 fi
223
224 stamp-guile: Makefile $(GUILE_FILES)
225 rm -rf ./$(GUILE_DIR)
226 files='$(GUILE_FILES)' ; \
227 if test "x$$files" != x ; then \
228 for file in $$files ; do \
229 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
230 $(INSTALL_DIR) ./$(GUILE_DIR)/$$dir ; \
231 $(INSTALL_DATA) $(GUILE_SRCDIR)/$$file ./$(GUILE_DIR)/$$dir ; \
232 done ; \
233 fi
234 touch $@
235
236 .PHONY: clean-guile
237 clean-guile:
238 rm -rf $(GUILE_DIR)
239 rm -f stamp-guile
240
241 .PHONY: install-guile
242 install-guile:
243 files='$(GUILE_FILES)' ; \
244 if test "x$$files" != x ; then \
245 for file in $$files ; do \
246 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
247 $(INSTALL_DIR) $(GUILE_INSTALL_DIR)/$$dir ; \
248 $(INSTALL_DATA) ./$(GUILE_DIR)/$$file $(GUILE_INSTALL_DIR)/$$dir ; \
249 done ; \
250 fi
251
252 .PHONY: uninstall-guile
253 uninstall-guile:
254 files='$(GUILE_FILES)' ; \
255 if test "x$$files" != x ; then \
256 for file in $$files ; do \
257 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
258 rm -f $(GUILE_INSTALL_DIR)/$$file ; \
259 while test "x$$file" != "x$$slashdir" ; do \
260 rmdir 2>/dev/null "$(GUILE_INSTALL_DIR)$$slashdir" ; \
261 file="$$slashdir" ; \
262 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
263 done \
264 done ; \
265 fi
266
267 stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES)
268 rm -rf ./$(SYSTEM_GDBINIT_DIR)
269 mkdir ./$(SYSTEM_GDBINIT_DIR)
270 files='$(SYSTEM_GDBINIT_FILES)' ; \
271 for file in $$files ; do \
272 f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
273 if test -f $$f ; then \
274 $(INSTALL_DATA) $$f ./$(SYSTEM_GDBINIT_DIR) ; \
275 fi ; \
276 done
277 touch $@
278
279 .PHONY: clean-system-gdbinit
280 clean-system-gdbinit:
281 rm -rf $(SYSTEM_GDBINIT_DIR)
282 rm -f stamp-system-gdbinit
283
284 .PHONY: install-system-gdbinit
285 install-system-gdbinit:
286 $(INSTALL_DIR) $(SYSTEM_GDBINIT_INSTALL_DIR)
287 files='$(SYSTEM_GDBINIT_FILES)' ; \
288 for file in $$files; do \
289 f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
290 if test -f $$f ; then \
291 $(INSTALL_DATA) $$f $(SYSTEM_GDBINIT_INSTALL_DIR) ; \
292 fi ; \
293 done
294
295 .PHONY: uninstall-system-gdbinit
296 uninstall-system-gdbinit:
297 files='$(SYSTEM_GDBINIT_FILES)' ; \
298 for file in $$files ; do \
299 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
300 rm -f $(SYSTEM_GDBINIT_INSTALL_DIR)/$$file ; \
301 while test "x$$file" != "x$$slashdir" ; do \
302 rmdir 2>/dev/null "$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
303 file="$$slashdir" ; \
304 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
305 done \
306 done
307
308 # Traditionally "install" depends on "all". But it may be useful
309 # not to; for example, if the user has made some trivial change to a
310 # source file and doesn't care about rebuilding or just wants to save the
311 # time it takes for make to check that all is up to date.
312 # install-only is intended to address that need.
313 .PHONY: install
314 install: all
315 @$(MAKE) $(FLAGS_TO_PASS) install-only
316
317 .PHONY: install-only
318 install-only: install-syscalls install-python install-guile \
319 install-system-gdbinit
320
321 .PHONY: uninstall
322 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
323 uninstall-system-gdbinit
324
325 .PHONY: clean
326 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
327
328 .PHONY: maintainer-clean realclean distclean
329 maintainer-clean realclean distclean: clean
330 rm -f Makefile
331
332 .PHONY: check installcheck info dvi pdf html
333 .PHONY: install-info install-pdf install-html clean-info
334 check installcheck:
335 info dvi pdf html:
336 install-info install-pdf install-html:
337 clean-info:
338
339 # GNU Make has an annoying habit of putting *all* the Makefile variables
340 # into the environment, unless you include this target as a circumvention.
341 # Rumor is that this will be fixed (and this target can be removed)
342 # in GNU Make 4.0.
343 .NOEXPORT:
344
345 # GNU Make 3.63 has a different problem: it keeps tacking command line
346 # overrides onto the definition of $(MAKE). This variable setting
347 # will remove them.
348 MAKEOVERRIDES=
349
350 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
351 cd $(top_builddir) && $(MAKE) data-directory/Makefile