2002-03-29 03:40:00 -08:00
|
|
|
#(***********************************************************************)
|
2012-08-01 05:09:31 -07:00
|
|
|
#(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
#(* OCamldoc *)
|
2002-03-29 03:40:00 -08:00
|
|
|
#(* *)
|
|
|
|
#(* 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 Q Public License version 1.0. *)
|
|
|
|
#(* *)
|
|
|
|
#(***********************************************************************)
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include ../config/Makefile
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
# Various commands and dir
|
|
|
|
##########################
|
2014-04-02 09:20:38 -07:00
|
|
|
ROOTDIR = ..
|
|
|
|
OCAMLRUN = $(ROOTDIR)/boot/ocamlrun
|
|
|
|
OCAMLC = $(OCAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib
|
|
|
|
OCAMLOPT = $(OCAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib
|
|
|
|
OCAMLDEP = $(OCAMLRUN) $(ROOTDIR)/tools/ocamldep
|
|
|
|
OCAMLLEX = $(OCAMLRUN) $(ROOTDIR)/boot/ocamllex
|
|
|
|
OCAMLYACC = $(ROOTDIR)/yacc/ocamlyacc
|
2002-03-29 03:40:00 -08:00
|
|
|
OCAMLLIB = $(LIBDIR)
|
|
|
|
OCAMLBIN = $(BINDIR)
|
|
|
|
|
2002-04-15 07:47:31 -07:00
|
|
|
OCAMLPP=-pp "grep -v DEBUG"
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2009-07-20 04:51:50 -07:00
|
|
|
# For installation
|
2002-03-29 03:40:00 -08:00
|
|
|
##############
|
2002-04-15 07:47:31 -07:00
|
|
|
MKDIR=mkdir
|
|
|
|
CP=cp
|
2002-03-29 03:40:00 -08:00
|
|
|
OCAMLDOC=ocamldoc
|
2002-04-25 08:07:40 -07:00
|
|
|
OCAMLDOC_RUN=$(CAMLRUN) $(OCAMLDOC)
|
2002-03-29 03:40:00 -08:00
|
|
|
OCAMLDOC_OPT=$(OCAMLDOC).opt
|
2010-01-22 04:48:24 -08:00
|
|
|
OCAMLDOC_LIBCMA=odoc_info.cma
|
2002-03-29 03:40:00 -08:00
|
|
|
OCAMLDOC_LIBCMI=odoc_info.cmi
|
2010-01-22 04:48:24 -08:00
|
|
|
OCAMLDOC_LIBCMXA=odoc_info.cmxa
|
2002-06-07 02:49:45 -07:00
|
|
|
OCAMLDOC_LIBA=odoc_info.$(A)
|
2014-04-07 00:06:17 -07:00
|
|
|
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/ocamldoc
|
2004-01-28 06:10:20 -08:00
|
|
|
INSTALL_CUSTOMDIR=$(INSTALL_LIBDIR)/custom
|
2014-04-07 00:06:17 -07:00
|
|
|
INSTALL_BINDIR=$(DESTDIR)$(OCAMLBIN)
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2010-01-22 04:48:24 -08:00
|
|
|
INSTALL_MLIS=odoc_info.mli
|
2002-03-29 03:40:00 -08:00
|
|
|
INSTALL_CMIS=$(INSTALL_MLIS:.mli=.cmi)
|
|
|
|
|
|
|
|
# Compilation
|
|
|
|
#############
|
2002-04-15 07:47:31 -07:00
|
|
|
OCAMLSRCDIR=..
|
2002-08-19 06:28:20 -07:00
|
|
|
INCLUDES_DEP=-I $(OCAMLSRCDIR)/parsing \
|
2002-06-07 02:49:45 -07:00
|
|
|
-I $(OCAMLSRCDIR)/utils \
|
|
|
|
-I $(OCAMLSRCDIR)/typing \
|
|
|
|
-I $(OCAMLSRCDIR)/driver \
|
|
|
|
-I $(OCAMLSRCDIR)/bytecomp \
|
|
|
|
-I $(OCAMLSRCDIR)/tools \
|
2002-08-19 06:28:20 -07:00
|
|
|
-I $(OCAMLSRCDIR)/toplevel/
|
|
|
|
|
|
|
|
INCLUDES_NODEP= -I $(OCAMLSRCDIR)/stdlib \
|
2002-06-07 02:49:45 -07:00
|
|
|
-I $(OCAMLSRCDIR)/otherlibs/str \
|
|
|
|
-I $(OCAMLSRCDIR)/otherlibs/dynlink \
|
|
|
|
-I $(OCAMLSRCDIR)/otherlibs/win32unix \
|
|
|
|
-I $(OCAMLSRCDIR)/otherlibs/num \
|
2002-08-19 06:28:20 -07:00
|
|
|
-I $(OCAMLSRCDIR)/otherlibs/win32graph
|
|
|
|
|
|
|
|
INCLUDES=$(INCLUDES_DEP) $(INCLUDES_NODEP)
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
COMPFLAGS=$(INCLUDES) -warn-error A
|
2007-11-06 07:16:56 -08:00
|
|
|
LINKFLAGS=$(INCLUDES) -nostdlib
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2004-01-28 05:36:20 -08:00
|
|
|
CMOFILES= odoc_config.cmo \
|
2002-03-29 03:40:00 -08:00
|
|
|
odoc_messages.cmo\
|
2011-09-15 06:38:45 -07:00
|
|
|
odoc_global.cmo\
|
2002-03-29 03:40:00 -08:00
|
|
|
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_exception.cmo\
|
|
|
|
odoc_class.cmo\
|
|
|
|
odoc_module.cmo\
|
2004-03-05 06:57:52 -08:00
|
|
|
odoc_print.cmo \
|
2002-03-29 03:40:00 -08:00
|
|
|
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\
|
2004-03-22 04:40:49 -08:00
|
|
|
odoc_scan.cmo\
|
2002-03-29 03:40:00 -08:00
|
|
|
odoc_cross.cmo\
|
2006-09-20 04:14:37 -07:00
|
|
|
odoc_comments.cmo\
|
2002-03-29 03:40:00 -08:00
|
|
|
odoc_dep.cmo\
|
|
|
|
odoc_analyse.cmo\
|
|
|
|
odoc_info.cmo
|
|
|
|
|
|
|
|
|
|
|
|
CMXFILES= $(CMOFILES:.cmo=.cmx)
|
|
|
|
CMIFILES= $(CMOFILES:.cmo=.cmi)
|
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
EXECMOFILES=$(CMOFILES) \
|
|
|
|
odoc_dag2html.cmo \
|
|
|
|
odoc_to_text.cmo \
|
|
|
|
odoc_ocamlhtml.cmo \
|
|
|
|
odoc_html.cmo \
|
|
|
|
odoc_man.cmo \
|
2003-07-04 03:02:13 -07:00
|
|
|
odoc_latex_style.cmo \
|
2012-06-13 02:22:06 -07:00
|
|
|
odoc_latex.cmo \
|
|
|
|
odoc_texi.cmo \
|
|
|
|
odoc_dot.cmo \
|
|
|
|
odoc_gen.cmo \
|
|
|
|
odoc_args.cmo \
|
2009-04-09 06:55:53 -07:00
|
|
|
odoc.cmo
|
2002-04-08 01:31:13 -07:00
|
|
|
|
2002-03-29 03:40:00 -08:00
|
|
|
|
|
|
|
EXECMXFILES= $(EXECMOFILES:.cmo=.cmx)
|
|
|
|
EXECMIFILES= $(EXECMOFILES:.cmo=.cmi)
|
|
|
|
|
|
|
|
LIBCMOFILES=$(CMOFILES)
|
|
|
|
LIBCMXFILES= $(LIBCMOFILES:.cmo=.cmx)
|
|
|
|
LIBCMIFILES= $(LIBCMOFILES:.cmo=.cmi)
|
|
|
|
|
|
|
|
# Les cmo et cmx de la distrib OCAML
|
2013-10-02 07:23:10 -07:00
|
|
|
OCAMLCMOFILES= \
|
|
|
|
$(OCAMLSRCDIR)/tools/depend.cmo
|
2002-03-29 03:40:00 -08:00
|
|
|
|
|
|
|
OCAMLCMXFILES=$(OCAMLCMOFILES:.cmo=.cmx)
|
|
|
|
|
|
|
|
all: exe lib
|
|
|
|
exe: $(OCAMLDOC)
|
2009-07-20 04:51:50 -07:00
|
|
|
lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI)
|
2002-03-29 03:40:00 -08:00
|
|
|
|
|
|
|
opt.opt: exeopt libopt
|
|
|
|
exeopt: $(OCAMLDOC_OPT)
|
2009-07-20 04:51:50 -07:00
|
|
|
libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI)
|
|
|
|
debug:
|
2012-07-10 08:29:19 -07:00
|
|
|
$(MAKE) OCAMLPP=""
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2009-07-20 04:51:50 -07:00
|
|
|
$(OCAMLDOC): $(EXECMOFILES)
|
2013-10-02 07:23:10 -07:00
|
|
|
$(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(OCAMLSRCDIR)/compilerlibs/ocamlcommon.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES)
|
2009-04-09 06:55:53 -07:00
|
|
|
$(OCAMLDOC_OPT): $(EXECMXFILES)
|
2013-10-02 07:23:10 -07:00
|
|
|
$(OCAMLOPT) -o $@ unix.cmxa str.cmxa dynlink.cmxa $(OCAMLSRCDIR)/compilerlibs/ocamlcommon.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES)
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2002-04-15 07:47:31 -07:00
|
|
|
$(OCAMLDOC_LIBCMA): $(LIBCMOFILES)
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES)
|
2002-04-15 07:47:31 -07:00
|
|
|
$(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLOPT) -a -o $@ $(LINKFLAGS) $(OCAMLCMXFILES) $(LIBCMXFILES)
|
|
|
|
|
2012-06-13 02:22:06 -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-29 03:40:00 -08:00
|
|
|
# generic rules :
|
|
|
|
#################
|
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.SUFFIXES: .mll .mly .ml .mli .cmo .cmi .cmx .cmxs
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.ml.cmo:
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.mli.cmi:
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2002-04-15 07:47:31 -07:00
|
|
|
.ml.cmx:
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLOPT) $(OCAMLPP) $(COMPFLAGS) -c $<
|
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.ml.cmxs:
|
|
|
|
$(OCAMLOPT) -shared -o $@ $(OCAMLPP) $(COMPFLAGS) $<
|
2002-04-15 07:47:31 -07:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.mll.ml:
|
|
|
|
$(OCAMLLEX) $<
|
2002-04-15 07:47:31 -07:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.mly.ml:
|
|
|
|
$(OCAMLYACC) -v $<
|
2002-04-15 07:47:31 -07:00
|
|
|
|
2012-06-13 02:22:06 -07:00
|
|
|
.mly.mli:
|
|
|
|
$(OCAMLYACC) -v $<
|
2002-03-29 03:40:00 -08:00
|
|
|
|
|
|
|
# Installation targets
|
|
|
|
######################
|
|
|
|
install: dummy
|
2002-06-07 02:49:45 -07:00
|
|
|
$(MKDIR) -p $(INSTALL_BINDIR)
|
|
|
|
$(MKDIR) -p $(INSTALL_LIBDIR)
|
2012-06-13 02:22:06 -07:00
|
|
|
$(CP) $(OCAMLDOC) $(INSTALL_BINDIR)/$(OCAMLDOC)$(EXE)
|
2004-03-22 07:25:10 -08:00
|
|
|
$(CP) ocamldoc.hva *.cmi $(OCAMLDOC_LIBCMA) $(INSTALL_LIBDIR)
|
2002-03-29 03:40:00 -08:00
|
|
|
$(CP) $(INSTALL_MLIS) $(INSTALL_CMIS) $(INSTALL_LIBDIR)
|
|
|
|
|
|
|
|
installopt:
|
2002-06-07 02:49:45 -07:00
|
|
|
if test -f $(OCAMLDOC_OPT); then $(MAKEREC) installopt_really; fi
|
2002-04-02 01:15:25 -08:00
|
|
|
|
|
|
|
installopt_really:
|
2002-06-07 02:49:45 -07:00
|
|
|
$(MKDIR) -p $(INSTALL_BINDIR)
|
|
|
|
$(MKDIR) -p $(INSTALL_LIBDIR)
|
2012-06-13 02:22:06 -07:00
|
|
|
$(CP) $(OCAMLDOC_OPT) $(INSTALL_BINDIR)/$(OCAMLDOC_OPT)$(EXE)
|
2003-07-08 06:52:22 -07:00
|
|
|
$(CP) ocamldoc.hva $(OCAMLDOC_LIBA) $(OCAMLDOC_LIBCMXA) $(INSTALL_LIBDIR)
|
2002-03-29 03:40:00 -08:00
|
|
|
$(CP) $(INSTALL_MLIS) $(INSTALL_CMIS) $(INSTALL_LIBDIR)
|
|
|
|
|
|
|
|
|
|
|
|
# backup, clean and depend :
|
|
|
|
############################
|
|
|
|
|
|
|
|
clean:: dummy
|
2002-06-07 02:49:45 -07:00
|
|
|
@rm -f *~ /#*/#
|
|
|
|
@rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.$(A) *.$(O)
|
2002-03-29 03:40:00 -08: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
|
2010-01-22 04:48:24 -08:00
|
|
|
@rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
|
2012-06-13 02:22:06 -07:00
|
|
|
@rm -rf stdlib_man
|
|
|
|
@rm -f generators/*.cm[aiox] generators/*.$(A) generators/*.$(O) generators/*.cmx[as]
|
2002-03-29 03:40:00 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
depend::
|
2002-03-29 03:40:00 -08:00
|
|
|
$(OCAMLYACC) odoc_text_parser.mly
|
|
|
|
$(OCAMLYACC) odoc_parser.mly
|
|
|
|
$(OCAMLLEX) odoc_text_lexer.mll
|
|
|
|
$(OCAMLLEX) odoc_lexer.mll
|
2012-06-13 02:22:06 -07:00
|
|
|
$(OCAMLLEX) odoc_ocamlhtml.mll
|
|
|
|
$(OCAMLLEX) odoc_see_lexer.mll
|
2002-08-19 06:28:20 -07:00
|
|
|
$(OCAMLDEP) $(INCLUDES_DEP) *.mll *.mly *.ml *.mli > .depend
|
2002-03-29 03:40:00 -08:00
|
|
|
|
|
|
|
dummy:
|
|
|
|
|
|
|
|
include .depend
|