1 # Makefile template for Configure for the sim library.
2 # Copyright (C) 1993-2021 Free Software Foundation, Inc.
3 # Written by Cygnus Support.
5 # This file is part of BFD, the Binary File Descriptor library.
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.
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.
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/>.
22 abs_srcdir
= @abs_srcdir@
23 srcroot
= $(abs_srcdir
)/..
26 exec_prefix = @
exec_prefix@
28 host_alias
= @host_alias@
29 target_alias
= @target_alias@
30 program_transform_name
= @program_transform_name@
33 tooldir
= $(libdir)/$(target_alias
)
35 datarootdir
= @datarootdir@
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
48 includedir = @
includedir@
53 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
54 INSTALL_DATA
= @INSTALL_DATA@
61 CC_FOR_BUILD
= @CC_FOR_BUILD@
62 CFLAGS_FOR_BUILD
= @CFLAGS_FOR_BUILD@
68 INCDIR
= $(srcdir)/..
/include
69 CSEARCH
= -I.
-I
$(srcdir) -I
$(INCDIR
)
72 #### Makefile fragments come in here.
73 # @target_makefile_frag@
76 # Name of the ChangeLog file.
80 RUNTEST
= `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
81 echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
87 "exec_prefix=$(exec_prefix)" \
91 "against=$(against)" \
93 "AR_FLAGS=$(AR_FLAGS)" \
95 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
97 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
99 "MAKEINFO=$(MAKEINFO)" \
100 "INSTALL=$(INSTALL)" \
101 "INSTALL_DATA=$(INSTALL_DATA)" \
102 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
103 "RUNTEST=$(RUNTEST)" \
104 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
107 # The use of $$(x_FOR_TARGET) reduces the command line length by not
108 # duplicating the lengthy definition.
109 TARGET_FLAGS_TO_PASS
= \
111 "exec_prefix=$(exec_prefix)" \
112 "against=$(against)" \
113 'CC=$$(CC_FOR_TARGET)' \
114 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
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)"
132 @rootme
=`pwd` ; export rootme
; \
133 for
dir in .
`echo ${SUBDIRS} | sed 's/testsuite//'` ; do \
134 if
[ "$$dir" = "." ]; then \
136 elif
[ -d
$$dir ]; then \
137 (cd
$$dir; $(MAKE
) $(FLAGS_TO_PASS
)) || exit
1; \
142 @rootme
=`pwd` ; export rootme
; \
143 for
dir in .
${SUBDIRS}; do \
144 if
[ "$$dir" = "." ]; then \
146 elif
[ -d
$$dir ]; then \
147 (cd
$$dir; $(MAKE
) $(FLAGS_TO_PASS
) $@
) || exit
1; \
151 distclean maintainer-clean
realclean:
152 @rootme
=`pwd` ; export rootme
; \
153 for
dir in .
${SUBDIRS}; do \
154 if
[ "$$dir" = "." ]; then \
156 elif
[ -d
$$dir ]; then \
157 (cd
$$dir; $(MAKE
) $(FLAGS_TO_PASS
) $@
) || exit
1; \
160 rm -f Makefile config.cache config.log config.status
163 @rootme
=`pwd` ; export rootme
; \
164 for
dir in .
${SUBDIRS}; do \
165 if
[ "$$dir" = "." ]; then \
167 elif
[ -d
$$dir ]; then \
168 (cd
$$dir; $(MAKE
) $(FLAGS_TO_PASS
) install) || exit
1; \
173 @rootme
=`pwd` ; export rootme
; \
174 for
dir in .
${SUBDIRS}; do \
175 if
[ "$$dir" = "." ]; then \
177 elif
[ -d
$$dir ]; then \
178 (cd
$$dir; $(MAKE
) $(FLAGS_TO_PASS
) install-strip
) || exit
1; \
183 @echo No
installcheck target is available yet for the GNU simulators.
187 # The check target can not use subdir_do, because subdir_do does not
188 # use TARGET_FLAGS_TO_PASS.
190 @if
[ -f testsuite
/Makefile
]; then \
191 rootme
=`pwd`; export rootme
; \
192 rootsrc
=`cd $(srcdir); pwd`; export rootsrc
; \
194 $(MAKE
) $(TARGET_FLAGS_TO_PASS
) check; \
213 .PHONY
: check installcheck
221 Makefile
: Makefile.in config.status
222 $(SHELL
) .
/config.status
224 config.status
: configure
225 $(SHELL
) .
/config.status
--recheck
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.
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
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
:
245 if
[ -d
$$d -a
-f
$$d/configure.ac
] ; \
247 echo
"Running autoconf in $$d ..." ; \
248 (cd
$$d && autoconf
--force) ; \
249 if
[ $@
= autoheader-common
] && [ -f
$$d/config.in
] ; \
251 echo
"Running autoheader in $$d ..." ; \
252 (cd
$$d && autoheader
--force) ; \
257 autoconf-changelog autoheader-changelog
:
259 test x
$$id = x
&& id
="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
261 test x
$$name = x
&& name
=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
263 test x
$$host = x
&& host
="`hostname`" ; \
265 test x
$$date = x
&& date
="`date +%Y-%m-%d`" ; \
266 echo
"$$date $$name $$id@$$host" ; \
269 if
[ -d
$$d -a
-f
$$d/configure.ac
] ; \
271 echo
"Creating new-$(ChangeLog) in $$d ..." ; \
272 ( echo
"$$date $$name <$$id@$$host>" ; \
274 echo
" * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
275 if
[ $@
= autoheader-changelog
] ; \
277 echo
" * config.in: Ditto." ; \
280 cat
$$d/$(ChangeLog
) \
281 ) > $$d/new-
$(ChangeLog
) ; \
285 autoconf-install autoheader-install
:
288 if
[ -d
$$d -a
-f
$$d/configure.ac
] ; \
290 echo
"Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
291 mv
$$d/new-
$(ChangeLog
) $$d/$(ChangeLog
) ; \