Commit | Line | Data |
---|---|---|
feec80c3 C |
1 | ifneq ($(MAKECMDGOALS),distclean) |
2 | include ../Makefile.config | |
3 | endif | |
4 | ||
993936c0 C |
5 | DEST=../docs |
6 | FLAGS=$(INCLUDES) -hide Pervasives | |
7 | HTMLFLAGS=-all-params -colorize-code | |
f3c4ece6 | 8 | MANFLAGS=-man-mini |
993936c0 | 9 | |
feec80c3 | 10 | .PHONY: doc |
f3c4ece6 C |
11 | |
12 | doc: html man | |
993936c0 | 13 | |
feec80c3 | 14 | html: $(DEST)/html/index.html |
abad11c5 C |
15 | man: $(DEST)/man/Coccilib.3o |
16 | ||
17 | ifneq ($(FEATURE_OCAMLBUILD),yes) | |
18 | $(DEST)/man/Coccilib.3o: coccilib.cmi ../parsing_c/ast_c.cmi | |
19 | $(MKDIR_P) $(DEST)/man | |
20 | $(OCAMLDOC) $(FLAGS) -hide Exposed_modules \ | |
21 | -man $(MANFLAGS) -d $(DEST)/man ../parsing_c/ast_c.ml coccilib.ml | |
22 | ||
23 | $(DEST)/html/index.html: coccilib.cmi ../parsing_c/ast_c.cmi | |
feec80c3 | 24 | $(MKDIR_P) $(DEST)/html |
abad11c5 C |
25 | $(OCAMLDOC) $(FLAGS) -hide Exposed_modules \ |
26 | -html $(HTMLFLAGS) -d $(DEST)/html ../parsing_c/ast_c.ml coccilib.ml | |
27 | else | |
993936c0 | 28 | |
abad11c5 | 29 | $(DEST)/man/Coccilib.3o: ../_build/ocaml/coccilib.cmi coccilib.ml exposed_modules.ml man.odocl |
feec80c3 | 30 | $(MKDIR_P) $(DEST)/man |
abad11c5 C |
31 | cd .. && $(OCAMLBUILD) ocaml/man.docdir/index.html |
32 | cp -r ../_build/ocaml/man.docdir/* $(DEST)/man/ | |
33 | ||
34 | $(DEST)/html/index.html: ../_build/ocaml/coccilib.cmi coccilib.ml exposed_modules.ml html.odocl | |
35 | $(MKDIR_P) $(DEST)/html | |
36 | cd .. && $(OCAMLBUILD) ocaml/html.docdir/index.html | |
37 | cp -r ../_build/ocaml/html.docdir/* $(DEST)/html/ | |
38 | ||
39 | # build coccilib.cmi if needed | |
40 | ../_build/ocaml/coccilib.cmi: | |
41 | cd .. && $(OCAMLBUILD) ocaml/coccilib.cmi | |
42 | ||
43 | endif | |
993936c0 C |
44 | |
45 | cleandoc: | |
abad11c5 C |
46 | @if test -z "${KEEP_GENERATED}"; then \ |
47 | rm -rf $(DEST)/html $(DEST)/man; fi |