1 # Makefile template for Configure for the sim library.
2 # Copyright (C) 1993, 1995, 1997, 1998, 2007, 2008, 2009
3 # Free Software Foundation, Inc.
4 # Written by Cygnus Support.
6 # This file is part of BFD, the Binary File Descriptor library.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 exec_prefix = @exec_prefix@
27 host_alias = @host_alias@
28 target_alias = @target_alias@
29 program_transform_name = @program_transform_name@
32 tooldir = $(libdir)/$(target_alias)
34 datarootdir = @datarootdir@
37 man1dir = $(mandir)/man1
38 man2dir = $(mandir)/man2
39 man3dir = $(mandir)/man3
40 man4dir = $(mandir)/man4
41 man5dir = $(mandir)/man5
42 man6dir = $(mandir)/man6
43 man7dir = $(mandir)/man7
44 man8dir = $(mandir)/man8
45 man9dir = $(mandir)/man9
47 includedir = @includedir@
52 INSTALL_PROGRAM = @INSTALL_PROGRAM@
53 INSTALL_DATA = @INSTALL_DATA@
59 CC_FOR_BUILD = @CC_FOR_BUILD@
60 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
66 INCDIR = $(srcdir)/../include
67 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
70 #### Makefile fragments come in here.
71 # @target_makefile_frag@
74 # Name of the ChangeLog file.
78 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
79 echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
85 "exec_prefix=$(exec_prefix)" \
89 "against=$(against)" \
91 "AR_FLAGS=$(AR_FLAGS)" \
93 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
95 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
97 "MAKEINFO=$(MAKEINFO)" \
98 "INSTALL=$(INSTALL)" \
99 "INSTALL_DATA=$(INSTALL_DATA)" \
100 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
101 "RUNTEST=$(RUNTEST)" \
102 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
105 # The use of $$(x_FOR_TARGET) reduces the command line length by not
106 # duplicating the lengthy definition.
107 TARGET_FLAGS_TO_PASS = \
109 "exec_prefix=$(exec_prefix)" \
110 "against=$(against)" \
111 'CC=$$(CC_FOR_TARGET)' \
112 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
114 "CHILLFLAGS=$(CHILLFLAGS)" \
115 'CHILL=$$(CHILL_FOR_TARGET)' \
116 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
117 "CHILL_LIB=$(CHILL_LIB)" \
118 'CXX=$$(CXX_FOR_TARGET)' \
119 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
120 "CXXFLAGS=$(CXXFLAGS)" \
121 "INSTALL=$(INSTALL)" \
122 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
123 "INSTALL_DATA=$(INSTALL_DATA)" \
124 "MAKEINFO=$(MAKEINFO)" \
125 "RUNTEST=$(RUNTEST)" \
126 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
130 @rootme=`pwd` ; export rootme ; \
131 for dir in . `echo ${SUBDIRS} | sed 's/testsuite//'` ; do \
132 if [ "$$dir" = "." ]; then \
134 elif [ -d $$dir ]; then \
135 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)) || exit 1; \
140 @rootme=`pwd` ; export rootme ; \
141 for dir in . ${SUBDIRS}; do \
142 if [ "$$dir" = "." ]; then \
144 elif [ -d $$dir ]; then \
145 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
149 distclean maintainer-clean realclean:
150 @rootme=`pwd` ; export rootme ; \
151 for dir in . ${SUBDIRS}; do \
152 if [ "$$dir" = "." ]; then \
154 elif [ -d $$dir ]; then \
155 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
158 rm -f Makefile config.cache config.log config.status
161 @rootme=`pwd` ; export rootme ; \
162 for dir in . ${SUBDIRS}; do \
163 if [ "$$dir" = "." ]; then \
165 elif [ -d $$dir ]; then \
166 (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install) || exit 1; \
171 @echo No installcheck target is available yet for the GNU simulators.
175 # The check target can not use subdir_do, because subdir_do does not
176 # use TARGET_FLAGS_TO_PASS.
178 @if [ -f testsuite/Makefile ]; then \
179 rootme=`pwd`; export rootme; \
180 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
182 $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
201 .PHONY: check installcheck
209 Makefile: Makefile.in config.status
210 $(SHELL) ./config.status
212 config.status: configure
213 $(SHELL) ./config.status --recheck
215 # Utility to run autoconf in each directory that uses the common framework.
216 # This is intended to be invoked in $srcdir as
217 # "make -f Makefile.in autoconf-common SHELL=/bin/sh".
218 .PHONY: autoconf-common autoheader-common
219 autoconf-common autoheader-common:
222 if [ -d $$d -a -f $$d/configure.ac ] ; \
224 echo "Running autoconf in $$d ..." ; \
225 (cd $$d && autoconf --force) ; \
226 if [ $@ = autoheader-common ] && [ -f $$d/config.in ] ; \
228 echo "Running autoheader in $$d ..." ; \
229 (cd $$d && autoheader --force) ; \
234 autoconf-changelog autoheader-changelog:
236 test x$$id = x && id="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
238 test x$$name = x && name=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
240 test x$$host = x && host="`hostname`" ; \
242 test x$$date = x && date="`date +%Y-%m-%d`" ; \
243 echo "$$date $$name $$id@$$host" ; \
246 if [ -d $$d -a -f $$d/configure.ac ] ; \
248 echo "Creating new-$(ChangeLog) in $$d ..." ; \
249 ( echo "$$date $$name <$$id@$$host>" ; \
251 echo " * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
252 if [ $@ = autoheader-changelog ] ; \
254 echo " * config.in: Ditto." ; \
257 cat $$d/$(ChangeLog) \
258 ) > $$d/new-$(ChangeLog) ; \
262 autoconf-install autoheader-install:
265 if [ -d $$d -a -f $$d/configure.ac ] ; \
267 echo "Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
268 mv $$d/new-$(ChangeLog) $$d/$(ChangeLog) ; \