# 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 = .
+# Destination directory of the software tree build
destdir = /usr/local
-# Place to install binaries.
+# Place to install binaries in the destination tree.
bindir=$(destdir)/bin
# System V: If you compile gdb with a compiler which uses the coff
# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
BFD_DIR = ${srcdir}/../bfd
BFD_DEP = $$(BFD_DIR)
+BFD_LIB = $(BFD_DIR)${subdir}/libbfd.a
-# the parent of the directory in which live the readline headers.
-READLINE_DIR = ${srcdir}/..
-RL_LIB = $(READLINE_DIR)/readline${subdir}/libreadline.a
-RL_LIB_DEP = $(RL_LIB)
+# Where is the source dir for the READLINE library? Traditionally in .. or .
+# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
+READLINE_DIR = ${srcdir}/../readline
+READLINE_DEP = $$(READLINE_DIR)
+RL_LIB = $(READLINE_DIR)${subdir}/libreadline.a
# All the includes used for CFLAGS and for lint.
# -I. for config files.
# You may need to make other arrangements for USG.
TERMCAP = -ltermcap
-# You must define REGEX and REGEX1 on USG machines.
+# The xconfig file must define REGEX and REGEX1 on USG machines.
# If your sysyem is missing alloca(), or, more likely, it's there but
-# it doesn't work, define ALLOCA & ALLOCA1
+# it doesn't work, define ALLOCA & ALLOCA1 too.
-# {X,T}M_CLIBS, if defined, has system-dependent libs
-# For example, -lPW for System V to get alloca().
-# FIXME STOPGAP FOR BFD LIBRARY: BFD stuff
-CLIBS = ${TERMCAP} $(XM_CLIBS) ${TM_CLIBS} ${BFD_DIR}${subdir}/libbfd.a \
- ${LIBIBERTY} ${READLINE}
-CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_DIR}${subdir}/libbfd.a \
- ${LIBIBERTY} ${READLINE}
+# Libraries and corresponding dependencies for compiling gdb.
+# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
+# TERMCAP comes last, since readline depends on it.
+CLIBS = $(XM_CLIBS) ${TM_CLIBS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} ${TERMCAP}
+CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC}
ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
value.h
-OPCODES = $(INCLUDE_DIR)/pn-opcode.h $(INCLUDE_DIR)/np1-opcode.h \
- $(INCLUDE_DIR)/sparc-opcode.h $(INCLUDE_DIR)/vax-opcode.h \
- $(INCLUDE_DIR)/m68k-opcode.h $(INCLUDE_DIR)/ns32k-opcode.h \
- $(INCLUDE_DIR)/convx-opcode.h $(INCLUDE_DIR)/pyr-opcode.h \
- $(INCLUDE_DIR)/mips-opcode.h $(INCLUDE_DIR)/am29k-opcode.h
+# Header files for machine opcode tables.
+# when OPCODE_DIR changes to ../include, remove the whole $(OPCODES)
+# business, since they will be included in the separate includes tar file
+# rather than in the gdb tar file.
+OPCODE_DIR =
+OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \
+ $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \
+ $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \
+ $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \
+ $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h
REMOTE_EXAMPLES = rem-m68k.shar rem-multi.shar
init.c: $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS)
$(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
-gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB_DEP} ${CDEPS} init.o
+gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
- ${RL_LIB} $(CLIBS)
+ $(CLIBS)
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
#setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
#load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
#load ${LIBIBERTY_DIR}/*.c
#load ${BFD_DIR}/*.c
+ #load ${READLINE_DIR}/*.c
#load -ltermcap
##void mcheck(a) void (*a)(); { }
##void mtrace() { }
${srcdir}/munch ${RAPP_OBS} > rapp_init.c
${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-
-MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in
-
-$(srcdir)/Makefile.in: $(Makefiles)
- $(MAKE_MAKEFILE_IN)
+# Support for building Makefile out of configured pieces, automatically
+# generated dependencies, etc.
+Makefiles= Makefile.sdir $(M_MAKEFILE) \
+ ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-# with the gnu make, this is done automatically.
+MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
+ cat - ${Makefiles} ${srcdir}/depend > Makefile
-Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
- (cd $(srcdir) ; \
- ./configure +destdir=$(destdir) +norecurse \
- `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
- $(host) +target=$(target))
+Makefile: $(Makefiles)
+ $(MAKE_MAKEFILE)
-$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
+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
@echo can safely be ignored.
@echo Also ignore parse errors in valops.c, and any errors in
@echo arm-convert.s.
- -$(GCC) -MM $(CFLAGS) -I$(READLINE_DIR) -I$(BFD_DIR) \
- `ls $(SOURCES) | sort -u` >depend.tmp
+ -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
+ `ls $(SOURCES) | grep -v \.h$$ |sort -u` >depend.tmp
<depend.tmp sed -e 's/ [xt]m.h/& config.status/g' \
-e 's; vx-share/; $${srcdir}/vx-share/;g' \
-e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
-e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
+ -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
-e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
-e 's; \./; $${srcdir}/;g' \
- >$(srcdir)/depend
- $(MAKE_MAKEFILE_IN)
+ >depend
+ $(MAKE_MAKEFILE)
rm depend.tmp
config.status:
xm-sun4os4.h : xm-sparc.h
tm-sun4os4.h : tm-sparc.h
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB_DEP}
+kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
rm -f init.c
$(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
$(CC) $(LDFLAGS) -c init.c $(CLIBS)
ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- ${RL_LIB} -lc $(CLIBS)
+ -lc $(CLIBS)
# Put the proper machine-specific files first.
# createtags will edit the .o in DEPFILES into .c
rm -f gdb core gdb.tar gdb.tar.Z make.log
rm -f gdb[0-9]
rm -f gdb.dvi gdb-all*
-# cd readline ; make clean
distclean: clean expread.tab.c TAGS
rm -f tm.h xm.h 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 = .
+# Destination directory of the software tree build
destdir = /usr/local
-# Place to install binaries.
+# Place to install binaries in the destination tree.
bindir=$(destdir)/bin
# System V: If you compile gdb with a compiler which uses the coff
# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
BFD_DIR = ${srcdir}/../bfd
BFD_DEP = $$(BFD_DIR)
+BFD_LIB = $(BFD_DIR)${subdir}/libbfd.a
-# the parent of the directory in which live the readline headers.
-READLINE_DIR = ${srcdir}/..
-RL_LIB = $(READLINE_DIR)/readline${subdir}/libreadline.a
-RL_LIB_DEP = $(RL_LIB)
+# Where is the source dir for the READLINE library? Traditionally in .. or .
+# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
+READLINE_DIR = ${srcdir}/../readline
+READLINE_DEP = $$(READLINE_DIR)
+RL_LIB = $(READLINE_DIR)${subdir}/libreadline.a
# All the includes used for CFLAGS and for lint.
# -I. for config files.
# You may need to make other arrangements for USG.
TERMCAP = -ltermcap
-# You must define REGEX and REGEX1 on USG machines.
+# The xconfig file must define REGEX and REGEX1 on USG machines.
# If your sysyem is missing alloca(), or, more likely, it's there but
-# it doesn't work, define ALLOCA & ALLOCA1
+# it doesn't work, define ALLOCA & ALLOCA1 too.
-# {X,T}M_CLIBS, if defined, has system-dependent libs
-# For example, -lPW for System V to get alloca().
-# FIXME STOPGAP FOR BFD LIBRARY: BFD stuff
-CLIBS = ${TERMCAP} $(XM_CLIBS) ${TM_CLIBS} ${BFD_DIR}${subdir}/libbfd.a \
- ${LIBIBERTY} ${READLINE}
-CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_DIR}${subdir}/libbfd.a \
- ${LIBIBERTY} ${READLINE}
+# Libraries and corresponding dependencies for compiling gdb.
+# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
+# TERMCAP comes last, since readline depends on it.
+CLIBS = $(XM_CLIBS) ${TM_CLIBS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} ${TERMCAP}
+CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC}
ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
value.h
-OPCODES = $(INCLUDE_DIR)/pn-opcode.h $(INCLUDE_DIR)/np1-opcode.h \
- $(INCLUDE_DIR)/sparc-opcode.h $(INCLUDE_DIR)/vax-opcode.h \
- $(INCLUDE_DIR)/m68k-opcode.h $(INCLUDE_DIR)/ns32k-opcode.h \
- $(INCLUDE_DIR)/convx-opcode.h $(INCLUDE_DIR)/pyr-opcode.h \
- $(INCLUDE_DIR)/mips-opcode.h $(INCLUDE_DIR)/am29k-opcode.h
+# Header files for machine opcode tables.
+# when OPCODE_DIR changes to ../include, remove the whole $(OPCODES)
+# business, since they will be included in the separate includes tar file
+# rather than in the gdb tar file.
+OPCODE_DIR =
+OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \
+ $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \
+ $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \
+ $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \
+ $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h
REMOTE_EXAMPLES = rem-m68k.shar rem-multi.shar
init.c: $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS)
$(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
-gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB_DEP} ${CDEPS} init.o
+gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
- ${RL_LIB} $(CLIBS)
+ $(CLIBS)
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
#setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
#load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
#load ${LIBIBERTY_DIR}/*.c
#load ${BFD_DIR}/*.c
+ #load ${READLINE_DIR}/*.c
#load -ltermcap
##void mcheck(a) void (*a)(); { }
##void mtrace() { }
${srcdir}/munch ${RAPP_OBS} > rapp_init.c
${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-
-MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in
-
-$(srcdir)/Makefile.in: $(Makefiles)
- $(MAKE_MAKEFILE_IN)
+# Support for building Makefile out of configured pieces, automatically
+# generated dependencies, etc.
+Makefiles= Makefile.sdir $(M_MAKEFILE) \
+ ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-# with the gnu make, this is done automatically.
+MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
+ cat - ${Makefiles} ${srcdir}/depend > Makefile
-Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
- (cd $(srcdir) ; \
- ./configure +destdir=$(destdir) +norecurse \
- `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
- $(host) +target=$(target))
+Makefile: $(Makefiles)
+ $(MAKE_MAKEFILE)
-$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
+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
@echo can safely be ignored.
@echo Also ignore parse errors in valops.c, and any errors in
@echo arm-convert.s.
- -$(GCC) -MM $(CFLAGS) -I$(READLINE_DIR) -I$(BFD_DIR) \
- `ls $(SOURCES) | sort -u` >depend.tmp
+ -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
+ `ls $(SOURCES) | grep -v \.h$$ |sort -u` >depend.tmp
<depend.tmp sed -e 's/ [xt]m.h/& config.status/g' \
-e 's; vx-share/; $${srcdir}/vx-share/;g' \
-e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
-e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
+ -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
-e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
-e 's; \./; $${srcdir}/;g' \
- >$(srcdir)/depend
- $(MAKE_MAKEFILE_IN)
+ >depend
+ $(MAKE_MAKEFILE)
rm depend.tmp
config.status:
xm-sun4os4.h : xm-sparc.h
tm-sun4os4.h : tm-sparc.h
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB_DEP}
+kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
rm -f init.c
$(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
$(CC) $(LDFLAGS) -c init.c $(CLIBS)
ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- ${RL_LIB} -lc $(CLIBS)
+ -lc $(CLIBS)
# Put the proper machine-specific files first.
# createtags will edit the .o in DEPFILES into .c
rm -f gdb core gdb.tar gdb.tar.Z make.log
rm -f gdb[0-9]
rm -f gdb.dvi gdb-all*
-# cd readline ; make clean
distclean: clean expread.tab.c TAGS
rm -f tm.h xm.h config.status