sim: require AC_PROG_CPP explicitly
[binutils-gdb.git] / sim / Makefile.in
1 # Makefile template for Configure for the sim library.
2 # Copyright (C) 1993-2021 Free Software Foundation, Inc.
3 # Written by Cygnus Support.
4 #
5 # This file is part of BFD, the Binary File Descriptor library.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 VPATH = @srcdir@
21 srcdir = @srcdir@
22 abs_srcdir = @abs_srcdir@
23 srcroot = $(abs_srcdir)/..
24
25 prefix = @prefix@
26 exec_prefix = @exec_prefix@
27
28 host_alias = @host_alias@
29 target_alias = @target_alias@
30 program_transform_name = @program_transform_name@
31 bindir = @bindir@
32 libdir = @libdir@
33 tooldir = $(libdir)/$(target_alias)
34
35 datarootdir = @datarootdir@
36 datadir = @datadir@
37 mandir = @mandir@
38 man1dir = $(mandir)/man1
39 man2dir = $(mandir)/man2
40 man3dir = $(mandir)/man3
41 man4dir = $(mandir)/man4
42 man5dir = $(mandir)/man5
43 man6dir = $(mandir)/man6
44 man7dir = $(mandir)/man7
45 man8dir = $(mandir)/man8
46 man9dir = $(mandir)/man9
47 infodir = @infodir@
48 includedir = @includedir@
49
50 SHELL = @SHELL@
51
52 INSTALL = @INSTALL@
53 INSTALL_PROGRAM = @INSTALL_PROGRAM@
54 INSTALL_DATA = @INSTALL_DATA@
55
56 AR = @AR@
57 AR_FLAGS = rc
58 CC = @CC@
59 CPP = @CPP@
60 CFLAGS = @CFLAGS@
61 CC_FOR_BUILD = @CC_FOR_BUILD@
62 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
63 MAKEINFO = makeinfo
64 RANLIB = @RANLIB@
65
66 SUBDIRS = @subdirs@
67
68 INCDIR = $(srcdir)/../include
69 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
70 DEP = mkdep
71
72 #### Makefile fragments come in here.
73 # @target_makefile_frag@
74 ###
75
76 # Name of the ChangeLog file.
77 ChangeLog = ChangeLog
78
79
80 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
81 echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
82 fi`
83 RUNTESTFLAGS=
84
85 FLAGS_TO_PASS = \
86 "prefix=$(prefix)" \
87 "exec_prefix=$(exec_prefix)" \
88 "bindir=$(bindir)" \
89 "mandir=$(mandir)" \
90 "libdir=$(libdir)" \
91 "against=$(against)" \
92 "AR=$(AR)" \
93 "AR_FLAGS=$(AR_FLAGS)" \
94 "CC=$(CC)" \
95 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
96 "CFLAGS=$(CFLAGS)" \
97 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
98 "RANLIB=$(RANLIB)" \
99 "MAKEINFO=$(MAKEINFO)" \
100 "INSTALL=$(INSTALL)" \
101 "INSTALL_DATA=$(INSTALL_DATA)" \
102 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
103 "RUNTEST=$(RUNTEST)" \
104 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
105 "SHELL=$(SHELL)"
106
107 # The use of $$(x_FOR_TARGET) reduces the command line length by not
108 # duplicating the lengthy definition.
109 TARGET_FLAGS_TO_PASS = \
110 "prefix=$(prefix)" \
111 "exec_prefix=$(exec_prefix)" \
112 "against=$(against)" \
113 'CC=$$(CC_FOR_TARGET)' \
114 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
115 "CFLAGS=$(CFLAGS)" \
116 "CHILLFLAGS=$(CHILLFLAGS)" \
117 'CHILL=$$(CHILL_FOR_TARGET)' \
118 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
119 "CHILL_LIB=$(CHILL_LIB)" \
120 'CXX=$$(CXX_FOR_TARGET)' \
121 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
122 "CXXFLAGS=$(CXXFLAGS)" \
123 "INSTALL=$(INSTALL)" \
124 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
125 "INSTALL_DATA=$(INSTALL_DATA)" \
126 "MAKEINFO=$(MAKEINFO)" \
127 "RUNTEST=$(RUNTEST)" \
128 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
129
130
131 all:
132 @rootme=`pwd` ; export rootme ; \
133 for dir in . `echo ${SUBDIRS} | sed 's/testsuite//'` ; do \
134 if [ "$$dir" = "." ]; then \
135 true; \
136 elif [ -d $$dir ]; then \
137 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)) || exit 1; \
138 else true; fi; \
139 done
140
141 clean mostlyclean:
142 @rootme=`pwd` ; export rootme ; \
143 for dir in . ${SUBDIRS}; do \
144 if [ "$$dir" = "." ]; then \
145 true; \
146 elif [ -d $$dir ]; then \
147 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
148 else true; fi; \
149 done
150
151 distclean maintainer-clean realclean:
152 @rootme=`pwd` ; export rootme ; \
153 for dir in . ${SUBDIRS}; do \
154 if [ "$$dir" = "." ]; then \
155 true; \
156 elif [ -d $$dir ]; then \
157 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
158 else true; fi; \
159 done
160 rm -f Makefile config.cache config.log config.status
161
162 install:
163 @rootme=`pwd` ; export rootme ; \
164 for dir in . ${SUBDIRS}; do \
165 if [ "$$dir" = "." ]; then \
166 true; \
167 elif [ -d $$dir ]; then \
168 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install) || exit 1; \
169 else true; fi; \
170 done
171
172 install-strip:
173 @rootme=`pwd` ; export rootme ; \
174 for dir in . ${SUBDIRS}; do \
175 if [ "$$dir" = "." ]; then \
176 true; \
177 elif [ -d $$dir ]; then \
178 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install-strip) || exit 1; \
179 else true; fi; \
180 done
181
182 installcheck:
183 @echo No installcheck target is available yet for the GNU simulators.
184
185 installcheck:
186
187 # The check target can not use subdir_do, because subdir_do does not
188 # use TARGET_FLAGS_TO_PASS.
189 check: force
190 @if [ -f testsuite/Makefile ]; then \
191 rootme=`pwd`; export rootme; \
192 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
193 cd testsuite; \
194 $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
195 else true; fi
196
197
198
199 info:
200 install-info:
201 dvi:
202 pdf:
203 install-pdf:
204 html:
205 install-html:
206
207 ###
208 ###
209
210 .NOEXPORT:
211 MAKEOVERRIDES=
212
213 .PHONY: check installcheck
214 check:
215 installcheck:
216
217 TAGS:
218
219 force:
220
221 Makefile: Makefile.in config.status
222 $(SHELL) ./config.status
223
224 config.status: configure
225 $(SHELL) ./config.status --recheck
226
227 # Generate nltvals.def for newlib/libgloss using devo and build tree.
228 # This file is shipped with distributions so we build in the source dir.
229 # Use `make nltvals' to rebuild.
230 # Note: If gdb releases begin to contain target header files (not a good idea,
231 # but if they did ...), nltvals.def coud be generated at build time.
232 # An alternative is to slurp in the tables at runtime.
233 .PHONY: nltvals
234 nltvals:
235 $(abs_srcdir)/common/gennltvals.py --cpp "$(CPP)" --output nltvals.def --srcroot $(srcroot) && \
236 $(SHELL) $(srcroot)/move-if-change nltvals.def $(abs_srcdir)/common/nltvals.def
237
238 # Utility to run autoconf in each directory that uses the common framework.
239 # This is intended to be invoked in $srcdir as
240 # "make -f Makefile.in autoconf-common SHELL=/bin/sh".
241 .PHONY: autoconf-common autoheader-common
242 autoconf-common autoheader-common:
243 for d in * ; \
244 do \
245 if [ -d $$d -a -f $$d/configure.ac ] ; \
246 then \
247 echo "Running autoconf in $$d ..." ; \
248 (cd $$d && autoconf --force) ; \
249 if [ $@ = autoheader-common ] && [ -f $$d/config.in ] ; \
250 then \
251 echo "Running autoheader in $$d ..." ; \
252 (cd $$d && autoheader --force) ; \
253 fi ; \
254 fi ; \
255 done
256
257 autoconf-changelog autoheader-changelog:
258 id=$(ID) ; \
259 test x$$id = x && id="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
260 name=$(NAME) ; \
261 test x$$name = x && name=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
262 host=$(HOST) ; \
263 test x$$host = x && host="`hostname`" ; \
264 date=$(DATE) ; \
265 test x$$date = x && date="`date +%Y-%m-%d`" ; \
266 echo "$$date $$name $$id@$$host" ; \
267 for d in * ; \
268 do \
269 if [ -d $$d -a -f $$d/configure.ac ] ; \
270 then \
271 echo "Creating new-$(ChangeLog) in $$d ..." ; \
272 ( echo "$$date $$name <$$id@$$host>" ; \
273 echo "" ; \
274 echo " * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
275 if [ $@ = autoheader-changelog ] ; \
276 then \
277 echo " * config.in: Ditto." ; \
278 fi ; \
279 echo "" ; \
280 cat $$d/$(ChangeLog) \
281 ) > $$d/new-$(ChangeLog) ; \
282 fi ; \
283 done
284
285 autoconf-install autoheader-install:
286 for d in * ; \
287 do \
288 if [ -d $$d -a -f $$d/configure.ac ] ; \
289 then \
290 echo "Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
291 mv $$d/new-$(ChangeLog) $$d/$(ChangeLog) ; \
292 fi ; \
293 done