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