Improve support for building in separate objdir (verified all individual
authorRoland Pesch <pesch@cygnus>
Tue, 10 Dec 1991 01:21:48 +0000 (01:21 +0000)
committerRoland Pesch <pesch@cygnus>
Tue, 10 Dec 1991 01:21:48 +0000 (01:21 +0000)
targets with each of GNU make and Sun make).

gdb/doc/Makefile.in
gdb/doc/gdb.texinfo

index c2cf8af..ffc6b6f 100644 (file)
@@ -125,52 +125,65 @@ de-stage3: force
        -rmdir stage3
 
 clean:
-       rm -f gdb.dvi rdl-apps.texi gdb-all* gdb.info* gdbVN.m4
+       rm -f gdb.dvi rluser.texinfo inc-hist.texi gdb-all* gdb.info* gdbVN.m4
        rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info
        rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~
 
 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
-refcard.dvi : refcard.tex
-       rm -f rcfonts.tex; cp rc-cm.tex rcfonts.tex
-       TEXINPUTS=.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log 
+refcard.dvi : $(srcdir)/refcard.tex
+       rm -f rcfonts.tex; cp $(srcdir)/rc-cm.tex rcfonts.tex
+       TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log 
        rm -f rcfonts.tex
 
 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
-refcard.ps : refcard.tex
-       rm -f rcfonts.tex; cp rc-ps.tex rcfonts.tex
-       TEXINPUTS=.:$$TEXINPUTS tex refcard.tex
+refcard.ps : $(srcdir)/refcard.tex
+       rm -f rcfonts.tex; cp $(srcdir)/rc-ps.tex rcfonts.tex
+       TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex
        dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log
        rm -f rcfonts.tex
 
-# Cover file for "Readline" appendices
-rdl-apps.texi: ${READLINE_DIR}/doc/rluser.texinfo \
-                       ${READLINE_DIR}/doc/inc-hist.texi
-       rm -f rdl-apps.texi
-       echo "@include ${READLINE_DIR}/doc/rluser.texinfo" >rdl-apps.texi
-       echo "@include ${READLINE_DIR}/doc/inc-hist.texi" >>rdl-apps.texi
+#  "Readline" appendices.  Get them here so both TeX and texi2roff can find.
+rluser.texinfo: ${READLINE_DIR}/doc/rluser.texinfo
+       ln -s ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir) || \
+       ln ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir) || \
+       cp ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir)
+
+inc-hist.texi: ${READLINE_DIR}/doc/inc-hist.texi
+       ln -s ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir) || \
+       ln ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir) || \
+       cp ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir)
 
 # File to record current GDB version number (copied from main dir Makefile.in)
-gdbVN.m4 : ${gdbdir}/Makefile.in
-       ( VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` ;\
-       echo "_define__(<_GDB_VN__>,$$VER)" > gdbVN.m4 )
+gdbVN.m4 : $(srcdir)/${gdbdir}/Makefile.in
+       VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` echo "_define__(<_GDB_VN__>,$$VER)" > $(unsubdir)/gdbVN.m4
 
 # GDB MANUAL: texinfo source, created by preprocessing w/m4
 # If you want other configs in the makefile, add or modify instructions for 
 # building source here, then change CONFIG (that way you get info, dvi, 
 # roff targets automatically for your config).
 # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
+# The nonsense with gdbVN.m4 is to get this to run with both Sun and GNU make.
+#   Note that we can *generate* gdbVN.m4, but since we distribute one in the
+#   source directory for the benefit of people who *don't* use this makefile,
+#   VPATH will often tell make not to bother building it, because the one
+#   in the srcdir is up to date.  (if not, then make should build one here).
 gdb-all.texi: ${SFILES_DOCDIR}
+       if [ ! -f ./gdbVN.m4 ]; then \
+               ln -s $(srcdir)/gdbVN.m4 . || \
+               ln $(srcdir)/gdbVN.m4 . || \
+               cp $(srcdir)/gdbVN.m4 . ; fi
        rm -f foobus.texinfo
-       ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 $(srcdir)/gdb.texinfo  >foobus.texinfo
+       ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 \
+               gdbVN.m4 $(srcdir)/gdb.texinfo  >foobus.texinfo
        rm -f gdb-all.texi
-       mv foobus.texinfo gdb-all.texi
+       mv foobus.texinfo $(unsubdir)/gdb-all.texi
 
 # GDB MANUAL: TeX dvi file
-gdb.dvi : gdb-${CONFIG}.texi rdl-apps.texi
-       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
+gdb.dvi : gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
+       TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
        texindex gdb-${CONFIG}.??
-       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
-       mv gdb-${CONFIG}.dvi gdb.dvi
+       TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
+       mv gdb-${CONFIG}.dvi $(unsubdir)/gdb.dvi
        rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.???
 
 # GDB MANUAL: info file
@@ -178,14 +191,14 @@ gdb.dvi : gdb-${CONFIG}.texi rdl-apps.texi
 # cope with all the markup.  In the meantime, we distribute the info
 # files 
 gdb.info: gdb-${CONFIG}.texi
-       $(MAKEINFO) -o gdb.info gdb-${CONFIG}.texi
+       $(MAKEINFO) -o $(unsubdir)/gdb.info gdb-${CONFIG}.texi
 
 # GDB MANUAL: roff translations
 # Try to use a recent texi2roff.  v2 was put on prep in jan91.
 # If you want an index, see texi2roff doc for postprocessing 
 # and add -i to texi2roff invocations below.
 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
-#    correspondint -e lines when later texi2roff's are current)
+#    corresponding -e lines when later texi2roff's are current)
 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
 # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
@@ -195,7 +208,7 @@ gdb.info: gdb-${CONFIG}.texi
 # gdb manual suitable for [tn]roff -mm
 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
 #   try leaving them in
-gdb.mm: gdb-${CONFIG}.texi
+gdb.mm: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
        sed -e '/\\input texinfo/d' \
                -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
                -e '/^@ifinfo/,/^@end ifinfo/d' \
@@ -211,7 +224,7 @@ gdb.mm: gdb-${CONFIG}.texi
        >gdb.mm 
 
 # gdb manual suitable for [gtn]roff -me
-gdb.me: gdb-${CONFIG}.texi
+gdb.me: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
        sed -e '/\\input texinfo/d' \
                -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
                -e '/^@ifinfo/,/^@end ifinfo/d' \
@@ -226,7 +239,7 @@ gdb.me: gdb-${CONFIG}.texi
        >gdb.me 
 
 # gdb manual suitable for [gtn]roff -ms
-gdb.ms: gdb-${CONFIG}.texi
+gdb.ms: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
        sed -e '/\\input texinfo/d' \
                -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
                -e '/^@ifinfo/,/^@end ifinfo/d' \
index f16a010..f6a1702 100644 (file)
@@ -59,7 +59,6 @@ m4; Berkeley won't do) a file suitable for formatting.  See the text in
 _1__
 
 _fi__(0)
-_include__(gdbVN.m4)_dnl__
 @c
 @ifinfo
 This file documents the GNU debugger _GDBN__.
@@ -7018,7 +7017,9 @@ things without first using the debugger to find the facts.
 @end itemize
 
 @iftex
-@include rdl-apps.texi
+@c appendices describing GNU readline.  Distributed with readline code.
+@include rluser.texinfo
+@include inc-hist.texi
 @end iftex
 
 @node Renamed Commands, Installing _GDBN__, _GDBN__ Bugs, Top