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