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