Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jocamldep(1) [debian man page]

JOCAMLDEP(1)						      General Commands Manual						      JOCAMLDEP(1)

NAME
jocamldep - Dependency generator for JoCaml SYNOPSIS
jocamldep [ -I lib-dir ] filename ... DESCRIPTION
The jocamldep(1) command scans a set of Objective Caml source files (.ml and .mli files) for references to external compilation units, and outputs dependency lines in a format suitable for the make(1) utility. This ensures that make will compile the source files in the correct order, and recompile those files that need to when a source file is modified. The typical usage is: jocamldep options *.mli *.ml > .depend where .depend is the file that should contain the dependencies. Dependencies are generated both for compiling with the bytecode compiler jocamlc(1) and with the native-code compiler jocamlopt(1). OPTIONS
The following command-line option is recognized by jocamldep(1). -I directory Add the given directory to the list of directories searched for source files. If a source file foo.ml mentions an external compila- tion unit Bar, a dependency on that unit's interface bar.cmi is generated only if the source for bar is found in the current direc- tory or in one of the directories specified with -I. Otherwise, Bar is assumed to be a module form the standard library, and no dependencies are generated. For programs that span multiple directories, it is recommended to pass jocamldep(1) the same -I options that are passed to the compiler. -native Generate dependencies for a pure native-code program (no bytecode version). When an implementation file (.ml file) has no explicit interface file (.mli file), jocamldep(1) generates dependencies on the bytecode compiled file (.cmo file) to reflect interface changes. This can cause unnecessary bytecode recompilations for programs that are compiled to native-code only. The flag -native causes dependencies on native compiled files (.cmx) to be generated instead of on .cmo files. (This flag makes no difference if all source files have explicit .mli interface files.) SEE ALSO
jocamlc(1), jocamlopt(1). The Objective Caml user's manual, chapter "Dependency generator". JOCAMLDEP(1)

Check Out this Related Man Page

OCAMLDSORT(1)						      General Commands Manual						     OCAMLDSORT(1)

NAME
ocamldsort - Dependency sorter for OCaml source files SYNOPSIS
ocamldsort [ -pp pre-command ] [ -d dep-command ] [ -mli ] [ -nox ] [ -obj | -byte | -opt ] [ filename ] ... DESCRIPTION
The ocamldsort(1) command scans a set of Objective Caml source files (.ml and .mli files), sorts them according to their dependencies and prints the sorted files in order to link their corresponding .cmo files. For ocamldsort(1) to work it must get a list of dependencies generated by ocamldep(1), if the standard input to ocamldsort(1) has been redirected then ocamldsort assumes that this is a dependency file generated by ocamldep(1). Otherwise ocamldsort calls ocamldep(1) to gen- erate the dependency list itself. In either case the source files to be sorted should be given as arguments to the ocamldsort(1) command. ocamldsort(1) can be used to compile and link simple projects with one command, such as: ocamlc $(ocamldsort *.ml) if your project doesn't contain .mli files or: ocamlc -c $(ocamldsort -mli *.ml *.mli) && ocamlc $(ocamldsort -byte *.ml) if it contains .mli files. However for larger projects where separate compilation is desirable, ocamldsort(1) can also be used from within a makefile. Here is a typi- cal makefile example: TARGET=my_program OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLDEP=ocamldep OCAMLDSORT=ocamldsort PPFLAGS=-pp camlp4o MLY=$(shell echo *.mly) MLL=$(shell echo *.mll) GENERATED_ML=$(MLY:.mly=.ml) $(MLL:.mll=.ml) include .generated .depend .ocamldsort $(TARGET): $(CMO_FILES) $(OCAMLC) $(COMPFLAGS) $(LIBS) $^ -o $@ $(TARGET).opt: $(CMX_FILES) $(OCAMLOPT) $(COMPFLAGS) $(LIBS_OPT) $^ -o $@ .generated: $(GENERATED_ML) @touch .generated .depend: .generated $(OCAMLDEP) *.ml *.mli > $@ .ocamldsort: .depend echo CMO_FILES=`< .depend $(OCAMLDSORT) -byte *.ml` > .ocamldsort echo CMX_FILES=`< .depend $(OCAMLDSORT) -opt *.ml` >> .ocamldsort distclean: clean rm -f .generated .depend .ocamldsort rm -f $(GENERATED_ML) rm -f *~ rm -f $(TARGET) clean: rm -f *.cmo *.cmi *.cmx *.o .SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly %.cmi:%.mli $(OCAMLC) $(PPFLAGS) $(COMPFLAGS) -c $< %.cmo:%.ml $(OCAMLC) $(PPFLAGS) $(COMPFLAGS) -c $< %.cmi %.cmo:%.ml $(OCAMLC) $(PPFLAGS) $(COMPFLAGS) -c $< %.cmx %.o:%.ml $(OCAMLOPT) $(PPFLAGS) $(COMPFLAGS) -c $< %.ml:%.mll $(OCAMLLEX) $< %.mli %.ml:%.mly $(OCAMLYACC) -v $< OPTIONS
The following command-line options are recognized by ocamlsort(1): -I directory Add the given directory to the list of directories searched for source files. -pp pre-command Command to preprocess file. -d dep-command Command to compute dependencies. ocamldep(1) by default. -mli Sort files using mli dependencies. -nox Ignore filenames containg `*' so that unexpanded wildcards are ignored. -obj Print bytecode filenames (.cmo and .cmi) (deprecated: use -byte). -byte Print bytecode filenames (.cmo and .cmi). -opt Print opt filenames (.cmx and .cmi). -v Output version information and exit. -help, --help Output help and exit. SEE ALSO
ocamldep(1). OCAMLDSORT(1)
Man Page