gdb/
[binutils-gdb.git] / gdb / data-directory / Makefile.in
1 # Copyright (C) 2010, 2011 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 mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml
51
52 PYTHON_DIR = python
53 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
54 PYTHON_FILES = \
55 gdb/__init__.py \
56 gdb/types.py \
57 gdb/printing.py \
58 gdb/command/__init__.py \
59 gdb/command/pretty_printers.py
60
61 FLAGS_TO_PASS = \
62 "prefix=$(prefix)" \
63 "exec_prefix=$(exec_prefix)" \
64 "infodir=$(infodir)" \
65 "datarootdir=$(datarootdir)" \
66 "docdir=$(docdir)" \
67 "htmldir=$(htmldir)" \
68 "pdfdir=$(pdfdir)" \
69 "libdir=$(libdir)" \
70 "mandir=$(mandir)" \
71 "datadir=$(datadir)" \
72 "includedir=$(includedir)" \
73 "against=$(against)" \
74 "DESTDIR=$(DESTDIR)" \
75 "AR=$(AR)" \
76 "AR_FLAGS=$(AR_FLAGS)" \
77 "CC=$(CC)" \
78 "CFLAGS=$(CFLAGS)" \
79 "CXX=$(CXX)" \
80 "CXXFLAGS=$(CXXFLAGS)" \
81 "DLLTOOL=$(DLLTOOL)" \
82 "LDFLAGS=$(LDFLAGS)" \
83 "RANLIB=$(RANLIB)" \
84 "MAKEINFO=$(MAKEINFO)" \
85 "MAKEHTML=$(MAKEHTML)" \
86 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
87 "INSTALL=$(INSTALL)" \
88 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
89 "INSTALL_DATA=$(INSTALL_DATA)" \
90 "RUNTEST=$(RUNTEST)" \
91 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
92
93 .PHONY: all
94 all: stamp-syscalls stamp-python
95
96 # For portability's sake, we need to handle systems that don't have
97 # symbolic links.
98 stamp-syscalls: Makefile $(SYSCALLS_FILES)
99 rm -rf ./$(SYSCALLS_DIR)
100 mkdir ./$(SYSCALLS_DIR)
101 files='$(SYSCALLS_FILES)' ; \
102 for file in $$files ; do \
103 f=$(SYSCALLS_SRCDIR)/$$file ; \
104 if test -f $$f ; then \
105 $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
106 fi ; \
107 done
108 touch $@
109
110 .PHONY: clean-syscalls
111 clean-syscalls:
112 rm -rf $(SYSCALLS_DIR)
113 rm -f stamp-syscalls
114
115 # This target is responsible for properly installing the syscalls'
116 # XML files in the system.
117 .PHONY: install-syscalls
118 install-syscalls:
119 $(INSTALL_DIR) $(SYSCALLS_INSTALL_DIR)
120 files='$(SYSCALLS_FILES)' ; \
121 for file in $$files; do \
122 f=$(SYSCALLS_SRCDIR)/$$file ; \
123 if test -f $$f ; then \
124 $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
125 fi ; \
126 done
127
128 .PHONY: uninstall-syscalls
129 uninstall-syscalls:
130 files='$(SYSCALLS_FILES)' ; \
131 for file in $$files ; do \
132 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
133 rm -f $(SYSCALLS_INSTALL_DIR)/$$file ; \
134 while test "x$$file" != "x$$slashdir" ; do \
135 rmdir 2>/dev/null "$(SYSCALLS_INSTALL_DIR)$$slashdir" ; \
136 file="$$slashdir" ; \
137 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
138 done \
139 done
140
141 stamp-python: Makefile $(PYTHON_FILES)
142 rm -rf ./$(PYTHON_DIR)
143 files='$(PYTHON_FILES)' ; \
144 for file in $$files ; do \
145 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
146 $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \
147 $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
148 done
149 touch $@
150
151 .PHONY: clean-python
152 clean-python:
153 rm -rf $(PYTHON_DIR)
154 rm -f stamp-python
155
156 .PHONY: install-python
157 install-python:
158 files='$(PYTHON_FILES)' ; \
159 for file in $$files ; do \
160 dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
161 $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \
162 $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \
163 done
164
165 .PHONY: uninstall-python
166 uninstall-python:
167 files='$(PYTHON_FILES)' ; \
168 for file in $$files ; do \
169 slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \
170 rm -f $(PYTHON_INSTALL_DIR)/$$file ; \
171 while test "x$$file" != "x$$slashdir" ; do \
172 rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \
173 file="$$slashdir" ; \
174 slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
175 done \
176 done
177
178 # Traditionally "install" depends on "all". But it may be useful
179 # not to; for example, if the user has made some trivial change to a
180 # source file and doesn't care about rebuilding or just wants to save the
181 # time it takes for make to check that all is up to date.
182 # install-only is intended to address that need.
183 .PHONY: install
184 install: all
185 @$(MAKE) $(FLAGS_TO_PASS) install-only
186
187 .PHONY: install-only
188 install-only: install-syscalls install-python
189
190 .PHONY: uninstall
191 uninstall: uninstall-syscalls uninstall-python
192
193 .PHONY: clean
194 clean: clean-syscalls clean-python
195
196 .PHONY: maintainer-clean realclean distclean
197 maintainer-clean realclean distclean: clean
198 rm -f Makefile
199
200 .PHONY: check installcheck info dvi pdf html
201 .PHONY: install-info install-pdf install-html clean-info
202 check installcheck:
203 info dvi pdf html:
204 install-info install-pdf install-html:
205 clean-info:
206
207 # GNU Make has an annoying habit of putting *all* the Makefile variables
208 # into the environment, unless you include this target as a circumvention.
209 # Rumor is that this will be fixed (and this target can be removed)
210 # in GNU Make 4.0.
211 .NOEXPORT:
212
213 # GNU Make 3.63 has a different problem: it keeps tacking command line
214 # overrides onto the definition of $(MAKE). This variable setting
215 # will remove them.
216 MAKEOVERRIDES=
217
218 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
219 cd $(top_builddir) && $(MAKE) data-directory/Makefile