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