Commit | Line | Data |
---|---|---|
aa2e2d8d DE |
1 | # Copyright (C) 2010 Free Software Foundation, Inc. |
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 | |
22 | VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR) | |
23 | ||
24 | top_srcdir = @top_srcdir@ | |
25 | top_builddir = @top_builddir@ | |
26 | ||
27 | prefix = @prefix@ | |
28 | exec_prefix = @exec_prefix@ | |
29 | ||
30 | datarootdir = @datarootdir@ | |
31 | datadir = @datadir@ | |
32 | ||
33 | SHELL = @SHELL@ | |
34 | ||
35 | LN_S = @LN_S@ | |
36 | ||
37 | INSTALL = @INSTALL@ | |
38 | INSTALL_DATA = @INSTALL_DATA@ | |
39 | INSTALL_DIR = $(SHELL) $(srcdir)/../../mkinstalldirs | |
40 | ||
41 | GDB_DATADIR = @GDB_DATADIR@ | |
42 | ||
43 | SYSCALLS_DIR = syscalls | |
44 | SYSCALLS_INSTALL_DIR = $(DESTDIR)/$(GDB_DATADIR)/$(SYSCALLS_DIR) | |
45 | SYSCALLS_FILES = \ | |
46 | gdb-syscalls.dtd \ | |
47 | ppc-linux.xml ppc64-linux.xml \ | |
48 | i386-linux.xml amd64-linux.xml \ | |
49 | sparc-linux.xml sparc64-linux.xml | |
50 | ||
51 | PYTHON_DIR = python | |
52 | PYTHON_INSTALL_DIR = $(DESTDIR)/$(GDB_DATADIR)/$(PYTHON_DIR) | |
53 | PYTHON_FILES = \ | |
54 | gdb/__init__.py | |
55 | ||
aa2e2d8d DE |
56 | .PHONY: all |
57 | all: stamp-syscalls stamp-python | |
58 | ||
59 | # For portability's sake, we need to handle systems that don't have | |
60 | # symbolic links. | |
61 | stamp-syscalls: Makefile $(SYSCALLS_FILES) | |
62 | rm -rf ./$(SYSCALLS_DIR) | |
63 | mkdir ./$(SYSCALLS_DIR) | |
64 | files='$(SYSCALLS_FILES)' ; \ | |
65 | for file in $$files ; do \ | |
66 | f=$(SYSCALLS_SRCDIR)/$$file ; \ | |
67 | if test -f $$f ; then \ | |
68 | $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \ | |
69 | fi ; \ | |
70 | done | |
71 | touch $@ | |
72 | ||
73 | .PHONY: clean-syscalls | |
74 | clean-syscalls: | |
75 | rm -rf $(SYSCALLS_DIR) | |
76 | rm -f stamp-syscalls | |
77 | ||
78 | # This target is responsible for properly installing the syscalls' | |
79 | # XML files in the system. | |
80 | .PHONY: install-syscalls | |
81 | install-syscalls: | |
82 | $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR) | |
83 | files='$(SYSCALLS_FILES)' ; \ | |
84 | for file in $$files; do \ | |
85 | f=$(SYSCALLS_SRCDIR)/$$file ; \ | |
86 | if test -f $$f ; then \ | |
87 | $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \ | |
88 | fi ; \ | |
89 | done | |
90 | ||
91 | .PHONY: uninstall-syscalls | |
92 | uninstall-syscalls: | |
93 | files='$(SYSCALLS_FILES)' ; \ | |
94 | for file in $$files ; do \ | |
95 | slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ | |
96 | rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \ | |
97 | while test "x$$file" != "x$$slashdir" ; do \ | |
98 | rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \ | |
99 | file="$$slashdir" ; \ | |
100 | slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
101 | done \ | |
102 | done | |
103 | ||
104 | stamp-python: Makefile $(PYTHON_FILES) | |
105 | rm -rf ./$(PYTHON_DIR) | |
106 | files='$(PYTHON_FILES)' ; \ | |
107 | for file in $$files ; do \ | |
108 | dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
109 | $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \ | |
110 | $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \ | |
111 | done | |
112 | touch $@ | |
113 | ||
114 | .PHONY: clean-python | |
115 | clean-python: | |
116 | rm -rf $(PYTHON_DIR) | |
117 | rm -f stamp-python | |
118 | ||
119 | .PHONY: install-python | |
120 | install-python: | |
121 | files='$(PYTHON_FILES)' ; \ | |
122 | for file in $$files ; do \ | |
123 | dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
124 | $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \ | |
125 | $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \ | |
126 | done | |
127 | ||
128 | .PHONY: uninstall-python | |
129 | uninstall-python: | |
130 | files='$(PYTHON_FILES)' ; \ | |
131 | for file in $$files ; do \ | |
132 | slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ | |
133 | rm -f $(PYTHON_INSTALL_DIR)/$$file ; \ | |
134 | while test "x$$file" != "x$$slashdir" ; do \ | |
135 | rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \ | |
136 | file="$$slashdir" ; \ | |
137 | slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ | |
138 | done \ | |
139 | done | |
140 | ||
141 | # Traditionally "install" depends on "all". But it may be useful | |
142 | # not to; for example, if the user has made some trivial change to a | |
143 | # source file and doesn't care about rebuilding or just wants to save the | |
144 | # time it takes for make to check that all is up to date. | |
145 | # install-only is intended to address that need. | |
146 | .PHONY: install | |
147 | install: all | |
148 | $(MAKE) install-only | |
149 | ||
150 | .PHONY: install-only | |
151 | install-only: install-syscalls install-python | |
152 | ||
153 | .PHONY: uninstall | |
154 | uninstall: uninstall-syscalls uninstall-python | |
155 | ||
156 | .PHONY: clean | |
157 | clean: clean-syscalls clean-python | |
158 | ||
159 | .PHONY: maintainer-clean realclean distclean | |
160 | maintainer-clean realclean distclean: clean | |
161 | rm -f Makefile | |
162 | ||
163 | .PHONY: check installcheck info dvi pdf html | |
164 | .PHONY: install-info install-pdf install-html clean-info | |
165 | check installcheck: | |
166 | info dvi pdf html: | |
167 | install-info install-pdf install-html: | |
168 | clean-info: | |
169 | ||
170 | # GNU Make has an annoying habit of putting *all* the Makefile variables | |
171 | # into the environment, unless you include this target as a circumvention. | |
172 | # Rumor is that this will be fixed (and this target can be removed) | |
173 | # in GNU Make 4.0. | |
174 | .NOEXPORT: | |
175 | ||
176 | # GNU Make 3.63 has a different problem: it keeps tacking command line | |
177 | # overrides onto the definition of $(MAKE). This variable setting | |
178 | # will remove them. | |
179 | MAKEOVERRIDES= | |
180 | ||
543ecec7 | 181 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
aa2e2d8d | 182 | cd $(top_builddir) && $(MAKE) data-directory/Makefile |