2004-04-10 Chris Demetriou <cgd@broadcom.com>
[external/binutils.git] / sim / Makefile.in
1 #    Makefile template for Configure for the sim library.
2 #    Copyright (C) 1993, 1995, 1997, 1998 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 2 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, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 VPATH = @srcdir@
22 srcdir = @srcdir@
23
24 prefix = @prefix@
25 exec_prefix = @exec_prefix@
26
27 host_alias = @host_alias@
28 target_alias = @target_alias@
29 program_transform_name = @program_transform_name@
30 bindir = @bindir@
31 libdir = @libdir@
32 tooldir = $(libdir)/$(target_alias)
33
34 datadir = @datadir@
35 mandir = @mandir@
36 man1dir = $(mandir)/man1
37 man2dir = $(mandir)/man2
38 man3dir = $(mandir)/man3
39 man4dir = $(mandir)/man4
40 man5dir = $(mandir)/man5
41 man6dir = $(mandir)/man6
42 man7dir = $(mandir)/man7
43 man8dir = $(mandir)/man8
44 man9dir = $(mandir)/man9
45 infodir = @infodir@
46 includedir = @includedir@
47
48 SHELL = @SHELL@
49
50 INSTALL = @INSTALL@
51 INSTALL_PROGRAM = @INSTALL_PROGRAM@
52 INSTALL_DATA = @INSTALL_DATA@
53
54 AR = @AR@
55 AR_FLAGS = rc
56 CC = @CC@
57 CFLAGS = @CFLAGS@
58 CC_FOR_BUILD = @CC_FOR_BUILD@
59 MAKEINFO = makeinfo
60 RANLIB = @RANLIB@
61
62 SUBDIRS = @subdirs@
63
64 INCDIR = $(srcdir)/../include
65 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
66 DEP = mkdep
67
68 # compilers to use to create programs which must be run in the build
69 # environment.
70 CC_FOR_BUILD = $(CC)
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         "against=$(against)" \
91         "AR=$(AR)" \
92         "AR_FLAGS=$(AR_FLAGS)" \
93         "CC=$(CC)" \
94         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
95         "CFLAGS=$(CFLAGS)" \
96         "RANLIB=$(RANLIB)" \
97         "MAKEINFO=$(MAKEINFO)" \
98         "INSTALL=$(INSTALL)" \
99         "INSTALL_DATA=$(INSTALL_DATA)" \
100         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
101         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
102         "SHELL=$(SHELL)"
103
104 # The use of $$(x_FOR_TARGET) reduces the command line length by not
105 # duplicating the lengthy definition.
106 TARGET_FLAGS_TO_PASS = \
107         "prefix=$(prefix)" \
108         "exec_prefix=$(exec_prefix)" \
109         "against=$(against)" \
110         'CC=$$(CC_FOR_TARGET)' \
111         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
112         "CFLAGS=$(CFLAGS)" \
113         "CHILLFLAGS=$(CHILLFLAGS)" \
114         'CHILL=$$(CHILL_FOR_TARGET)' \
115         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
116         "CHILL_LIB=$(CHILL_LIB)" \
117         'CXX=$$(CXX_FOR_TARGET)' \
118         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
119         "CXXFLAGS=$(CXXFLAGS)" \
120         "INSTALL=$(INSTALL)" \
121         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
122         "INSTALL_DATA=$(INSTALL_DATA)" \
123         "MAKEINFO=$(MAKEINFO)" \
124         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
125
126
127 all:
128         @rootme=`pwd` ; export rootme ; \
129         for dir in . `echo ${SUBDIRS} | sed 's/testsuite//'` ; do \
130                 if [ "$$dir" = "." ]; then \
131                         true; \
132                 elif [ -d $$dir ]; then \
133                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)); \
134                 else true; fi; \
135         done
136
137 clean mostlyclean:
138         @rootme=`pwd` ; export rootme ; \
139         for dir in . ${SUBDIRS}; do \
140                 if [ "$$dir" = "." ]; then \
141                         true; \
142                 elif [ -d $$dir ]; then \
143                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@); \
144                 else true; fi; \
145         done
146
147 distclean maintainer-clean realclean:
148         @rootme=`pwd` ; export rootme ; \
149         for dir in . ${SUBDIRS}; do \
150                 if [ "$$dir" = "." ]; then \
151                         true; \
152                 elif [ -d $$dir ]; then \
153                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@); \
154                 else true; fi; \
155         done
156         rm -f Makefile config.cache config.log config.status
157
158 install:
159         @rootme=`pwd` ; export rootme ; \
160         for dir in . ${SUBDIRS}; do \
161                 if [ "$$dir" = "." ]; then \
162                         true; \
163                 elif [ -d $$dir ]; then \
164                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install); \
165                 else true; fi; \
166         done
167
168 installcheck:
169         @echo No installcheck target is available yet for the GNU simulators.
170
171 installcheck:
172
173 # The check target can not use subdir_do, because subdir_do does not
174 # use TARGET_FLAGS_TO_PASS.
175 check: force
176         @if [ -f testsuite/Makefile ]; then \
177           rootme=`pwd`; export rootme; \
178           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
179           cd testsuite; \
180           $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
181         else true; fi
182
183
184
185 info:
186 install-info:
187 dvi:
188
189 ### 
190 ### 
191
192 .NOEXPORT:
193 MAKEOVERRIDES=
194
195 .PHONY: check installcheck
196 check:
197 installcheck:
198
199 TAGS:
200
201 force:
202
203 Makefile: Makefile.in config.status
204         $(SHELL) ./config.status
205
206 config.status: configure
207         $(SHELL) ./config.status --recheck
208
209 # Utility to run autoconf in each directory that uses the common framework.
210 # This is intended to be invoked in $srcdir as
211 # "make -f Makefile.in autoconf-common".
212 .PHONY: autoconf-common
213 autoconf-common autoheader-common:
214         for d in * ; \
215         do \
216             if [ -d $$d -a -f $$d/configure.in ] ; \
217             then \
218                  echo "Running autoconf in $$d ..." ; \
219                  (cd $$d && autoconf) ; \
220                  if [ $@ = autoheader-common ] ; \
221                  then \
222                    echo "Running autoheader in $$d ..." ; \
223                    (cd $$d && autoheader) ; \
224                  fi ; \
225             fi ; \
226         done
227
228 autoconf-changelog autoheader-changelog:
229         id=$(ID) ; \
230         test x$$id = x && id="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
231         name=$(NAME) ; \
232         test x$$name = x && name=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
233         host=$(HOST) ; \
234         test x$$host = x && host="`hostname`" ; \
235         date=$(DATE) ; \
236         test x$$date = x && date="`date +%Y-%m-%d`" ; \
237         echo "$$date $$name $$id@$$host" ; \
238         for d in * ; \
239         do \
240             if [ -d $$d -a -f $$d/configure.in ] ; \
241             then \
242                  echo "Creating new-$(ChangeLog) in $$d ..." ; \
243                  ( echo "$$date  $$name  <$$id@$$host>" ; \
244                    echo "" ; \
245                    echo "       * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
246                    if [ $@ = autoheader-changelog ] ; \
247                    then \
248                      echo "     * config.in: Ditto." ; \
249                    fi ; \
250                    echo "" ; \
251                    cat $$d/$(ChangeLog) \
252                  ) > $$d/new-$(ChangeLog) ; \
253             fi ; \
254         done
255
256 autoconf-install autoheader-install:
257         for d in * ; \
258         do \
259             if [ -d $$d -a -f $$d/configure.in ] ; \
260             then \
261                  echo "Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
262                  mv $$d/new-$(ChangeLog) $$d/$(ChangeLog) ; \
263             fi ; \
264         done