diff --git a/Makefile b/Makefile
index d7162fe9a43..f833a99f1c8 100644
--- a/Makefile
+++ b/Makefile
@@ -358,29 +358,27 @@ test-pummel: $(builddir)/node
test-internet: $(builddir)/node
python tools/test.py internet
-# http://rtomayko.github.com/ronn
-# gem install ronn
-doc: doc/node.1 doc/api.html doc/index.html doc/changelog.html
-## HACK to give the ronn-generated page a TOC
-doc/api.html: $(builddir)/node doc/api.markdown doc/api_header.html \
- doc/api_footer.html
- build/node tools/ronnjs/bin/ronn.js --fragment doc/api.markdown \
- | sed "s/
\(.*\)<\/h2>/\1<\/h2>/g" \
- | cat doc/api_header.html - doc/api_footer.html > doc/api.html
+doc: $(builddir)/doc/api/all.html $(builddir)/doc/changelog.html
-doc/changelog.html: ChangeLog doc/changelog_header.html \
+docopen: $(builddir)/doc/api/all.html
+ -google-chrome $(builddir)/doc/api/all.html
+
+$(builddir)/doc/api/all.html: $(builddir)/node doc/api/*.markdown
+ $(builddir)/node tools/doctool/doctool.js
+
+$(builddir)/doc/changelog.html: ChangeLog doc/changelog_header.html \
doc/changelog_footer.html
- cat doc/changelog_header.html ChangeLog doc/changelog_footer.html > doc/changelog.html
+ cat doc/changelog_header.html ChangeLog doc/changelog_footer.html > $(builddir)/doc/changelog.html
-doc/node.1: $(builddir)/node doc/api.markdown all
- $(builddir)/node tools/ronnjs/bin/ronn.js --roff doc/api.markdown > doc/node.1
+$(buildir)/doc/node.1: $(builddir)/node doc/api.markdown all
+ $(builddir)/node tools/ronnjs/bin/ronn.js --roff doc/api.markdown > $(builddir)/doc/node.1
website-upload: doc
scp doc/* ryan@nodejs.org:~/web/nodejs.org/
docclean:
- @-rm -f doc/node.1 doc/api.html doc/changelog.html
+ -rm -rf $(builddir)/doc
clean:
-rm -f node node_g $(builddir)/node $(builddir)/node_g
@@ -422,4 +420,5 @@ bench-idle:
install uninstall \
dist distclean \
website-upload \
- clean docclean
+ clean docclean docopen
+