1 TOPDIR=$(abspath ../..)
2 SRC=$(TOPDIR)
3 include $(TOPDIR)/Makefile.tools
4 include $(TOPDIR)/ocamldoc/Makefile.docfiles
5 MANUAL=$(TOPDIR)/manual/manual
6
7 .PHONY: all
8 all: check-cross-references check-stdlib check-case-collision
9
10 .PHONY: tools
11 tools: cross-reference-checker
12
13 cross-reference-checker: cross_reference_checker.ml
14 $(OCAMLC) $(TOPDIR)/compilerlibs/ocamlcommon.cma \
15 -I $(TOPDIR)/parsing -I $(TOPDIR)/driver \
16 $< -o $@
17
18 # check cross-references between the manual and error messages
19 .PHONY: check-cross-references
20 check-cross-references: cross-reference-checker
21 $(SET_LD_PATH) \
22 $(OCAMLRUN) ./cross-reference-checker \
23 -auxfile $(MANUAL)/texstuff/manual.aux \
24 $(TOPDIR)/utils/warnings.ml \
25 $(TOPDIR)/driver/main_args.ml \
26 $(TOPDIR)/lambda/translmod.ml
27
28 # check that all standard library modules are referenced by the
29 # standard library chapter of the manual
30 .PHONY: check-stdlib
31 check-stdlib:
32 ./check-stdlib-modules $(TOPDIR)
33
34
35 # check name collision between latex source file and module documentation
36 # on case-insensitive file systems
37 normalize = $(shell echo $(basename $(notdir $(1) )) | tr A-Z a-z)
38 LOWER_MLIS= $(call normalize,$(DOC_ALL_MLIS))
39 LOWER_ETEX= $(call normalize,$(wildcard $(MANUAL)/*/*.etex) $(wildcard *.etex))
40 INTER = $(filter $(LOWER_ETEX), $(LOWER_MLIS))
41
42 .PHONY: check-case-collision
43 check-case-collision:
44 ifeq ($(INTER),)
45 else
46 @echo "The following names"
47 @echo " $(INTER)"
48 @echo "are used by both an OCaml module and a latex source file."
49 @echo "This creates a conflict on case-insensitive file systems."
50 @false
51 endif
52
53
54 .PHONY: clean
55 clean:
56 rm -f *.cm? *.cmx? cross-reference-checker
57