From 6e60003076ad9db70ecf1b46bb8d6c271a773601 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 4 Aug 2014 19:40:18 +0100 Subject: [PATCH] Generate documentation with rustdoc --- .gitignore | 3 ++- Makefile.in | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b0389edcf..20fa88f9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ libmozjs.so *~ -js \ No newline at end of file +js +/doc diff --git a/Makefile.in b/Makefile.in index e97b50931..4cb978c74 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,9 @@ AR ?= ar RUSTFLAGS ?= EXT_DEPS ?= CFLAGS += -fPIC +RUSTDOC ?= rustdoc +RUSTDOC_FLAGS ?= +RUSTDOC_TARGET ?= doc ifeq ($(shell $(CXX) -v 2>&1 | grep -c 'clang version\|Apple.*clang'),1) CFLAGS += -Wno-c++0x-extensions -Wno-return-type-c-linkage -Wno-invalid-offsetof @@ -29,6 +32,12 @@ libjsglue.a: jsglue.o jsglue.o: jsglue.cpp $(CXX) $(CFLAGS) -fno-rtti $< -o $@ -c +.PHONY: doc +doc: $(RUSTDOC_TARGET)/js/index.html + +$(RUSTDOC_TARGET)/js/index.html: js.rc $(RUST_SRC) libjsglue.a $(EXT_DEPS) + $(RUSTDOC) $(RUSTDOC_FLAGS) $< -o $(RUSTDOC_TARGET) + check: js-test ./js-test