The following makefile searches the current directory for files that end in
the suffix ".texi" and apply certain suffix rules to the specified targets.

# Makefile for conversion and installation of Brightmail documentation

.SUFFIXES : .texi .info .html .man

TEXI_SRC:=${wildcard *.texi}

ROFF_TRANSLATOR = texi2roff
MACRO_PKG = -ms
SAFE_MACRO_PKG = -It
ROFF_UTIL = troff
ROFF_OPT = -a

.texi.info : # convert texinfo source files into formatted info pages
        makeinfo $< > $*.info

.info.html : # convert info files into formatted html pages
        ./info2html $< > $*.html

.texi.man : # convert texinfo source files into formatted man pages
        make ${ROFF_TRANSLATOR}
        ./${ROFF_TRANSLATOR} ${MACRO_PKG} ${SAFE_MACRO_PKG} $< |
${ROFF_UTIL} ${ROFF_OPT} ${MACRO_PKG} | col > $*.man

all : ${TEXI_SRC:.texi=.info} ${TEXI_SRC:.texi=.html} ${TEXI_SRC:.texi=.man}
install

install : ${TEXI_SRC:.texi=.info} ${TEXI_SRC:.texi=.html}
${TEXI_SRC:.texi=.man}
        mv ${TEXI_SRC:.texi=.info} /home/ssharma/docs-proj/docs/info/
        mv ${TEXI_SRC:.texi=.html} /home/ssharma/docs-proj/docs/html/
        mv ${TEXI_SRC:.texi=.man} /home/ssharma/docs-proj/docs/man/

But all the ".texi" files reside in another directory
/home/ssharma/docs-project/docs/src/. I have consulted the GNU Make User's
Manual and have attempted the following:
TEXI_SRC:=${vpath %.texi src}
instead of:
TEXI_SRC:=${wildcard *.texi}
as src is a subdirectory to the current directory.

But it seems that make isn't searching the directory "src" and leaving the
macro "TEXI_SRC" empty. If "vpath %.texi src" returns the ".texi" files from
the directory "src", shouldn't this be valid?

Sudhir Sharma



Reply via email to