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