2016-02-18 07:11:59 -08:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Maxence Guesdon, projet Cristal, INRIA Rocquencourt *
|
|
|
|
#* *
|
|
|
|
#* Copyright 2001 Institut National de Recherche en Informatique et *
|
|
|
|
#* en Automatique. *
|
|
|
|
#* *
|
|
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
ROOTDIR = ..
|
|
|
|
|
2018-09-12 07:32:44 -07:00
|
|
|
include $(ROOTDIR)/Makefile.config
|
2018-03-29 05:38:33 -07:00
|
|
|
include $(ROOTDIR)/Makefile.common
|
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
OCAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
|
2018-08-25 10:50:16 -07:00
|
|
|
OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
STDLIBFLAGS = -nostdlib -I $(ROOTDIR)/stdlib
|
|
|
|
OCAMLC = $(OCAMLRUN) $(ROOTDIR)/ocamlc $(STDLIBFLAGS)
|
|
|
|
OCAMLOPT = $(OCAMLRUN) $(ROOTDIR)/ocamlopt $(STDLIBFLAGS)
|
2019-01-03 06:17:51 -08:00
|
|
|
OCAMLDEP = $(OCAMLRUN) $(ROOTDIR)/boot/ocamlc -depend
|
2018-12-08 07:19:06 -08:00
|
|
|
DEPFLAGS = -slash
|
2016-09-14 15:46:11 -07:00
|
|
|
OCAMLLEX = $(OCAMLRUN) $(ROOTDIR)/boot/ocamllex
|
|
|
|
# TODO: figure out whether the DEBUG lines the following preprocessor removes
|
|
|
|
# are actually useful.
|
|
|
|
# If they are not, then the preprocessor logic (including the
|
|
|
|
# remove_DEBUG script and the debug target) could be removed.
|
|
|
|
# If they are, it may be better to be able to enable them at run-time
|
2017-01-12 03:56:24 -08:00
|
|
|
# rather than compile-time, e.g. through a -debug command-line option.
|
2016-09-14 15:46:11 -07:00
|
|
|
# In the following line, "sh" is useful under Windows. Without it,
|
|
|
|
# the ./remove_DEBUG command would be executed by cmd.exe which would not
|
|
|
|
# know how to handle it.
|
|
|
|
OCAMLPP=-pp 'sh ./remove_DEBUG'
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2004-12-03 06:42:09 -08:00
|
|
|
# For installation
|
2002-03-27 08:20:32 -08:00
|
|
|
##############
|
2016-09-14 15:46:11 -07:00
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
MKDIR=mkdir -p
|
2016-09-14 15:46:11 -07:00
|
|
|
CP=cp
|
|
|
|
OCAMLDOC=ocamldoc
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_OPT=$(OCAMLDOC).opt
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
# TODO: clarify whether the following really needs to be that complicated
|
|
|
|
ifeq "$(UNIX_OR_WIN32)" "unix"
|
|
|
|
ifeq "$(TARGET)" "$(HOST)"
|
|
|
|
ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_RUN_BYTE=$(OCAMLRUN) -I $(ROOTDIR)/otherlibs/$(UNIXLIB) -I $(ROOTDIR)/otherlibs/str ./$(OCAMLDOC)
|
2016-09-14 15:46:11 -07:00
|
|
|
else
|
2019-07-28 00:59:37 -07:00
|
|
|
# if shared-libraries are not supported, unix.cma and str.cma
|
|
|
|
# are compiled with -custom, so ocamldoc also uses -custom,
|
|
|
|
# and (ocamlrun ocamldoc) does not work.
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_RUN_BYTE=./$(OCAMLDOC)
|
2016-09-14 15:46:11 -07:00
|
|
|
endif
|
2015-10-12 23:39:23 -07:00
|
|
|
else
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_RUN_BYTE=$(OCAMLRUN) ./$(OCAMLDOC)
|
2015-10-12 23:39:23 -07:00
|
|
|
endif
|
2016-09-14 15:46:11 -07:00
|
|
|
else # Windows
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_RUN_BYTE = \
|
2018-07-26 08:16:45 -07:00
|
|
|
CAML_LD_LIBRARY_PATH="$(ROOTDIR)/otherlibs/win32unix;$(ROOTDIR)/otherlibs/str" $(OCAMLRUN) ./$(OCAMLDOC)
|
2015-10-09 13:41:58 -07:00
|
|
|
endif
|
2016-09-14 15:46:11 -07:00
|
|
|
|
2019-07-27 12:55:32 -07:00
|
|
|
OCAMLDOC_RUN_OPT=./$(OCAMLDOC_OPT)
|
|
|
|
|
|
|
|
OCAMLDOC_RUN_PLUGINS=$(OCAMLDOC_RUN_BYTE)
|
|
|
|
|
|
|
|
ifeq "$(wildcard $(OCAMLDOC_OPT))" ""
|
|
|
|
OCAMLDOC_RUN=$(OCAMLDOC_RUN_BYTE)
|
|
|
|
else
|
|
|
|
OCAMLDOC_RUN=$(OCAMLDOC_RUN_OPT)
|
|
|
|
endif
|
|
|
|
|
2004-12-03 06:42:09 -08:00
|
|
|
OCAMLDOC_LIBCMA=odoc_info.cma
|
2002-03-27 08:20:32 -08:00
|
|
|
OCAMLDOC_LIBCMI=odoc_info.cmi
|
2004-12-03 06:42:09 -08:00
|
|
|
OCAMLDOC_LIBCMXA=odoc_info.cmxa
|
2012-06-13 02:22:06 -07:00
|
|
|
OCAMLDOC_LIBA=odoc_info.$(A)
|
2016-09-14 15:46:11 -07:00
|
|
|
|
2018-03-29 05:22:56 -07:00
|
|
|
OCAMLDOC_LIBMLIS=odoc_info.mli
|
|
|
|
OCAMLDOC_LIBCMIS=$(OCAMLDOC_LIBMLIS:.mli=.cmi)
|
|
|
|
OCAMLDOC_LIBCMTS=$(OCAMLDOC_LIBMLIS:.mli=.cmt) $(OCAMLDOC_LIBMLIS:.mli=.cmti)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2004-02-20 08:28:27 -08:00
|
|
|
ODOC_TEST=odoc_test.cmo
|
2010-08-24 04:48:46 -07:00
|
|
|
GENERATORS_CMOS= \
|
2016-09-14 15:46:11 -07:00
|
|
|
generators/odoc_todo.cmo \
|
|
|
|
generators/odoc_literate.cmo
|
|
|
|
ifeq "$(NATDYNLINK)" "true"
|
|
|
|
GENERATORS_CMXS = $(GENERATORS_CMOS:.cmo=.cmxs)
|
|
|
|
else
|
|
|
|
GENERATORS_CMXS =
|
|
|
|
endif
|
2004-02-20 08:28:27 -08:00
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
# Compilation
|
|
|
|
#############
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
INCLUDES_DEP=\
|
|
|
|
-I $(ROOTDIR)/utils \
|
2017-12-04 15:33:52 -08:00
|
|
|
-I $(ROOTDIR)/parsing \
|
2016-09-14 15:46:11 -07:00
|
|
|
-I $(ROOTDIR)/typing \
|
|
|
|
-I $(ROOTDIR)/driver \
|
|
|
|
-I $(ROOTDIR)/bytecomp \
|
|
|
|
-I $(ROOTDIR)/toplevel
|
|
|
|
|
|
|
|
INCLUDES_NODEP=\
|
|
|
|
-I $(ROOTDIR)/stdlib \
|
|
|
|
-I $(ROOTDIR)/compilerlibs \
|
|
|
|
-I $(ROOTDIR)/otherlibs/str \
|
|
|
|
-I $(ROOTDIR)/otherlibs/dynlink \
|
2019-03-19 03:26:35 -07:00
|
|
|
-I $(ROOTDIR)/otherlibs/dynlink/native \
|
2019-03-18 07:05:57 -07:00
|
|
|
-I $(ROOTDIR)/otherlibs/$(UNIXLIB)
|
2002-08-19 06:28:20 -07:00
|
|
|
|
2018-12-08 07:19:06 -08:00
|
|
|
DEPINCLUDES=$(INCLUDES_DEP)
|
2002-08-19 06:28:20 -07:00
|
|
|
INCLUDES=$(INCLUDES_DEP) $(INCLUDES_NODEP)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2019-09-30 12:14:06 -07:00
|
|
|
COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
|
|
|
|
-safe-string -strict-sequence -strict-formats -bin-annot -principal
|
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
LINKFLAGS=$(INCLUDES) -nostdlib
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
CMOFILES=\
|
|
|
|
odoc_config.cmo \
|
|
|
|
odoc_messages.cmo \
|
|
|
|
odoc_global.cmo \
|
|
|
|
odoc_types.cmo \
|
|
|
|
odoc_misc.cmo \
|
|
|
|
odoc_text_parser.cmo \
|
|
|
|
odoc_text_lexer.cmo \
|
|
|
|
odoc_text.cmo \
|
|
|
|
odoc_name.cmo \
|
|
|
|
odoc_parameter.cmo \
|
|
|
|
odoc_value.cmo \
|
|
|
|
odoc_type.cmo \
|
|
|
|
odoc_extension.cmo \
|
|
|
|
odoc_exception.cmo \
|
|
|
|
odoc_class.cmo \
|
|
|
|
odoc_module.cmo \
|
|
|
|
odoc_print.cmo \
|
|
|
|
odoc_str.cmo \
|
|
|
|
odoc_comments_global.cmo \
|
|
|
|
odoc_parser.cmo \
|
|
|
|
odoc_lexer.cmo \
|
|
|
|
odoc_see_lexer.cmo \
|
|
|
|
odoc_env.cmo \
|
|
|
|
odoc_merge.cmo \
|
|
|
|
odoc_sig.cmo \
|
|
|
|
odoc_ast.cmo \
|
|
|
|
odoc_control.cmo \
|
|
|
|
odoc_inherit.cmo \
|
|
|
|
odoc_search.cmo \
|
|
|
|
odoc_scan.cmo \
|
|
|
|
odoc_cross.cmo \
|
|
|
|
odoc_comments.cmo \
|
|
|
|
odoc_dep.cmo \
|
|
|
|
odoc_analyse.cmo \
|
|
|
|
odoc_info.cmo
|
|
|
|
|
|
|
|
CMXFILES = $(CMOFILES:.cmo=.cmx)
|
|
|
|
CMIFILES = $(CMOFILES:.cmo=.cmi)
|
|
|
|
|
|
|
|
EXECMOFILES=\
|
|
|
|
$(CMOFILES) \
|
|
|
|
odoc_dag2html.cmo \
|
|
|
|
odoc_to_text.cmo \
|
|
|
|
odoc_ocamlhtml.cmo \
|
|
|
|
odoc_html.cmo \
|
|
|
|
odoc_man.cmo \
|
|
|
|
odoc_latex_style.cmo \
|
|
|
|
odoc_latex.cmo \
|
|
|
|
odoc_texi.cmo \
|
|
|
|
odoc_dot.cmo \
|
|
|
|
odoc_gen.cmo \
|
|
|
|
odoc_args.cmo \
|
|
|
|
odoc.cmo
|
|
|
|
|
|
|
|
EXECMXFILES = $(EXECMOFILES:.cmo=.cmx)
|
|
|
|
EXECMIFILES = $(EXECMOFILES:.cmo=.cmi)
|
|
|
|
|
|
|
|
LIBCMOFILES = $(CMOFILES)
|
|
|
|
LIBCMXFILES = $(LIBCMOFILES:.cmo=.cmx)
|
|
|
|
LIBCMIFILES = $(LIBCMOFILES:.cmo=.cmi)
|
|
|
|
|
2019-09-27 09:10:34 -07:00
|
|
|
ifeq "$(STDLIB_MANPAGES)" "true"
|
|
|
|
DOCS_TARGET = manpages
|
|
|
|
else
|
|
|
|
DOCS_TARGET =
|
|
|
|
endif
|
2002-05-29 01:32:15 -07:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: all
|
2019-09-27 09:10:34 -07:00
|
|
|
all: lib exe generators $(DOCS_TARGET)
|
2005-05-31 04:52:16 -07:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: exe
|
2002-03-27 08:20:32 -08:00
|
|
|
exe: $(OCAMLDOC)
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: lib
|
2004-02-20 08:28:27 -08:00
|
|
|
lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) $(ODOC_TEST)
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: generators
|
2010-08-24 04:48:46 -07:00
|
|
|
generators: $(GENERATORS_CMOS)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2018-06-03 00:04:48 -07:00
|
|
|
.PHONY: opt.opt allopt # allopt and opt.opt are synonyms
|
2016-09-14 15:46:11 -07:00
|
|
|
opt.opt: exeopt libopt generatorsopt
|
2018-06-03 00:04:48 -07:00
|
|
|
allopt: opt.opt
|
2015-12-26 07:18:38 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: exeopt
|
2002-03-27 08:20:32 -08:00
|
|
|
exeopt: $(OCAMLDOC_OPT)
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: libopt
|
2004-12-03 06:42:09 -08:00
|
|
|
libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI)
|
2010-08-24 04:48:46 -07:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: generatorsopt
|
2017-02-07 04:15:22 -08:00
|
|
|
generatorsopt: $(GENERATORS_CMXS)
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
# TODO: the following debug target could be replaced by a DEBUG variable
|
|
|
|
.PHONY: debug
|
2004-12-03 06:42:09 -08:00
|
|
|
debug:
|
2012-07-10 08:29:19 -07:00
|
|
|
$(MAKE) OCAMLPP=""
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2019-01-27 03:27:08 -08:00
|
|
|
OCAMLDOC_LIBRARIES = ocamlcommon unix str dynlink
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
OCAMLDOC_BCLIBRARIES = $(OCAMLDOC_LIBRARIES:%=%.cma)
|
|
|
|
OCAMLDOC_NCLIBRARIES = $(OCAMLDOC_LIBRARIES:%=%.cmxa)
|
|
|
|
|
2009-03-11 00:04:39 -07:00
|
|
|
$(OCAMLDOC): $(EXECMOFILES)
|
2016-09-14 15:46:11 -07:00
|
|
|
$(OCAMLC) -o $@ -linkall $(LINKFLAGS) $(OCAMLDOC_BCLIBRARIES) $^
|
|
|
|
|
2009-03-11 00:04:39 -07:00
|
|
|
$(OCAMLDOC_OPT): $(EXECMXFILES)
|
2018-09-06 07:12:42 -07:00
|
|
|
$(OCAMLOPT_CMD) -o $@ -linkall $(LINKFLAGS) $(OCAMLDOC_NCLIBRARIES) $^
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
$(OCAMLDOC_LIBCMA): $(LIBCMOFILES)
|
2016-09-14 15:46:11 -07:00
|
|
|
$(OCAMLC) -a -o $@ $(LINKFLAGS) $^
|
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
$(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
|
2016-09-14 15:46:11 -07:00
|
|
|
$(OCAMLOPT) -a -o $@ $(LINKFLAGS) $^
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: manpages
|
2018-08-23 14:16:32 -07:00
|
|
|
manpages: stdlib_man/Stdlib.3o
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: html_doc
|
2018-08-23 14:16:32 -07:00
|
|
|
html_doc: stdlib_html/Stdlib.html
|
2002-04-22 02:40:14 -07:00
|
|
|
|
2018-10-25 08:19:56 -07:00
|
|
|
.PHONY: pdf_doc
|
|
|
|
pdf_doc: stdlib_latex/stdlib.pdf
|
|
|
|
|
|
|
|
.PHONY: texi_doc
|
|
|
|
texi_doc: stdlib_texi/stdlib.texi
|
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: dot
|
|
|
|
dot: ocamldoc.dot
|
|
|
|
|
|
|
|
ocamldoc.dot: $(EXECMOFILES)
|
|
|
|
$(OCAMLDOC_RUN) -dot -dot-reduce -o $@ $(INCLUDES) odoc*.ml
|
2006-09-20 04:14:37 -07:00
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
# Parsers and lexers dependencies :
|
|
|
|
###################################
|
|
|
|
odoc_text_parser.ml: odoc_text_parser.mly
|
|
|
|
odoc_text_parser.mli: odoc_text_parser.mly
|
|
|
|
|
|
|
|
odoc_parser.ml: odoc_parser.mly
|
|
|
|
odoc_parser.mli:odoc_parser.mly
|
|
|
|
|
|
|
|
odoc_text_lexer.ml: odoc_text_lexer.mll
|
|
|
|
|
|
|
|
odoc_lexer.ml:odoc_lexer.mll
|
|
|
|
|
|
|
|
odoc_ocamlhtml.ml: odoc_ocamlhtml.mll
|
|
|
|
|
|
|
|
odoc_see_lexer.ml: odoc_see_lexer.mll
|
|
|
|
|
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
# generic rules :
|
|
|
|
#################
|
|
|
|
|
2010-08-24 04:48:46 -07:00
|
|
|
.SUFFIXES: .mll .mly .ml .mli .cmo .cmi .cmx .cmxs
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
.ml.cmo:
|
2002-03-27 08:20:32 -08:00
|
|
|
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
.mli.cmi:
|
2002-03-27 08:20:32 -08:00
|
|
|
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
.ml.cmx:
|
2002-03-27 08:20:32 -08:00
|
|
|
$(OCAMLOPT) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2010-08-24 04:48:46 -07:00
|
|
|
.ml.cmxs:
|
2018-09-06 07:12:42 -07:00
|
|
|
$(OCAMLOPT_CMD) -shared -o $@ $(OCAMLPP) $(COMPFLAGS) $<
|
2010-08-24 04:48:46 -07:00
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
.mll.ml:
|
2019-05-07 02:32:05 -07:00
|
|
|
$(OCAMLLEX) $(OCAMLLEX_FLAGS) $<
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2002-04-26 06:07:59 -07:00
|
|
|
.mly.ml:
|
2018-04-20 06:42:59 -07:00
|
|
|
$(OCAMLYACC) --strict -v $<
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2002-04-29 02:26:59 -07:00
|
|
|
.mly.mli:
|
2018-04-20 06:42:59 -07:00
|
|
|
$(OCAMLYACC) --strict -v $<
|
2002-04-29 02:26:59 -07:00
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
# Installation targets
|
|
|
|
######################
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
# TODO: it may be good to split the following rule in several ones, e.g.
|
|
|
|
# install-programs, install-doc, install-libs
|
|
|
|
|
2018-03-29 05:38:33 -07:00
|
|
|
INSTALL_MANODIR=$(INSTALL_MANDIR)/man3
|
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
|
|
|
$(MKDIR) "$(INSTALL_BINDIR)"
|
2018-07-02 04:02:32 -07:00
|
|
|
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc"
|
2016-09-14 15:46:11 -07:00
|
|
|
$(MKDIR) "$(INSTALL_MANODIR)"
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_PROG) $(OCAMLDOC) "$(INSTALL_BINDIR)/$(OCAMLDOC)$(EXE)"
|
|
|
|
$(INSTALL_DATA) \
|
makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.
¹: a brtfs filesystem on an old-ish SSD
Why I care
----------
An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.
Partial diagnosis
-----------------
The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.
Change
------
The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).
Testing
-------
I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.
Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:
for f in $(find $DESTDIR); do \
echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
done | sort
Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-28 08:46:34 -07:00
|
|
|
ocamldoc.hva *.cmi $(OCAMLDOC_LIBCMA) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_DATA) \
|
2018-05-14 00:15:44 -07:00
|
|
|
$(OCAMLDOC_LIBCMIS) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2018-05-14 00:15:44 -07:00
|
|
|
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
|
|
|
|
$(INSTALL_DATA) \
|
|
|
|
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2018-05-14 00:15:44 -07:00
|
|
|
endif
|
makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.
¹: a brtfs filesystem on an old-ish SSD
Why I care
----------
An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.
Partial diagnosis
-----------------
The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.
Change
------
The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).
Testing
-------
I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.
Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:
for f in $(find $DESTDIR); do \
echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
done | sort
Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-28 08:46:34 -07:00
|
|
|
if test -d stdlib_man; then \
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_DATA) stdlib_man/* "$(INSTALL_MANODIR)"; \
|
makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.
¹: a brtfs filesystem on an old-ish SSD
Why I care
----------
An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.
Partial diagnosis
-----------------
The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.
Change
------
The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).
Testing
-------
I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.
Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:
for f in $(find $DESTDIR); do \
echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
done | sort
Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-28 08:46:34 -07:00
|
|
|
else : ; fi
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
# Note: at the moment, $(INSTALL_MANODIR) is created even if the doc has
|
|
|
|
# not been built. This is not clean and should be changed.
|
|
|
|
|
|
|
|
.PHONY: installopt
|
2002-03-27 08:20:32 -08:00
|
|
|
installopt:
|
2014-08-22 06:45:02 -07:00
|
|
|
if test -f $(OCAMLDOC_OPT); then $(MAKE) installopt_really ; fi
|
2002-04-02 01:15:25 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: installopt_really
|
2002-04-02 01:15:25 -08:00
|
|
|
installopt_really:
|
2016-09-14 15:46:11 -07:00
|
|
|
$(MKDIR) "$(INSTALL_BINDIR)"
|
2018-07-02 04:02:32 -07:00
|
|
|
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc"
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_PROG) \
|
makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.
¹: a brtfs filesystem on an old-ish SSD
Why I care
----------
An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.
Partial diagnosis
-----------------
The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.
Change
------
The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).
Testing
-------
I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.
Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:
for f in $(find $DESTDIR); do \
echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
done | sort
Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-28 08:46:34 -07:00
|
|
|
$(OCAMLDOC_OPT) "$(INSTALL_BINDIR)/$(OCAMLDOC_OPT)$(EXE)"
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_DATA) \
|
2018-05-14 00:15:44 -07:00
|
|
|
$(OCAMLDOC_LIBCMIS) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2018-05-14 00:15:44 -07:00
|
|
|
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
|
|
|
|
$(INSTALL_DATA) \
|
|
|
|
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2018-05-14 00:15:44 -07:00
|
|
|
endif
|
2018-03-29 05:24:51 -07:00
|
|
|
$(INSTALL_DATA) \
|
makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.
¹: a brtfs filesystem on an old-ish SSD
Why I care
----------
An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.
Partial diagnosis
-----------------
The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.
Change
------
The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).
Testing
-------
I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.
Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:
for f in $(find $DESTDIR); do \
echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
done | sort
Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-28 08:46:34 -07:00
|
|
|
ocamldoc.hva *.cmx $(OCAMLDOC_LIBA) $(OCAMLDOC_LIBCMXA) \
|
2018-07-02 04:02:32 -07:00
|
|
|
"$(INSTALL_LIBDIR)/ocamldoc"
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
# TODO: also split into several rules
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2002-04-03 08:38:29 -08:00
|
|
|
# Testing :
|
|
|
|
###########
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2010-08-02 07:37:22 -07:00
|
|
|
$(OCAMLDOC_RUN) -html -colorize-code -sort -d $@ $(INCLUDES) -dump $@/ocamldoc.odoc odoc*.ml odoc*.mli -v
|
2010-08-24 04:48:46 -07:00
|
|
|
$(MKDIR) $@-custom
|
2019-07-27 12:55:32 -07:00
|
|
|
$(OCAMLDOC_RUN_PLUGINS) -colorize-code -sort -d $@-custom $(INCLUDES) \
|
2010-08-24 04:48:46 -07:00
|
|
|
-g generators/odoc_literate.cmo -g generators/odoc_todo.cmo \
|
|
|
|
-load $@/ocamldoc.odoc -v
|
2002-04-03 08:38:29 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_stdlib
|
|
|
|
test_stdlib:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2003-11-21 07:56:09 -08:00
|
|
|
$(OCAMLDOC_RUN) -html -colorize-code -sort -d $@ $(INCLUDES) -dump $@/stdlib.odoc -keep-code \
|
2018-07-26 08:16:45 -07:00
|
|
|
$(ROOTDIR)/stdlib/*.mli \
|
|
|
|
$(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \
|
|
|
|
$(ROOTDIR)/otherlibs/str/str.mli
|
2002-04-04 00:38:53 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_stdlib_code
|
|
|
|
test_stdlib_code:
|
2012-07-26 12:21:54 -07:00
|
|
|
$(MKDIR) $@
|
|
|
|
$(OCAMLDOC_RUN) -html -colorize-code -sort -d $@ $(INCLUDES) -dump $@/stdlib.odoc -keep-code \
|
2018-07-26 08:16:45 -07:00
|
|
|
`ls $(ROOTDIR)/stdlib/*.ml | grep -v Labels` \
|
|
|
|
$(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.ml \
|
|
|
|
$(ROOTDIR)/otherlibs/str/str.ml
|
2012-07-26 12:21:54 -07:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_latex
|
|
|
|
test_latex:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2015-09-11 04:58:31 -07:00
|
|
|
$(OCAMLDOC_RUN) -latex -sort -o $@/test.tex -d $@ $(INCLUDES) odoc*.ml \
|
2018-07-26 08:16:45 -07:00
|
|
|
odoc*.mli test2.txt $(ROOTDIR)/stdlib/*.mli $(ROOTDIR)/otherlibs/unix/unix.mli
|
2002-03-27 08:20:32 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_latex_simple
|
|
|
|
test_latex_simple:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2004-03-26 07:57:03 -08:00
|
|
|
$(OCAMLDOC_RUN) -latex -sort -o $@/test.tex -d $@ $(INCLUDES) \
|
2004-04-02 07:10:58 -08:00
|
|
|
-latextitle 6,subsection -latextitle 7,subsubection \
|
2018-07-26 08:16:45 -07:00
|
|
|
$(ROOTDIR)/stdlib/hashtbl.mli \
|
|
|
|
$(ROOTDIR)/stdlib/arg.mli \
|
|
|
|
$(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \
|
|
|
|
$(ROOTDIR)/stdlib/map.mli
|
2004-03-26 07:57:03 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_man
|
|
|
|
test_man:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2003-08-25 00:25:36 -07:00
|
|
|
$(OCAMLDOC_RUN) -man -sort -d $@ $(INCLUDES) odoc*.ml odoc*.mli
|
2002-04-05 03:25:22 -08:00
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: test_texi
|
|
|
|
test_texi:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2003-08-25 00:25:36 -07:00
|
|
|
$(OCAMLDOC_RUN) -texi -sort -d $@ $(INCLUDES) odoc*.ml odoc*.mli
|
2002-04-05 03:25:22 -08:00
|
|
|
|
2017-06-14 05:20:40 -07:00
|
|
|
# stdlib non-prefixed :
|
|
|
|
#######################
|
|
|
|
SRC=$(ROOTDIR)
|
|
|
|
|
2018-08-23 14:16:32 -07:00
|
|
|
# Documented modules: stdlib + otherlib + utils(?) + parsing(for compiler-libs)
|
|
|
|
|
|
|
|
include Makefile.docfiles
|
|
|
|
|
2018-11-04 02:21:09 -08:00
|
|
|
stdlib_man/Stdlib.3o: $(OCAMLDOC) $(DOC_ALL)
|
2002-05-29 01:32:15 -07:00
|
|
|
$(MKDIR) stdlib_man
|
2018-09-03 07:35:44 -07:00
|
|
|
$(OCAMLDOC_RUN) -man -d stdlib_man -nostdlib \
|
|
|
|
-hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
|
2018-09-04 00:16:47 -07:00
|
|
|
-pp "$(AWK) -v ocamldoc=true -f $(SRC)/stdlib/expand_module_aliases.awk" \
|
2018-09-12 00:51:47 -07:00
|
|
|
-t "OCaml library" -man-mini \
|
2018-11-04 02:21:09 -08:00
|
|
|
$(DOC_ALL_TEXT:%=-text %) \
|
2018-09-12 00:51:47 -07:00
|
|
|
$(DOC_ALL_MLIS)
|
2002-04-22 02:40:14 -07:00
|
|
|
|
2018-11-04 02:21:09 -08:00
|
|
|
stdlib_html/Stdlib.html: $(OCAMLDOC) $(DOC_ALL)
|
2014-04-19 02:05:32 -07:00
|
|
|
$(MKDIR) stdlib_html
|
2018-09-03 07:35:44 -07:00
|
|
|
$(OCAMLDOC_RUN) -html -d stdlib_html -nostdlib \
|
|
|
|
-hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
|
2018-09-04 00:16:47 -07:00
|
|
|
-pp "$(AWK) -v ocamldoc=true -f $(SRC)/stdlib/expand_module_aliases.awk" \
|
2018-09-12 00:51:47 -07:00
|
|
|
-t "OCaml library" \
|
2018-11-04 02:21:09 -08:00
|
|
|
$(DOC_ALL_TEXT:%=-text %) \
|
2018-09-12 00:51:47 -07:00
|
|
|
$(DOC_ALL_MLIS)
|
2014-04-19 02:05:32 -07:00
|
|
|
|
2018-11-04 02:21:09 -08:00
|
|
|
stdlib_texi/stdlib.texi: $(OCAMLDOC) $(DOC_ALL)
|
2018-10-25 08:19:56 -07:00
|
|
|
$(MKDIR) stdlib_texi
|
|
|
|
$(OCAMLDOC_RUN) -texi -o stdlib_texi/stdlib.texi -nostdlib \
|
|
|
|
-hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
|
|
|
|
-pp "$(AWK) -v ocamldoc=true -f $(SRC)/stdlib/expand_module_aliases.awk" \
|
|
|
|
-t "OCaml library" \
|
2018-11-04 02:21:09 -08:00
|
|
|
$(DOC_ALL_TEXT:%=-text %) \
|
2018-10-25 08:19:56 -07:00
|
|
|
$(DOC_ALL_MLIS)
|
|
|
|
|
2018-11-04 02:21:09 -08:00
|
|
|
|
|
|
|
stdlib_latex/stdlib.tex: $(OCAMLDOC) $(DOC_ALL)
|
2018-10-25 08:19:56 -07:00
|
|
|
$(MKDIR) stdlib_latex
|
|
|
|
$(OCAMLDOC_RUN) -latex -o stdlib_latex/stdlib.tex -nostdlib \
|
|
|
|
-hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
|
|
|
|
-pp "$(AWK) -v ocamldoc=true -f $(SRC)/stdlib/expand_module_aliases.awk" \
|
|
|
|
-t "OCaml library" \
|
2018-11-04 02:21:09 -08:00
|
|
|
$(DOC_ALL_TEXT:%=-text %) \
|
2018-10-25 08:19:56 -07:00
|
|
|
$(DOC_ALL_MLIS)
|
|
|
|
|
|
|
|
stdlib_latex/stdlib.pdf: stdlib_latex/stdlib.tex
|
|
|
|
cd stdlib_latex && pdflatex stdlib && pdflatex stdlib
|
|
|
|
|
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: autotest_stdlib
|
|
|
|
autotest_stdlib:
|
2004-12-03 06:42:09 -08:00
|
|
|
$(MKDIR) $@
|
2019-07-27 12:55:32 -07:00
|
|
|
$(OCAMLDOC_RUN_PLUGINS) -g autotest/odoc_test.cmo\
|
2003-11-24 13:20:51 -08:00
|
|
|
$(INCLUDES) -keep-code \
|
2018-07-26 08:16:45 -07:00
|
|
|
$(ROOTDIR)/stdlib/*.mli \
|
|
|
|
$(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \
|
|
|
|
$(ROOTDIR)/otherlibs/str/str.mli
|
2003-11-24 13:20:51 -08:00
|
|
|
|
2017-01-12 03:56:24 -08:00
|
|
|
|
|
|
|
# odoc rules :
|
|
|
|
##############
|
|
|
|
|
|
|
|
.PHONY: odoc
|
|
|
|
odoc:
|
|
|
|
rm -rf odoc
|
|
|
|
$(MKDIR) odoc
|
|
|
|
# .cmti --> .odoc
|
2018-07-26 08:16:45 -07:00
|
|
|
for fn in $(ROOTDIR)/stdlib/stdlib*.cmti; do \
|
|
|
|
odoc compile $(INCLUDES) --package stdlib $(ROOTDIR)/stdlib/$$fn; \
|
2017-01-12 03:56:24 -08:00
|
|
|
done
|
2017-06-14 05:20:40 -07:00
|
|
|
for lib in str bigarray; do \
|
2018-07-26 08:16:45 -07:00
|
|
|
odoc compile $(INCLUDES) --package $$lib $(ROOTDIR)/otherlibs/$$lib/$$lib.cmti; \
|
2017-01-12 03:56:24 -08:00
|
|
|
done
|
2018-07-26 08:16:45 -07:00
|
|
|
odoc compile $(INCLUDES) --package unix $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.cmti
|
|
|
|
for fn in $(ROOTDIR)/parsing/*.cmti; do \
|
|
|
|
odoc compile $(INCLUDES) --package parsing $(ROOTDIR)/parsing/$$fn; \
|
2017-01-12 03:56:24 -08:00
|
|
|
done
|
|
|
|
# .odoc --> .html
|
2018-07-26 08:16:45 -07:00
|
|
|
odoc html $(INCLUDES) --output-dir odoc $(ROOTDIR)/stdlib/stdlib.odoc
|
2017-06-14 05:20:40 -07:00
|
|
|
for lib in str bigarray $(UNIXLIB); do \
|
2018-07-26 08:16:45 -07:00
|
|
|
odoc html $(INCLUDES) --output-dir odoc $(ROOTDIR)/otherlibs/$$lib/$$lib.odoc; \
|
2017-01-12 03:56:24 -08:00
|
|
|
done
|
2018-07-26 08:16:45 -07:00
|
|
|
for fn in $(ROOTDIR)/parsing/*.odoc; do \
|
2017-01-12 03:56:24 -08:00
|
|
|
odoc html $(INCLUDES) --output-dir odoc $$fn; \
|
|
|
|
done
|
|
|
|
for d in odoc/*; do \
|
|
|
|
lib=`basename $$d`; \
|
|
|
|
cd $$d; \
|
|
|
|
echo -e The $$lib 'library.\n\nModules\n:{!modules:' * '}' > ../../index.mld; \
|
|
|
|
cd ../..; \
|
|
|
|
odoc html $(INCLUDES) --output-dir odoc --index-for=$$lib index.mld; \
|
|
|
|
rm -f index.mld; \
|
|
|
|
done
|
|
|
|
cp odoc_index.html odoc/index.html
|
|
|
|
odoc css -o odoc
|
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
# backup, clean and depend :
|
|
|
|
############################
|
|
|
|
|
2016-09-14 15:46:11 -07:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2019-04-10 05:18:04 -07:00
|
|
|
rm -f \#*\#
|
2016-12-10 05:20:12 -08:00
|
|
|
rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.cmt *.cmti *.$(A) *.$(O)
|
2016-09-14 15:46:11 -07:00
|
|
|
rm -f odoc_parser.output odoc_text_parser.output
|
|
|
|
rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
|
|
|
|
rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
|
2018-11-06 04:45:25 -08:00
|
|
|
rm -rf stdlib_man stdlib_html stdlib_texi stdlib_latex
|
2016-12-10 05:20:12 -08:00
|
|
|
rm -f generators/*.cm[taiox] generators/*.$(A) generators/*.$(O) generators/*.cmx[as]
|
2016-09-14 15:46:11 -07:00
|
|
|
|
|
|
|
.PHONY: depend
|
|
|
|
depend:
|
|
|
|
$(OCAMLYACC) odoc_text_parser.mly
|
|
|
|
$(OCAMLYACC) odoc_parser.mly
|
2019-05-07 02:32:05 -07:00
|
|
|
$(OCAMLLEX) $(OCAMLLEX_FLAGS) odoc_text_lexer.mll
|
|
|
|
$(OCAMLLEX) $(OCAMLLEX_FLAGS) odoc_lexer.mll
|
|
|
|
$(OCAMLLEX) $(OCAMLLEX_FLAGS) odoc_ocamlhtml.mll
|
|
|
|
$(OCAMLLEX) $(OCAMLLEX_FLAGS) odoc_see_lexer.mll
|
2018-12-08 07:19:06 -08:00
|
|
|
$(OCAMLDEP) $(DEPFLAGS) $(DEPINCLUDES) *.mll *.mly *.ml *.mli > .depend
|
|
|
|
$(OCAMLDEP) $(DEPFLAGS) $(DEPINCLUDES) -shared generators/*.ml >> .depend
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
include .depend
|