summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-ocamldoc-open/Makefile
blob: 92f09a1d60065b5c101d02646a73734423d17d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
BASEDIR=../..
COMPFLAGS=-I $(OTOPDIR)/ocamldoc
LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/str
DOCFLAGS=-I $(OTOPDIR)/stdlib $(COMPFLAGS)

SRC= main.ml alias.ml inner.ml
ODOCS=$(SRC:%.ml=%.odoc)

.PHONY: default
default:
	@if ! $(SUPPORTS_SHARED_LIBRARIES); then \
	  echo 'skipped (shared libraries not available)'; \
	else \
	  $(SET_LD_PATH) $(MAKE) doc; \
	fi

.PHONY: doc
doc: $(ODOCS)
	@printf " ... testing ocamldoc '-open' option";\
	$(OCAMLDOC) $(DOCFLAGS) -hide-warnings \
         -load alias.odoc -load inner.odoc \
         -load main.odoc -latex -o doc.result ;\
	$(DIFF) doc.result doc.reference > /dev/null \
	&& echo " => passed" || echo " => failed";

inner.odoc: inner.ml
	@$(OCAMLDOC) $(DOCFLAGS) -hide-warnings \
        -dump inner.odoc inner.ml

alias.odoc: inner.cmi alias.ml
	@$(OCAMLDOC) $(DOCFLAGS) -hide-warnings \
        -dump alias.odoc alias.ml

main.odoc: alias.cmi main.ml
	@$(OCAMLDOC) $(DOCFLAGS) -hide-warnings \
        -open Alias.Container -open Aliased_inner -dump main.odoc main.ml

alias.cmi:inner.cmi

.PHONY: promote
promote: defaultpromote

.PHONY: clean
clean: defaultclean
	@rm -f *.odoc *.toc *.sty *.aux *.log *.result

include $(BASEDIR)/makefiles/Makefile.common