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