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