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