Fix crash when loading dwp files
[external/binutils.git] / gdb / data-directory / Makefile.in
1 # Copyright (C) 2010-2019 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 # Please keep lists in this file sorted alphabetically, with one item per line.
20 # See gdb/Makefile.in for guidelines on ordering files and directories.
21
22 srcdir = @srcdir@
23 SYSCALLS_SRCDIR = $(srcdir)/../syscalls
24 PYTHON_SRCDIR = $(srcdir)/../python/lib
25 GUILE_SRCDIR = $(srcdir)/../guile/lib
26 SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit
27 VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(GUILE_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR)
28 XSLTPROC = @XSLTPROC@
29
30 top_srcdir = @top_srcdir@
31 top_builddir = @top_builddir@
32
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35
36 datarootdir = @datarootdir@
37 datadir = @datadir@
38
39 SHELL = @SHELL@
40
41 LN_S = @LN_S@
42
43 INSTALL = @INSTALL@
44 INSTALL_DATA = @INSTALL_DATA@
45 INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs
46
47 GDB_DATADIR = @GDB_DATADIR@
48
49 SYSCALLS_DIR = syscalls
50 SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
51 GEN_SYSCALLS_FILES = \
52         aarch64-linux.xml \
53         amd64-linux.xml \
54         arm-linux.xml \
55         i386-linux.xml \
56         mips-n32-linux.xml \
57         mips-n64-linux.xml \
58         mips-o32-linux.xml \
59         ppc-linux.xml \
60         ppc64-linux.xml \
61         s390-linux.xml \
62         s390x-linux.xml \
63         sparc-linux.xml \
64         sparc64-linux.xml
65
66 SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml $(GEN_SYSCALLS_FILES)
67
68 PYTHON_DIR = python
69 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
70 PYTHON_FILE_LIST = \
71         gdb/__init__.py \
72         gdb/FrameDecorator.py \
73         gdb/FrameIterator.py \
74         gdb/frames.py \
75         gdb/printing.py \
76         gdb/prompt.py \
77         gdb/types.py \
78         gdb/unwinder.py \
79         gdb/xmethod.py \
80         gdb/command/__init__.py \
81         gdb/command/explore.py \
82         gdb/command/frame_filters.py \
83         gdb/command/pretty_printers.py \
84         gdb/command/prompt.py \
85         gdb/command/type_printers.py \
86         gdb/command/unwinders.py \
87         gdb/command/xmethods.py \
88         gdb/function/__init__.py \
89         gdb/function/as_string.py \
90         gdb/function/caller_is.py \
91         gdb/function/strfns.py \
92         gdb/printer/__init__.py \
93         gdb/printer/bound_registers.py
94
95 @HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST)
96 @HAVE_PYTHON_FALSE@PYTHON_FILES =
97
98 GUILE_DIR = guile
99 GUILE_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(GUILE_DIR)
100
101 GUILE_SOURCE_FILES = \
102         ./gdb.scm \
103         gdb/boot.scm \
104         gdb/experimental.scm \
105         gdb/init.scm \
106         gdb/iterator.scm \
107         gdb/printing.scm \
108         gdb/support.scm \
109         gdb/types.scm
110
111 GUILE_COMPILED_FILES = \
112         ./gdb.go \
113         gdb/experimental.go \
114         gdb/iterator.go \
115         gdb/printing.go \
116         gdb/support.go \
117         gdb/types.go
118
119 @HAVE_GUILE_TRUE@GUILE_FILES = $(GUILE_SOURCE_FILES) $(GUILE_COMPILED_FILES)
120 @HAVE_GUILE_FALSE@GUILE_FILES =
121
122 GUILD = @GUILD@
123 GUILD_TARGET_FLAG = @GUILD_TARGET_FLAG@
124
125 # Flags passed to 'guild compile'.
126 # Note: We can't use -Wunbound-variable because all the variables
127 # defined in C aren't visible when we compile.
128 # Note: To work around a guile 2.0.5 issue (it can't find gdb/init.scm even if
129 # we pass -L <dir>) we have to compile in the directory containing gdb.scm.
130 # We still need to pass "-L ." so that other modules are found.
131 GUILD_COMPILE_FLAGS = \
132         $(GUILD_TARGET_FLAG) \
133         -Warity-mismatch -Wformat -Wunused-toplevel \
134         -L .
135
136 SYSTEM_GDBINIT_DIR = system-gdbinit
137 SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR)
138 SYSTEM_GDBINIT_FILES = \
139         elinos.py \
140         wrs-linux.py
141
142 FLAGS_TO_PASS = \
143         "prefix=$(prefix)" \
144         "exec_prefix=$(exec_prefix)" \
145         "infodir=$(infodir)" \
146         "datarootdir=$(datarootdir)" \
147         "docdir=$(docdir)" \
148         "htmldir=$(htmldir)" \
149         "pdfdir=$(pdfdir)" \
150         "libdir=$(libdir)" \
151         "mandir=$(mandir)" \
152         "datadir=$(datadir)" \
153         "includedir=$(includedir)" \
154         "against=$(against)" \
155         "DESTDIR=$(DESTDIR)" \
156         "AR=$(AR)" \
157         "AR_FLAGS=$(AR_FLAGS)" \
158         "CC=$(CC)" \
159         "CFLAGS=$(CFLAGS)" \
160         "CXX=$(CXX)" \
161         "CXXFLAGS=$(CXXFLAGS)" \
162         "DLLTOOL=$(DLLTOOL)" \
163         "LDFLAGS=$(LDFLAGS)" \
164         "RANLIB=$(RANLIB)" \
165         "MAKEINFO=$(MAKEINFO)" \
166         "MAKEHTML=$(MAKEHTML)" \
167         "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
168         "INSTALL=$(INSTALL)" \
169         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
170         "INSTALL_DATA=$(INSTALL_DATA)" \
171         "RUNTEST=$(RUNTEST)" \
172         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
173
174 .PHONY: all
175 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
176
177 %.xml: @MAINTAINER_MODE_TRUE@ %.xml.in apply-defaults.xsl linux-defaults.xml.in
178         $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl\
179                 $(SYSCALLS_SRCDIR)/$@.in
180
181 .PHONY: syscall-xml
182 syscall-xml: $(GEN_SYSCALLS_FILES)
183
184 .PHONY: clean-syscall-xml
185 # Only clean files generated XML files.
186 clean-syscall-xml:
187         files='$(GEN_SYSCALLS_FILES)' ; \
188         for file in $$files; do \
189                 rm -f "$(SYSCALLS_SRCDIR)/$$file"; \
190         done
191
192 # For portability's sake, we need to handle systems that don't have
193 # symbolic links.
194 stamp-syscalls: Makefile $(SYSCALLS_FILES)
195         rm -rf ./$(SYSCALLS_DIR)
196         mkdir ./$(SYSCALLS_DIR)
197         files='$(SYSCALLS_FILES)' ; \
198         for file in $$files ; do \
199           f=$(SYSCALLS_SRCDIR)/$$file ; \
200           if test -f $$f ; then \
201             $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
202           fi ; \
203         done
204         touch $@
205
206 .PHONY: clean-syscalls
207 clean-syscalls:
208         rm -rf $(SYSCALLS_DIR)
209         rm -f stamp-syscalls
210
211 # This target is responsible for properly installing the syscalls'
212 # XML files in the system.
213 .PHONY: install-syscalls
214 install-syscalls:
215         $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR)
216         files='$(SYSCALLS_FILES)' ; \
217         for file in $$files; do \
218           f=$(SYSCALLS_SRCDIR)/$$file ; \
219           if test -f $$f ; then \
220             $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
221           fi ; \
222         done
223
224 .PHONY: uninstall-syscalls
225 uninstall-syscalls:
226         files='$(SYSCALLS_FILES)' ; \
227         for file in $$files ; do \
228           slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
229           rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \
230           while test "x$$file" != "x$$slashdir" ; do \
231             rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
232             file="$$slashdir" ; \
233             slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
234           done \
235         done
236
237 stamp-python: Makefile $(PYTHON_FILES)
238         rm -rf ./$(PYTHON_DIR)
239         files='$(PYTHON_FILES)' ; \
240         if test "x$$files" != x ; then \
241           for file in $$files ; do \
242             dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
243             $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \
244             $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
245           done ; \
246         fi
247         touch $@
248
249 .PHONY: clean-python
250 clean-python:
251         rm -rf $(PYTHON_DIR)
252         rm -f stamp-python
253
254 .PHONY: install-python
255 install-python:
256         files='$(PYTHON_FILES)' ; \
257         if test "x$$files" != x ; then \
258           for file in $$files ; do \
259             dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
260             $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \
261             $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \
262           done ; \
263         fi
264
265 .PHONY: uninstall-python
266 uninstall-python:
267         files='$(PYTHON_FILES)' ; \
268         if test "x$$files" != x ; then \
269           for file in $$files ; do \
270             slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
271             rm -f $(PYTHON_INSTALL_DIR)/$$file ; \
272             while test "x$$file" != "x$$slashdir" ; do \
273               rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \
274               file="$$slashdir" ; \
275               slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
276             done \
277           done ; \
278         fi
279
280 stamp-guile: Makefile $(GUILE_SOURCE_FILES)
281         rm -rf ./$(GUILE_DIR)
282         if test "x$(GUILE_FILES)" != x ; then \
283           files='$(GUILE_SOURCE_FILES)' ; \
284           for file in $$files ; do \
285             dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
286             $(INSTALL_DIR) ./$(GUILE_DIR)/$$dir ; \
287             $(INSTALL_DATA) $(GUILE_SRCDIR)/$$file ./$(GUILE_DIR)/$$dir ; \
288           done ; \
289           files='$(GUILE_COMPILED_FILES)' ; \
290           cd ./$(GUILE_DIR) ; \
291           for go in $$files ; do \
292             source="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
293             echo $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" ; \
294             $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" || exit 1 ; \
295           done ; \
296         fi
297         touch $@
298
299 .PHONY: clean-guile
300 clean-guile:
301         rm -rf $(GUILE_DIR)
302         rm -f stamp-guile
303
304 .PHONY: install-guile
305 install-guile:
306         files='$(GUILE_FILES)' ; \
307         if test "x$$files" != x ; then \
308           for file in $$files ; do \
309             dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
310             $(INSTALL_DIR) $(GUILE_INSTALL_DIR)/$$dir ; \
311             $(INSTALL_DATA) ./$(GUILE_DIR)/$$file $(GUILE_INSTALL_DIR)/$$dir ; \
312           done ; \
313         fi
314
315 .PHONY: uninstall-guile
316 uninstall-guile:
317         files='$(GUILE_FILES)' ; \
318         if test "x$$files" != x ; then \
319           for file in $$files ; do \
320             slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
321             rm -f $(GUILE_INSTALL_DIR)/$$file ; \
322             while test "x$$file" != "x$$slashdir" ; do \
323               rmdir 2>/dev/null "$(GUILE_INSTALL_DIR)$$slashdir" ; \
324               file="$$slashdir" ; \
325               slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
326             done \
327           done ; \
328         fi
329
330 stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES)
331         rm -rf ./$(SYSTEM_GDBINIT_DIR)
332         mkdir ./$(SYSTEM_GDBINIT_DIR)
333         files='$(SYSTEM_GDBINIT_FILES)' ; \
334         for file in $$files ; do \
335           f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
336           if test -f $$f ; then \
337             $(INSTALL_DATA) $$f ./$(SYSTEM_GDBINIT_DIR) ; \
338           fi ; \
339         done
340         touch $@
341
342 .PHONY: clean-system-gdbinit
343 clean-system-gdbinit:
344         rm -rf $(SYSTEM_GDBINIT_DIR)
345         rm -f stamp-system-gdbinit
346
347 .PHONY: install-system-gdbinit
348 install-system-gdbinit:
349         $(INSTALL_DIR) $(SYSTEM_GDBINIT_INSTALL_DIR)
350         files='$(SYSTEM_GDBINIT_FILES)' ; \
351         for file in $$files; do \
352           f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
353           if test -f $$f ; then \
354             $(INSTALL_DATA) $$f $(SYSTEM_GDBINIT_INSTALL_DIR) ; \
355           fi ; \
356         done
357
358 .PHONY: uninstall-system-gdbinit
359 uninstall-system-gdbinit:
360         files='$(SYSTEM_GDBINIT_FILES)' ; \
361         for file in $$files ; do \
362           slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
363           rm -f $(SYSTEM_GDBINIT_INSTALL_DIR)/$$file ; \
364           while test "x$$file" != "x$$slashdir" ; do \
365             rmdir 2>/dev/null "$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \
366             file="$$slashdir" ; \
367             slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
368           done \
369         done
370
371 # Traditionally "install" depends on "all".  But it may be useful
372 # not to; for example, if the user has made some trivial change to a
373 # source file and doesn't care about rebuilding or just wants to save the
374 # time it takes for make to check that all is up to date.
375 # install-only is intended to address that need.
376 .PHONY: install
377 install: all
378         @$(MAKE) $(FLAGS_TO_PASS) install-only
379
380 .PHONY: install-only
381 install-only: install-syscalls install-python install-guile \
382         install-system-gdbinit
383
384 .PHONY: uninstall
385 uninstall: uninstall-syscalls uninstall-python uninstall-guile \
386         uninstall-system-gdbinit
387
388 .PHONY: clean
389 clean: clean-syscalls clean-python clean-guile clean-system-gdbinit
390
391 .PHONY: maintainer-clean realclean distclean
392 maintainer-clean realclean distclean: clean
393         rm -f Makefile
394
395 .PHONY: check installcheck info dvi pdf html
396 .PHONY: install-info install-pdf install-html clean-info
397 check installcheck:
398 info dvi pdf html:
399 install-info install-pdf install-html:
400 clean-info:
401
402 # GNU Make has an annoying habit of putting *all* the Makefile variables
403 # into the environment, unless you include this target as a circumvention.
404 # Rumor is that this will be fixed (and this target can be removed)
405 # in GNU Make 4.0.
406 .NOEXPORT:
407
408 # GNU Make 3.63 has a different problem: it keeps tacking command line
409 # overrides onto the definition of $(MAKE).  This variable setting
410 # will remove them.
411 MAKEOVERRIDES=
412
413 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
414         cd $(top_builddir) && $(MAKE) data-directory/Makefile
415
416 # Disable implicit make rules.
417 include $(srcdir)/../disable-implicit-rules.mk