2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
|
|
|
# Doc variables and rules
|
|
|
|
######################################################################
|
|
|
|
|
2012-01-13 03:10:30 +00:00
|
|
|
doc/version.md: $(MKFILE_DEPS) rust.md
|
2011-06-25 19:23:27 +00:00
|
|
|
@$(call E, version-stamp: $@)
|
|
|
|
$(Q)echo "$(CFG_VERSION)" >>$@
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2012-01-13 03:10:30 +00:00
|
|
|
doc/keywords.md: $(MKFILE_DEPS) rust.md
|
|
|
|
@$(call E, grep -v: $$@)
|
|
|
|
$(Q)grep -v '^#' $< >$@
|
|
|
|
|
|
|
|
ifdef CFG_PANDOC
|
|
|
|
|
|
|
|
doc/rust.html: rust.md doc/version.md doc/keywords.md
|
|
|
|
@$(call E, pandoc: $@)
|
|
|
|
$(Q)$(CFG_PANDOC) \
|
|
|
|
--standalone --toc \
|
|
|
|
--section-divs \
|
|
|
|
--number-sections \
|
|
|
|
--from=markdown --to=html \
|
|
|
|
--output=$@ \
|
|
|
|
$<
|
|
|
|
|
|
|
|
ifdef CFG_PDFLATEX
|
|
|
|
|
|
|
|
doc/rust.tex: rust.md doc/version.md doc/keywords.md
|
|
|
|
@$(call E, pandoc: $@)
|
|
|
|
$(Q)$(CFG_PANDOC) \
|
|
|
|
--standalone --toc \
|
|
|
|
--number-sections \
|
|
|
|
--from=markdown --to=latex \
|
|
|
|
--output=$@ \
|
|
|
|
$<
|
|
|
|
|
|
|
|
doc/rust.pdf: doc/rust.tex
|
|
|
|
@$(call E, pdflatex: $@)
|
|
|
|
$(Q)$(CFG_PDFLATEX) \
|
|
|
|
-interaction=batchmode \
|
|
|
|
-output-directory=doc \
|
|
|
|
$<
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-01-18 00:49:57 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-01-17 15:56:20 +00:00
|
|
|
ifdef CFG_NODE
|
|
|
|
|
2012-01-17 22:46:42 +00:00
|
|
|
doc/tutorial/web/index.html: \
|
|
|
|
$(wildcard $(S)doc/tutorial/*.md)
|
2012-01-18 00:49:57 +00:00
|
|
|
@$(call E, cp: $(S)doc/tutorial)
|
2012-01-17 23:47:20 +00:00
|
|
|
$(Q)cp -a $(S)doc/tutorial doc/
|
2012-01-17 22:46:42 +00:00
|
|
|
@$(call E, node: build.js)
|
2012-01-17 15:56:20 +00:00
|
|
|
$(Q)cd doc/tutorial && $(CFG_NODE) build.js
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-01-13 03:10:30 +00:00
|
|
|
|
|
|
|
ifdef CFG_LLNEXTGEN
|
|
|
|
doc/rust.g: rust.md $(S)src/etc/extract_grammar.py
|
|
|
|
@$(call E, extract_grammar: $@)
|
|
|
|
$(Q)$(S)src/etc/extract_grammar.py $< >$@
|
|
|
|
|
|
|
|
verify-grammar: doc/rust.g
|
|
|
|
@$(call E, LLnextgen: $<)
|
|
|
|
$(Q)$(CFG_LLNEXTGEN) --generate-lexer-wrapper=no $< >$@
|
|
|
|
$(Q)rm -f doc/rust.c doc/rust.h
|
|
|
|
endif
|
2011-12-30 20:47:43 +00:00
|
|
|
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2012-01-13 03:10:30 +00:00
|
|
|
GENERATED += doc/keywords.md doc/version.md
|
2011-05-01 20:18:52 +00:00
|
|
|
|
|
|
|
docsnap: doc/rust.pdf
|
2011-06-25 19:23:27 +00:00
|
|
|
@$(call E, snap: doc/rust-$(shell date +"%Y-%m-%d")-snap.pdf)
|
|
|
|
$(Q)mv $< doc/rust-$(shell date +"%Y-%m-%d")-snap.pdf
|
2011-10-24 22:25:41 +00:00
|
|
|
|
2011-12-06 00:46:37 +00:00
|
|
|
define libdoc
|
|
|
|
doc/$(1)/index.html: nd/$(1)/Languages.txt nd/$(1)/Topics.txt \
|
|
|
|
nd/$(1)/lib.css $(2)
|
|
|
|
@$$(call E, naturaldocs: $$@)
|
|
|
|
naturaldocs -i $(S)src/lib$(1) -o HTML doc/$(1) -p nd/$(1) -r -s Default lib
|
|
|
|
|
|
|
|
nd/$(1)/Languages.txt: $(S)doc/Languages.txt
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$(Q)cp $$< $$@
|
|
|
|
|
|
|
|
nd/$(1)/Topics.txt: $(S)doc/Topics.txt
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$(Q)cp $$< $$@
|
|
|
|
|
|
|
|
nd/$(1)/lib.css: $(S)doc/lib.css
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$(Q)cp $$< $$@
|
|
|
|
|
2011-12-30 20:47:43 +00:00
|
|
|
GENERATED += nd/$(1)/Languages.txt \
|
|
|
|
nd/$(1)/Topics.txt \
|
|
|
|
nd/$(1)/Menu.txt \
|
|
|
|
nd/$(1)/Data
|
|
|
|
|
2011-12-30 23:10:55 +00:00
|
|
|
DOCS += doc/$(1)/index.html nd/$(1)/lib.css
|
2011-12-30 20:47:43 +00:00
|
|
|
|
2011-12-06 00:46:37 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call libdoc,core,$(CORELIB_CRATE) $(CORELIB_INPUTS)))
|
|
|
|
$(eval $(call libdoc,std,$(STDLIB_CRATE) $(STDLIB_INPUTS)))
|
2011-12-30 20:47:43 +00:00
|
|
|
|
|
|
|
docs: $(DOCS)
|