sim/:
[platform/upstream/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 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
60 MAKEINFO = makeinfo
61 RANLIB = @RANLIB@
62
63 SUBDIRS = @subdirs@
64
65 INCDIR = $(srcdir)/../include
66 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
67 DEP = mkdep
68
69 #### Makefile fragments come in here.
70 # @target_makefile_frag@
71 ###
72
73 # Name of the ChangeLog file.
74 ChangeLog = ChangeLog
75
76
77 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
78                 echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
79            fi`
80 RUNTESTFLAGS=
81
82 FLAGS_TO_PASS = \
83         "prefix=$(prefix)" \
84         "exec_prefix=$(exec_prefix)" \
85         "bindir=$(bindir)" \
86         "mandir=$(mandir)" \
87         "against=$(against)" \
88         "AR=$(AR)" \
89         "AR_FLAGS=$(AR_FLAGS)" \
90         "CC=$(CC)" \
91         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
92         "CFLAGS=$(CFLAGS)" \
93         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
94         "RANLIB=$(RANLIB)" \
95         "MAKEINFO=$(MAKEINFO)" \
96         "INSTALL=$(INSTALL)" \
97         "INSTALL_DATA=$(INSTALL_DATA)" \
98         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
99         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
100         "SHELL=$(SHELL)"
101
102 # The use of $$(x_FOR_TARGET) reduces the command line length by not
103 # duplicating the lengthy definition.
104 TARGET_FLAGS_TO_PASS = \
105         "prefix=$(prefix)" \
106         "exec_prefix=$(exec_prefix)" \
107         "against=$(against)" \
108         'CC=$$(CC_FOR_TARGET)' \
109         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
110         "CFLAGS=$(CFLAGS)" \
111         "CHILLFLAGS=$(CHILLFLAGS)" \
112         'CHILL=$$(CHILL_FOR_TARGET)' \
113         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
114         "CHILL_LIB=$(CHILL_LIB)" \
115         'CXX=$$(CXX_FOR_TARGET)' \
116         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
117         "CXXFLAGS=$(CXXFLAGS)" \
118         "INSTALL=$(INSTALL)" \
119         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
120         "INSTALL_DATA=$(INSTALL_DATA)" \
121         "MAKEINFO=$(MAKEINFO)" \
122         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
123
124
125 all:
126         @rootme=`pwd` ; export rootme ; \
127         for dir in . `echo ${SUBDIRS} | sed 's/testsuite//'` ; do \
128                 if [ "$$dir" = "." ]; then \
129                         true; \
130                 elif [ -d $$dir ]; then \
131                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS)) || exit 1; \
132                 else true; fi; \
133         done
134
135 clean mostlyclean:
136         @rootme=`pwd` ; export rootme ; \
137         for dir in . ${SUBDIRS}; do \
138                 if [ "$$dir" = "." ]; then \
139                         true; \
140                 elif [ -d $$dir ]; then \
141                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
142                 else true; fi; \
143         done
144
145 distclean maintainer-clean realclean:
146         @rootme=`pwd` ; export rootme ; \
147         for dir in . ${SUBDIRS}; do \
148                 if [ "$$dir" = "." ]; then \
149                         true; \
150                 elif [ -d $$dir ]; then \
151                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
152                 else true; fi; \
153         done
154         rm -f Makefile config.cache config.log config.status
155
156 install:
157         @rootme=`pwd` ; export rootme ; \
158         for dir in . ${SUBDIRS}; do \
159                 if [ "$$dir" = "." ]; then \
160                         true; \
161                 elif [ -d $$dir ]; then \
162                         (cd $$dir; $(MAKE) $(FLAGS_TO_PASS) install) || exit 1; \
163                 else true; fi; \
164         done
165
166 installcheck:
167         @echo No installcheck target is available yet for the GNU simulators.
168
169 installcheck:
170
171 # The check target can not use subdir_do, because subdir_do does not
172 # use TARGET_FLAGS_TO_PASS.
173 check: force
174         @if [ -f testsuite/Makefile ]; then \
175           rootme=`pwd`; export rootme; \
176           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
177           cd testsuite; \
178           $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
179         else true; fi
180
181
182
183 info:
184 install-info:
185 dvi:
186
187 ### 
188 ### 
189
190 .NOEXPORT:
191 MAKEOVERRIDES=
192
193 .PHONY: check installcheck
194 check:
195 installcheck:
196
197 TAGS:
198
199 force:
200
201 Makefile: Makefile.in config.status
202         $(SHELL) ./config.status
203
204 config.status: configure
205         $(SHELL) ./config.status --recheck
206
207 # Utility to run autoconf in each directory that uses the common framework.
208 # This is intended to be invoked in $srcdir as
209 # "make -f Makefile.in autoconf-common".
210 .PHONY: autoconf-common
211 autoconf-common autoheader-common:
212         for d in * ; \
213         do \
214             if [ -d $$d -a -f $$d/configure.ac ] ; \
215             then \
216                  echo "Running autoconf in $$d ..." ; \
217                  (cd $$d && autoconf --force) ; \
218                  if [ $@ = autoheader-common ] ; \
219                  then \
220                    echo "Running autoheader in $$d ..." ; \
221                    (cd $$d && autoheader --force) ; \
222                  fi ; \
223             fi ; \
224         done
225
226 autoconf-changelog autoheader-changelog:
227         id=$(ID) ; \
228         test x$$id = x && id="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
229         name=$(NAME) ; \
230         test x$$name = x && name=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
231         host=$(HOST) ; \
232         test x$$host = x && host="`hostname`" ; \
233         date=$(DATE) ; \
234         test x$$date = x && date="`date +%Y-%m-%d`" ; \
235         echo "$$date $$name $$id@$$host" ; \
236         for d in * ; \
237         do \
238             if [ -d $$d -a -f $$d/configure.ac ] ; \
239             then \
240                  echo "Creating new-$(ChangeLog) in $$d ..." ; \
241                  ( echo "$$date  $$name  <$$id@$$host>" ; \
242                    echo "" ; \
243                    echo "       * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
244                    if [ $@ = autoheader-changelog ] ; \
245                    then \
246                      echo "     * config.in: Ditto." ; \
247                    fi ; \
248                    echo "" ; \
249                    cat $$d/$(ChangeLog) \
250                  ) > $$d/new-$(ChangeLog) ; \
251             fi ; \
252         done
253
254 autoconf-install autoheader-install:
255         for d in * ; \
256         do \
257             if [ -d $$d -a -f $$d/configure.ac ] ; \
258             then \
259                  echo "Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
260                  mv $$d/new-$(ChangeLog) $$d/$(ChangeLog) ; \
261             fi ; \
262         done