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