* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / Makefile.in
index db65ef9a7f208665589717ede9f1a7b06b8016e8..ad56df94eb36f8d89ca285e1582c537e604f9daa 100644 (file)
@@ -109,11 +109,11 @@ MMALLOC_LIB = ./../mmalloc${subdir}/libmmalloc.a
 #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}.)
@@ -174,11 +174,19 @@ VERSION = 4.9.1
 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
@@ -296,7 +304,7 @@ SFILES = ${srcdir}/blockframe.c ${srcdir}/breakpoint.c ${srcdir}/buildsym.c \
   ${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 \
@@ -342,7 +350,7 @@ HFILES = ${srcdir}/breakpoint.h ${srcdir}/buildsym.h ${srcdir}/call-cmds.h \
        ${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 \
@@ -367,7 +375,13 @@ TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
 # 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} 
@@ -386,7 +400,7 @@ OBS = version.o main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
     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)
 
@@ -448,7 +462,7 @@ gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
          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
@@ -487,13 +501,15 @@ rapp: $(RAPP_OBS)
 # "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" ; \
             } \
@@ -539,8 +555,8 @@ depend: $(SOURCES) Makefile.in
        @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.
@@ -574,6 +590,8 @@ depend: $(SOURCES) Makefile.in
          -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'  \
@@ -589,7 +607,10 @@ depend: $(SOURCES) Makefile.in
 # 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 \
@@ -599,13 +620,13 @@ depend: $(SOURCES) Makefile.in
          -e 'g' \
          -e '/:.*\.tab\.c/d' \
          -e 's/.*:\(.*\.c\).*/ $${CC} -c $${INTERNAL_CFLAGS} \1/' \
-         -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;
@@ -694,6 +715,8 @@ setup-to-dist: update-depend force_update
 # 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
 
@@ -756,23 +779,28 @@ clean:
        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 ; \
@@ -811,6 +839,8 @@ copying.c: ${srcdir}/COPYING ${srcdir}/copying.awk
 
 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.
@@ -828,8 +858,9 @@ c-exp.tab.c: $(srcdir)/c-exp.y $(srcdir)/Makefile.in
             -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.
@@ -844,8 +875,9 @@ ch-exp.tab.c: $(srcdir)/ch-exp.y $(srcdir)/Makefile.in
             -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.
@@ -860,21 +892,12 @@ m2-exp.tab.c: $(srcdir)/m2-exp.y $(srcdir)/Makefile.in
             -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
-# Used on RS6000 native.
-# This rule fails to get automatically generated in depend if
-# sys/ldr.h does not exist.  (FIXME)
-xcoffexec.o: ${srcdir}/xcoffexec.c
-       ${CC} -c ${INTERNAL_CFLAGS} -I${BFD_DIR} ${srcdir}/xcoffexec.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) \
This page took 0.026355 seconds and 4 git commands to generate.