[erlang-questions] Edoc in Makefile

Richard Carlsson richardc@REDACTED
Sun Nov 23 12:48:50 CET 2008


Ali Yakout wrote:
> Hi,
>  
> Is there a way to build the index.html, overview-summary.html, etc 
> without rebuilding the modules html, I want to do this in my Makefile.
>  
> Currently I use the rule
>  
> %.html: %.erl
>     erl -noshell -run edoc_run file '"$<"' '[{dir,"../doc"}]'
>  
> Then I want to add the index build to the doc rule
>  
> doc: $(HTML)
>     # rebuild index
>  

No, sorry. But in general I recommend not using the 'file' function,
but rather 'application'. I usually use a make-dependency on the
doc/index.html or doc/edoc-info target (from all of the source files),
rather than a one-to-one dependency from .erl to .html. Since the
startup time is rather large, it is typically best to generate the
entire docs even if just one file has changed, instead of running
edoc once per source file. For example:

doc/index.html: $(SOURCES)
   erl -noshell -eval "edoc:application($(APPNAME), \".\", \
     [$(DOC_OPTS)])" -s init stop

     /Richard



More information about the erlang-questions mailing list