# along with GDB; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+#### host and target dependent Makefile fragments come in here.
+##
+
+srcdir = .
+destdir = /usr/local
+
# Place to install binaries.
-bindir=/usr/local/bin
+bindir=$(destdir)/bin
# System V: If you compile gdb with a compiler which uses the coff
# encapsulation feature (this is a function of the compiler used, NOT
${srcdir}/munch ${RAPP_OBS} > rapp_init.c
${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-Makefiles= Makefile.sdir $(M_MAKEFILE) \
- ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
+Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
+
+MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in
+
+$(srcdir)/Makefile.in: $(Makefiles)
+ $(MAKE_MAKEFILE_IN)
-MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
- cat - ${Makefiles} ${srcdir}/depend >Makefile
+# with the gnu make, this is done automatically.
-Makefile: $(Makefiles)
- $(MAKE_MAKEFILE)
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
+ (cd $(srcdir) ; \
+ ./configure +destdir=$(destdir) +norecurse \
+ `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
+ $(host) +target=$(target))
-alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
+$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \
NR == 0 {printf $$0;} \
NR != 0 {printf "\\\n" $$0} \
END {printf "\n\n"}' >>alldeps.mak;
+ if [ "$(srcdir)" != "." ] ; then mv alldeps.mak $(srcdir) ; fi
rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
# The sed script makes everything which depends on {x,t}m.h depend on
-e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
-e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
-e 's; \./; $${srcdir}/;g' \
- >depend
- $(MAKE_MAKEFILE)
+ >$(srcdir)/depend
+ $(MAKE_MAKEFILE_IN)
rm depend.tmp
config.status:
# along with GDB; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+#### host and target dependent Makefile fragments come in here.
+##
+
+srcdir = .
+destdir = /usr/local
+
# Place to install binaries.
-bindir=/usr/local/bin
+bindir=$(destdir)/bin
# System V: If you compile gdb with a compiler which uses the coff
# encapsulation feature (this is a function of the compiler used, NOT
${srcdir}/munch ${RAPP_OBS} > rapp_init.c
${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-Makefiles= Makefile.sdir $(M_MAKEFILE) \
- ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
+Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
+
+MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in
+
+$(srcdir)/Makefile.in: $(Makefiles)
+ $(MAKE_MAKEFILE_IN)
-MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
- cat - ${Makefiles} ${srcdir}/depend >Makefile
+# with the gnu make, this is done automatically.
-Makefile: $(Makefiles)
- $(MAKE_MAKEFILE)
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
+ (cd $(srcdir) ; \
+ ./configure +destdir=$(destdir) +norecurse \
+ `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
+ $(host) +target=$(target))
-alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
+$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \
NR == 0 {printf $$0;} \
NR != 0 {printf "\\\n" $$0} \
END {printf "\n\n"}' >>alldeps.mak;
+ if [ "$(srcdir)" != "." ] ; then mv alldeps.mak $(srcdir) ; fi
rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
# The sed script makes everything which depends on {x,t}m.h depend on
-e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
-e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
-e 's; \./; $${srcdir}/;g' \
- >depend
- $(MAKE_MAKEFILE)
+ >$(srcdir)/depend
+ $(MAKE_MAKEFILE_IN)
rm depend.tmp
config.status:
fi
#### configure.in common parts come in here.
-# This file is a shell script fragment that supplies the information
-# necessary to tailor a template configure script into the configure
-# script appropriate for this directory. For more information, check
-# any existing configure script.
+srcname="GDB"
+srctrigger=main.c
-configdirs="libiberty bfd binutils ld gas gcc gnulib clib"
-srctrigger=README.configure
-srcname="gnu development package"
+if [ -z "${template}" ] ; then
+ make -f Makefile.dist Makefile.in
+fi
## end of common part.
fi
for i in ${configdir} ${targetspecificdirs} ; do
- if [ -r $i/configure ] ; then
- (cd $i ;
- ./configure +template=${template} ${verbose})
+ if [ -d $i ] ; then
+ if [ -r $i/configure ] ; then
+ (cd $i ;
+ ./configure +template=${template} ${verbose})
+ else
+ echo No configure script in `pwd`/$i
+ fi
else
- echo No configure script in `pwd`/$i
+ echo Warning: directory $i is missing.
fi
done
done
#### configure.in per-host parts come in here.
+if [ ! -f xconfig/${host} ]; then
+ echo "No such host ${host}"
+ exit 1
+fi
+
+targetfile=`awk '
+ $1 == "XM_FILE=" { print $2 }' <xconfig/$host`
+if [ "${targetfile}" = "/" ] ; then
+ targetfile=/dev/null
+fi
+
## end of per-host part.
#### configure.in per-target parts come in here.
+if [ ! -f tconfig/${target} ]; then
+ echo "No such target ${target}"
+ exit 1
+fi
+
+if [ -z "${removing}" ] ; then
+ cat xconfig/${host} tconfig/${target} | awk '$1 == "#msg" {
+ print substr($0,6)}'
+fi
+
+hostfile=`awk '
+ $1 == "TM_FILE=" { print $2 }' <tconfig/$target`
+if [ "${hostfile}" = "/" ] ; then
+ hostfile=/dev/null
+fi
+
+if [ ! -d readline ]; then
+ mkdir readline
+ # This could be a symlink, but getting the name right (because
+ # srcdir can be either relative or absolute) would be hairy.
+ cp ${srcdir}/readline/Makefile readline
+fi
+
+host_makefile_frag=xconfig/${host}
+target_makefile_frag=tconfig/${target}
+
+files="${hostfile} ${targetfile}"
+links="xm.h tm.h"
+
## end of per-target part.
# Temporarily, we support only direct subdir builds.
cat ${srcdir}/Makefile.in >> Makefile
# and shake thoroughly.
- host_var_file=hmake-${host}
- target_var_file=tmake-${target}
+ if [ -z "${host_makefile_frag}" ] ; then
+ host_makefile_frag=config/hmake-${host}
+ fi
+
+ if [ -z "${target_makefile_frag}" ] ; then
+ target_makefile_frag=config/tmake-${target}
+ fi
# Conditionalize the makefile for this host.
- if [ -f ${srcdir}/config/${host_var_file} ] ; then
- sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile > Makefile.tem
+ if [ -f ${srcdir}/${host_makefile_frag} ] ; then
+ sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" Makefile > Makefile.tem
mv Makefile.tem Makefile
fi
# Conditionalize the makefile for this target.
- if [ -f ${srcdir}/config/${target_var_file} ] ; then
- sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile > Makefile.tem
+ if [ -f ${srcdir}/${target_makefile_frag} ] ; then
+ sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" Makefile > Makefile.tem
mv Makefile.tem Makefile
fi
mv Makefile.tem Makefile
using=
- if [ -f ${srcdir}/config/${host_var_file} ] ; then
- using=" using \"${host_var_file}\""
+ if [ -f ${srcdir}/${host_makefile_frag} ] ; then
+ using=" using \"${host_makefile_frag}\""
fi
- if [ -f ${srcdir}/config/${target_var_file} ] ; then
+ if [ -f ${srcdir}/${target_makefile_frag} ] ; then
if [ -z "${using}" ] ; then
- andusing=" using \"${target_var_file}\""
+ andusing=" using \"${target_makefile_frag}\""
else
- andusing="${using} and \"${target_var_file}\""
+ andusing="${using} and \"${target_makefile_frag}\""
fi
else
andusing=${using}
done # for each host
if [ -n "${commons}" ] ; then
- (cd ${configdir} ;
- ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \
- | sed 's/^/ /'
+ if [ -d ${configdir} ] ; then
+ (cd ${configdir} ;
+ ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \
+ | sed 's/^/ /'
+ else
+ echo Warning: directory \"${configdir}\" is missing.
+ fi
fi # if any common hosts
if [ -n "${specifics}" ] ; then
fi # if verbose
if [ -n "${commons}" ] ; then
- (cd ${configdir} ;
- ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
- | sed 's/^/ /'
+ if [ -d ${configdir} ] ; then
+ (cd ${configdir} ;
+ ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
+ | sed 's/^/ /'
+ else
+ echo Warning: directory \"${configdir}\" is missing.
+ fi
fi # if any commons
if [ -n "${specifics}" ] ; then
#
# $Log$
-# Revision 1.3 1991/05/14 14:14:40 rich
-# see devo/configure 1.11
+# Revision 1.4 1991/05/19 00:16:45 rich
+# Configure for gdb.
#
# Revision 1.10 1991/05/04 00:58:38 rich
# Fix program name bug.
+srcname="GDB"
+srctrigger=main.c
+
+if [ -z "${template}" ] ; then
+ make -f Makefile.dist Makefile.in
+fi
+
# per-host:
+if [ ! -f xconfig/${host} ]; then
+ echo "No such host ${host}"
+ exit 1
+fi
+
+targetfile=`awk '
+ $1 == "XM_FILE=" { print $2 }' <xconfig/$host`
+if [ "${targetfile}" = "/" ] ; then
+ targetfile=/dev/null
+fi
+
# per-target:
+
+if [ ! -f tconfig/${target} ]; then
+ echo "No such target ${target}"
+ exit 1
+fi
+
+if [ -z "${removing}" ] ; then
+ cat xconfig/${host} tconfig/${target} | awk '$1 == "#msg" {
+ print substr($0,6)}'
+fi
+
+hostfile=`awk '
+ $1 == "TM_FILE=" { print $2 }' <tconfig/$target`
+if [ "${hostfile}" = "/" ] ; then
+ hostfile=/dev/null
+fi
+
+if [ ! -d readline ]; then
+ mkdir readline
+ # This could be a symlink, but getting the name right (because
+ # srcdir can be either relative or absolute) would be hairy.
+ cp ${srcdir}/readline/Makefile readline
+fi
+
+host_makefile_frag=xconfig/${host}
+target_makefile_frag=tconfig/${target}
+
+files="${hostfile} ${targetfile}"
+links="xm.h tm.h"
+