[LIP] Implicit make rules

Sandip Bhattacharya <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Organization Puroga Technologies Pvt. Ltd.
Message-ID <[email protected]>
Can I make an implicit suffix rule, where the source and destination are
in different directories?

Problem:
I am writing documentation in markdown syntax. I want the makefile to
generate html documentation to a subdirectory called html/. I have
written the following Makefile.

===============================
MKD=Markdown.pl

DOCS=html/config.html

.SUFFIXES:

.SUFFIXES: .html .mkd

.mkd.html:
        echo $@
        cat html/header.html > html/$<.html
        $(MKD) $< >> html/$<.html
        cat html/footer.html >> html/$<.html

all: $(DOCS)
===============================

This doesnt work unless I remove the "html/" from the $DOCS variable. Of
course in this case, I land up having the html files in the same
directory as the source, and also since the fresh html files are always
made in a different directory this rule will run regardless of whether
the source is updated or not.

Any ideas?

Thanks,
 Sandip

-- 
Sandip Bhattacharya  *    Puroga Technologies   *     sandip-/[email protected]
Work: http://www.puroga.com  *   Home/Blog: http://www.sandipb.net/blog

PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.