Commit | Line | Data |
---|---|---|
28e7fd62 | 1 | # Copyright (C) 2010-2013 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 | |
776af39e JB |
22 | SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit |
23 | VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR) | |
aa2e2d8d DE |
24 | |
25 | top_srcdir = @top_srcdir@ | |
26 | top_builddir = @top_builddir@ | |
27 | ||
28 | prefix = @prefix@ | |
29 | exec_prefix = @exec_prefix@ | |
30 | ||
31 | datarootdir = @datarootdir@ | |
32 | datadir = @datadir@ | |
33 | ||
34 | SHELL = @SHELL@ | |
35 | ||
36 | LN_S = @LN_S@ | |
37 | ||
38 | INSTALL = @INSTALL@ | |
39 | INSTALL_DATA = @INSTALL_DATA@ | |
40 | INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs | |
41 | ||
42 | GDB_DATADIR = @GDB_DATADIR@ | |
43 | ||
44 | SYSCALLS_DIR = syscalls | |
1bfda48e | 45 | SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR) |
aa2e2d8d DE |
46 | SYSCALLS_FILES = \ |
47 | gdb-syscalls.dtd \ | |
9f948660 | 48 | arm-linux.xml \ |
aa2e2d8d DE |
49 | ppc-linux.xml ppc64-linux.xml \ |
50 | i386-linux.xml amd64-linux.xml \ | |
385203ed DD |
51 | sparc-linux.xml sparc64-linux.xml \ |
52 | mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml | |
aa2e2d8d DE |
53 | |
54 | PYTHON_DIR = python | |
1bfda48e | 55 | PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) |
aa2e2d8d | 56 | PYTHON_FILES = \ |
0e3509db | 57 | gdb/__init__.py \ |
1e611234 PM |
58 | gdb/frames.py \ |
59 | gdb/FrameIterator.py \ | |
60 | gdb/FrameDecorator.py \ | |
7b51bc51 DE |
61 | gdb/types.py \ |
62 | gdb/printing.py \ | |
fa3a4f15 | 63 | gdb/prompt.py \ |
7b51bc51 | 64 | gdb/command/__init__.py \ |
1e611234 | 65 | gdb/command/frame_filters.py \ |
18a9fc12 | 66 | gdb/command/type_printers.py \ |
fa3a4f15 | 67 | gdb/command/pretty_printers.py \ |
06fc020f | 68 | gdb/command/prompt.py \ |
a72c3253 DE |
69 | gdb/command/explore.py \ |
70 | gdb/function/__init__.py \ | |
71 | gdb/function/strfns.py | |
aa2e2d8d | 72 | |
776af39e JB |
73 | SYSTEM_GDBINIT_DIR = system-gdbinit |
74 | SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR) | |
75 | SYSTEM_GDBINIT_FILES = \ | |
76 | elinos.py \ | |
77 | wrs-linux.py | |
78 | ||
f474844c JZ |
79 | FLAGS_TO_PASS = \ |
80 | "prefix=$(prefix)" \ | |
81 | "exec_prefix=$(exec_prefix)" \ | |
82 | "infodir=$(infodir)" \ | |
83 | "datarootdir=$(datarootdir)" \ | |
84 | "docdir=$(docdir)" \ | |
85 | "htmldir=$(htmldir)" \ | |
86 | "pdfdir=$(pdfdir)" \ | |
87 | "libdir=$(libdir)" \ | |
88 | "mandir=$(mandir)" \ | |
89 | "datadir=$(datadir)" \ | |
90 | "includedir=$(includedir)" \ | |
91 | "against=$(against)" \ | |
92 | "DESTDIR=$(DESTDIR)" \ | |
93 | "AR=$(AR)" \ | |
94 | "AR_FLAGS=$(AR_FLAGS)" \ | |
95 | "CC=$(CC)" \ | |
96 | "CFLAGS=$(CFLAGS)" \ | |
97 | "CXX=$(CXX)" \ | |
98 | "CXXFLAGS=$(CXXFLAGS)" \ | |
99 | "DLLTOOL=$(DLLTOOL)" \ | |
100 | "LDFLAGS=$(LDFLAGS)" \ | |
101 | "RANLIB=$(RANLIB)" \ | |
102 | "MAKEINFO=$(MAKEINFO)" \ | |
103 | "MAKEHTML=$(MAKEHTML)" \ | |
104 | "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \ | |
105 | "INSTALL=$(INSTALL)" \ | |
106 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
107 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
108 | "RUNTEST=$(RUNTEST)" \ | |
109 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" | |
110 | ||
aa2e2d8d | 111 | .PHONY: all |
776af39e | 112 | all: stamp-syscalls stamp-python stamp-system-gdbinit |
aa2e2d8d DE |
113 | |
114 | # For portability's sake, we need to handle systems that don't have | |
115 | # symbolic links. | |
116 | stamp-syscalls: Makefile $(SYSCALLS_FILES) | |
117 | rm -rf ./$(SYSCALLS_DIR) | |
118 | mkdir ./$(SYSCALLS_DIR) | |
119 | files='$(SYSCALLS_FILES)' ; \ | |
120 | for file in $$files ; do \ | |
121 | f=$(SYSCALLS_SRCDIR)/$$file ; \ | |
122 | if test -f $$f ; then \ | |
123 | $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \ | |
124 | fi ; \ | |
125 | done | |
126 | touch $@ | |
127 | ||
128 | .PHONY: clean-syscalls | |
129 | clean-syscalls: | |
130 | rm -rf $(SYSCALLS_DIR) | |
131 | rm -f stamp-syscalls | |
132 | ||
133 | # This target is responsible for properly installing the syscalls' | |
134 | # XML files in the system. | |
135 | .PHONY: install-syscalls | |
136 | install-syscalls: | |
137 | $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR) | |
138 | files='$(SYSCALLS_FILES)' ; \ | |
139 | for file in $$files; do \ | |
140 | f=$(SYSCALLS_SRCDIR)/$$file ; \ | |
141 | if test -f $$f ; then \ | |
142 | $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \ | |
143 | fi ; \ | |
144 | done | |
145 | ||
146 | .PHONY: uninstall-syscalls | |
147 | uninstall-syscalls: | |
148 | files='$(SYSCALLS_FILES)' ; \ | |
149 | for file in $$files ; do \ | |
150 | slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ | |
151 | rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \ | |
152 | while test "x$$file" != "x$$slashdir" ; do \ | |
153 | rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \ | |
154 | file="$$slashdir" ; \ | |
155 | slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
156 | done \ | |
157 | done | |
158 | ||
159 | stamp-python: Makefile $(PYTHON_FILES) | |
160 | rm -rf ./$(PYTHON_DIR) | |
161 | files='$(PYTHON_FILES)' ; \ | |
162 | for file in $$files ; do \ | |
163 | dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
164 | $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \ | |
165 | $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \ | |
166 | done | |
167 | touch $@ | |
168 | ||
169 | .PHONY: clean-python | |
170 | clean-python: | |
171 | rm -rf $(PYTHON_DIR) | |
172 | rm -f stamp-python | |
173 | ||
174 | .PHONY: install-python | |
175 | install-python: | |
176 | files='$(PYTHON_FILES)' ; \ | |
177 | for file in $$files ; do \ | |
178 | dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
179 | $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \ | |
180 | $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \ | |
181 | done | |
182 | ||
183 | .PHONY: uninstall-python | |
184 | uninstall-python: | |
185 | files='$(PYTHON_FILES)' ; \ | |
186 | for file in $$files ; do \ | |
187 | slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ | |
188 | rm -f $(PYTHON_INSTALL_DIR)/$$file ; \ | |
189 | while test "x$$file" != "x$$slashdir" ; do \ | |
190 | rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \ | |
191 | file="$$slashdir" ; \ | |
192 | slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
193 | done \ | |
194 | done | |
195 | ||
776af39e JB |
196 | stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES) |
197 | rm -rf ./$(SYSTEM_GDBINIT_DIR) | |
198 | mkdir ./$(SYSTEM_GDBINIT_DIR) | |
199 | files='$(SYSTEM_GDBINIT_FILES)' ; \ | |
200 | for file in $$files ; do \ | |
201 | f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \ | |
202 | if test -f $$f ; then \ | |
203 | $(INSTALL_DATA) $$f ./$(SYSTEM_GDBINIT_DIR) ; \ | |
204 | fi ; \ | |
205 | done | |
206 | touch $@ | |
207 | ||
208 | .PHONY: clean-system-gdbinit | |
209 | clean-system-gdbinit: | |
210 | rm -rf $(SYSTEM_GDBINIT_DIR) | |
211 | rm -f stamp-system-gdbinit | |
212 | ||
213 | .PHONY: install-system-gdbinit | |
214 | install-system-gdbinit: | |
215 | $(INSTALL_DIR) $(SYSTEM_GDBINIT_INSTALL_DIR) | |
216 | files='$(SYSTEM_GDBINIT_FILES)' ; \ | |
217 | for file in $$files; do \ | |
218 | f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \ | |
219 | if test -f $$f ; then \ | |
220 | $(INSTALL_DATA) $$f $(SYSTEM_GDBINIT_INSTALL_DIR) ; \ | |
221 | fi ; \ | |
222 | done | |
223 | ||
224 | .PHONY: uninstall-system-gdbinit | |
225 | uninstall-system-gdbinit: | |
226 | files='$(SYSTEM_GDBINIT_FILES)' ; \ | |
227 | for file in $$files ; do \ | |
228 | slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ | |
229 | rm -f $(SYSTEM_GDBINIT_INSTALL_DIR)/$$file ; \ | |
230 | while test "x$$file" != "x$$slashdir" ; do \ | |
231 | rmdir 2>/dev/null "$(SYSTEM_GDBINIT_INSTALL_DIR)$$slashdir" ; \ | |
232 | file="$$slashdir" ; \ | |
233 | slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
234 | done \ | |
235 | done | |
236 | ||
aa2e2d8d DE |
237 | # Traditionally "install" depends on "all". But it may be useful |
238 | # not to; for example, if the user has made some trivial change to a | |
239 | # source file and doesn't care about rebuilding or just wants to save the | |
240 | # time it takes for make to check that all is up to date. | |
241 | # install-only is intended to address that need. | |
242 | .PHONY: install | |
243 | install: all | |
f474844c | 244 | @$(MAKE) $(FLAGS_TO_PASS) install-only |
aa2e2d8d DE |
245 | |
246 | .PHONY: install-only | |
776af39e | 247 | install-only: install-syscalls install-python install-system-gdbinit |
aa2e2d8d DE |
248 | |
249 | .PHONY: uninstall | |
776af39e | 250 | uninstall: uninstall-syscalls uninstall-python uninstall-system-gdbinit |
aa2e2d8d DE |
251 | |
252 | .PHONY: clean | |
776af39e | 253 | clean: clean-syscalls clean-python clean-system-gdbinit |
aa2e2d8d DE |
254 | |
255 | .PHONY: maintainer-clean realclean distclean | |
256 | maintainer-clean realclean distclean: clean | |
257 | rm -f Makefile | |
258 | ||
259 | .PHONY: check installcheck info dvi pdf html | |
260 | .PHONY: install-info install-pdf install-html clean-info | |
261 | check installcheck: | |
262 | info dvi pdf html: | |
263 | install-info install-pdf install-html: | |
264 | clean-info: | |
265 | ||
266 | # GNU Make has an annoying habit of putting *all* the Makefile variables | |
267 | # into the environment, unless you include this target as a circumvention. | |
268 | # Rumor is that this will be fixed (and this target can be removed) | |
269 | # in GNU Make 4.0. | |
270 | .NOEXPORT: | |
271 | ||
272 | # GNU Make 3.63 has a different problem: it keeps tacking command line | |
273 | # overrides onto the definition of $(MAKE). This variable setting | |
274 | # will remove them. | |
275 | MAKEOVERRIDES= | |
276 | ||
543ecec7 | 277 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
aa2e2d8d | 278 | cd $(top_builddir) && $(MAKE) data-directory/Makefile |