#MMALLOC_CHECK = -DNO_MMALLOC_CHECK
MMALLOC_CFLAGS = ${MMALLOC_CHECK} ${MMALLOC_DISABLE}
-# Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
-# (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${subdir}/libbfd.a
+# Where are the source and binary directories for the BFD library?
+BFD_SRC_DIR = ${srcdir}/../bfd
+BFD_OBJ_DIR = ./../bfd${subdir}
+BFD_DEP = $$(BFD_SRC_DIR)
+BFD_LIB = $(BFD_OBJ_DIR)/libbfd.a
# Where is the source dir for the READLINE library? Traditionally in .. or .
# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
# Libraries and corresponding dependencies for compiling gdb.
# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
# TERMCAP comes after readline, since readline depends on it.
+# If you have the Cygnus libraries installed,
+# you can use 'CLIBS=${INSTALLED_LIBS}' 'CDEPS='
+INSTALLED_LIBS=-lbfd -lreadline ${TERMCAP} -lopcodes -lmmalloc \
+ -liberty ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} \
${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
DIST=gdb
LINT=/usr/5bin/lint
-LINTFLAGS= -I${BFD_DIR}
+LINTFLAGS= -I${BFD_SRC_DIR} -I${BFD_OBJ_DIR}
RUNTEST=runtest
RUNTESTFLAGS=
+# This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX
+# interface to the serial port. Hopefully if get ported to OS/2, VMS,
+# etc., then there will be (as part of the C library or perhaps as
+# part of libiberty) a POSIX interface. But at least for now the
+# host-dependent makefile fragment might need to use something else
+# besides ser-unix.o
+SER_HARDWIRE=ser-unix.o
+
# Host and target-dependent makefile fragments come in here.
####
# End of host and target-dependent makefile fragments
${srcdir}/target.c ${srcdir}/typeprint.c ${srcdir}/utils.c \
${srcdir}/valarith.c \
${srcdir}/valops.c ${srcdir}/valprint.c ${srcdir}/values.c \
- ${srcdir}/serial.c ${srcdir}/ser-go32.c ${srcdir}/ser-unix.c
+ ${srcdir}/serial.c ${srcdir}/ser-unix.c
# Files that are not source code, but need to go into gdb-$(VERSION).tar.Z.
NONSRC = ${srcdir}/Makefile.in ${srcdir}/depend ${srcdir}/alldeps.mak \
${srcdir}/config/sparc/xm-sparc.h \
${srcdir}/config/xm-sysv4.h ${srcdir}/config/vax/xm-vax.h \
${srcdir}/config/nm-trash.h ${srcdir}/29k-share/udi/udiids.h \
- ${srcdir}/29k-share/udi/udiphcfg.h ${srcdir}/29k-share/udi/udiphsun.h \
+ ${srcdir}/29k-share/udi/udiphcfg.h ${srcdir}/29k-share/udi/udiphunix.h \
${srcdir}/29k-share/udi/udiproc.h ${srcdir}/29k-share/udi/udipt29k.h \
${srcdir}/29k-share/udi/udiptcfg.h ${srcdir}/29k-share/udi/udisoc.h \
${srcdir}/29k-share/udi_soc ${srcdir}/nindy-share/b.out.h \
# gdb-xxx.tar.Z:
TARDIRS = doc sparclite # tests
-DEPFILES = ${TDEPFILES} ${XDEPFILES} ${NATDEPFILES}
+# {X,T,NAT}DEPFILES are something of a pain in that it's hard to
+# default their values the way we do for SER_HARDWIRE; in the future
+# maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
+# variables analogous to SER_HARDWIRE which get defaulted in this
+# Makefile.in
+
+DEPFILES = ${TDEPFILES} ${XDEPFILES} ${SER_HARDWIRE} ${NATDEPFILES}
SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
stabsread.o core.o c-lang.o ch-lang.o m2-lang.o complaints.o \
typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o \
- serial.o ser-hardwire.o
+ serial.o
RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
init.o $(OBS) $(TSOBS) $(ADD_FILES) $(CLIBS) $(LOADLIBES)
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
- #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
+ #setopt load_flags $(CFLAGS) -I$(BFD_SRC_DIR) -I${BFD_OBJ_DIR} -DHOST_SYS=SUN4_SYS
#load ./init.c $(SFILES)
#unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/ch-exp.y
#unload ${srcdir}/vx-share/*.h
# "make" variable definitions for all ALLDEPFILES, ALLPARAM, and ALLCONFIG,
# all cadged from the current contents of the config subtree.
+# using sort and uniq is not a violation of the GNU coding standards
+# because this rule is not part of building and installing GDB.
alldeps.mak: force
rm -f alldeps.mak alldeps*.tmp allparam*.tmp allconfig*.tmp
for i in `(cd ${srcdir}; find config -name '*.m[ht]' -print)` ; do \
echo $$i >>allconfig.tmp; \
awk <${srcdir}/$$i ' \
$$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" \
- || $$1 == "NATDEPFILES=" { \
+ || $$1 == "NATDEPFILES=" || $$1 == "SER_HARDWIRE=" { \
for (i = 2; i <= NF; i++) \
print $$i >> "alldeps.tmp" ; \
} \
@echo Ignore errors about non-existent system-supplied include files
@echo for systems other than the one you are using.
@echo Also ignore any errors in arm-convert.s.
- -$(GCC) -MM -nostdinc -I/usr/include -I${BFD_DIR} \
- -I${READLINE_DIR} $(INTERNAL_CFLAGS) \
+ -$(GCC) -MM -nostdinc -I/usr/include -I${BFD_SRC_DIR} \
+ -I${BFD_OBJ_DIR} -I${READLINE_DIR} $(INTERNAL_CFLAGS) \
`ls $(SOURCES) | grep -v '\.[hy]$$' | \
sort -u` >depend.tmp
#BEGIN COMMENTED OUT CODE -- this should now be taken care of below.
-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; $(BFD_DEP)/bfd\.h; ../bfd/bfd.h;g' \
+ -e 's; $(INCLUDE_DEP)/../bfd/bfd\.h; ../bfd/bfd.h;g' \
-e 's; \./xm.h; xm.h config.status;g' \
-e 's; \./tm.h; tm.h config.status;g' \
-e 's; \./nm.h; nm.h config.status;g' \
# There is one exception: the *.tab.c files can exist either in srcdir
# or in ., so make sure not to use an explicit rule for them.
#
-# Adding -I${BFD_DIR} is required for all the files which use BFD internals
+# Adding -I${BFD_SRC_DIR} and -I${BFD_OBJ_DIR} is required for all the files
+# which use BFD internals. This is because some bfd include files are in the
+# source directory, and some (bfd.h for example) are generated in the bfd
+# build directory.
# Adding -I${READLINE_DIR} is required because the readline header files
# are in readline not in include. They probably should be moved.
<depend.tm3 sed \
-e 'g' \
-e '/:.*\.tab\.c/d' \
-e 's/.*:\(.*\.c\).*/ $${CC} -c $${INTERNAL_CFLAGS} \1/' \
- -e 's;$${srcdir}/xcoffexec.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/xcoffread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/stabsread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/dwarfread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/elfread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/mipsread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/coffread.c;-I$${BFD_DIR} &;' \
- -e 's;$${srcdir}/dbxread.c;-I$${BFD_DIR} &;' \
+ -e 's;$${srcdir}/xcoffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/stabsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/dwarfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/elfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/mipsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/coffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
+ -e 's;$${srcdir}/dbxread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
-e 's;$${srcdir}/main.c;-I$${READLINE_DIR} &;' \
-e ': end' \
>depend.tm4;
# of files to be checked for dependencies.
update-depend: update-alldeps force_update
../configure none -norecursion
+ (cd ../bfd; ../configure sun4 -norecursion; rm -f stmp-bfd.h)
+ (cd ../bfd; $(MAKE) $(MFLAGS) bfd.h)
rm -f depend
$(MAKE) $(MFLAGS) depend
rm -f gdb core make.log
rm -f gdb[0-9]
-distclean: clean c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
+# This used to depend on c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
+# I believe this is wrong; the makefile standards for distclean just
+# describe removing files; the only sort of "re-create a distribution"
+# functionality described is if the distributed files are unmodified.
+distclean: clean
@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do
- rm -f tm.h xm.h config.status
+ rm -f nm.h tm.h xm.h config.status
rm -f y.output yacc.acts yacc.tmp
rm -f ${TESTS} Makefile depend
realclean: clean
@$(MAKE) $(FLAGS_TO_PASS) DO=realclean "DODIRS=$(SUBDIRS)" subdir_do
rm -f c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f Makefile depend
+ rm -f nm.h tm.h xm.h config.status
+ rm -f y.output yacc.acts yacc.tmp
+ rm -f ${TESTS} Makefile depend
STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
subdir_do: force
@for i in $(DODIRS); do \
- if [ -d ./$$i ] ; then \
+ if [ -f ./$$i/Makefile ] ; then \
if (cd ./$$i; \
$(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
else exit 1 ; fi ; \
version.c: Makefile
echo 'char *version = "$(VERSION)";' >version.c
+ echo 'char *host_canonical = "$(host_canonical)";' >> version.c
+ echo 'char *target_canonical = "$(target_canonical)";' >> version.c
# c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
# in srcdir, then compiled in target dir to c-exp.tab.o.
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- < y.tab.c > ././c-exp.tab.c
+ < y.tab.c > c-exp.new
-rm y.tab.c
+ mv c-exp.new ././c-exp.tab.c
# ch-exp.tab.c is generated in target dir from ch-exp.y if it doesn't exist
# in srcdir, then compiled in target dir to ch-exp.tab.o.
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- < y.tab.c > ././ch-exp.tab.c
+ < y.tab.c > ch-exp.new
-rm y.tab.c
+ mv ch-exp.new ././ch-exp.tab.c
# m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
# in srcdir, then compiled in target dir to m2-exp.tab.o.
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- < y.tab.c > ././m2-exp.tab.c
+ < y.tab.c > m2-exp.new
-rm y.tab.c
+ mv m2-exp.new ././m2-exp.tab.c
-# Used on HP-PA native.
-# This rule fails to get automatically generated in depend because gcc -MM
-# ends up trying to include ../bfd/sysdep.h, which does not exist in an
-# unconfigured BFD directory, and the resulting error suppresses the
-# output of dependency information. For now, just punt. (FIXME)
-paread.o: ${srcdir}/paread.c
- ${CC} -c ${INTERNAL_CFLAGS} -I$(BFD_DIR) ${srcdir}/paread.c
+# These files are updated atomically, so make never has to remove them
+.PRECIOUS: m2-exp.tab.c ch-exp.tab.c c-exp.tab.c
lint: $(LINTFILES)
$(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \