9482a37533
On Thu, Feb 17, 2011 at 12:09:16PM +0100, Sebastian Spaeth wrote: > still a bug in make docs that I only discovered today. > > our Makefile contains > > type rst2html 2>/dev/null && echo rst2html || echo rst2html.py > > which outputs on my box: > > rst2html is /usr/bin/rst2html > rst2html > > which will break things. So either we need to suppres STDOUT too: > > type rst2html >/dev/null 2>&1 && echo rst2html || echo rst2html.py > > (which works), or we could use `which rst2html` (which returns 0 if the > command exists) and outputs the proper path. Reported-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
27 lines
653 B
Makefile
27 lines
653 B
Makefile
# This program is free software under the terms of the GNU General Public
|
|
# License. See the COPYING file which must come with this package.
|
|
|
|
SOURCES = $(wildcard *.rst)
|
|
HTML_TARGETS = $(patsubst %.rst,%.html,$(SOURCES))
|
|
|
|
RM = rm
|
|
RST2HTML=`type rst2html 2>/dev/null 2>&1 && echo rst2html || echo rst2html.py`
|
|
RST2MAN=`type rst2man 2>/dev/null 2>&1 && echo rst2man || echo rst2man.py`
|
|
|
|
all: html
|
|
|
|
html: $(HTML_TARGETS)
|
|
|
|
$(HTML_TARGETS): %.html : %.rst
|
|
$(RST2HTML) $? $@
|
|
|
|
man: offlineimap.1
|
|
|
|
offlineimap.1: MANUAL.rst
|
|
$(RST2MAN) MANUAL.rst offlineimap.1
|
|
cp -f offlineimap.1 ..
|
|
|
|
clean:
|
|
$(RM) -f $(HTML_TARGETS)
|
|
$(RM) -f offlineimap.1 ../offlineimap.1
|