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