diff --git a/.gitignore b/.gitignore index cd19ad7..d348a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ _obuild/ bin/ +doc/api/ ocp-build.root* *.cmi *.cmo diff --git a/Makefile b/Makefile index b57ab36..17c7d9d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ PROGRAMS := \ httpc_example +DOC_FORMAT := html + +DIR_DOC := doc/api/$(DOC_FORMAT) DIR_BUILD := _obuild DIR_SRC := lib @@ -13,6 +16,8 @@ MAX_BUILD_WORKERS := $(shell sysctl -n hw.ncpu) build \ clean \ deps \ + doc \ + doc_httpc \ programs \ purge @@ -33,6 +38,18 @@ build: ocp-build.root ocp-build.root: @ocp-build -init -njobs $(MAX_BUILD_WORKERS) +doc: doc_httpc + +doc_httpc: $(DIR_DOC) build + @ocamlfind ocamldoc \ + -d $(DIR_DOC) \ + -$(DOC_FORMAT) \ + -I $(DIR_BUILD)/httpc \ + $(DIR_SRC)/*.ml + +$(DIR_DOC): + @mkdir -p $(DIR_DOC) + clean: clean_bin @ocp-build clean @rm -f ocp-build.root*