Commits

camlspotter committed dfbe9ec

use of standard OMakeroot

  • Participants
  • Parent commits 14cc22a

Comments (0)

Files changed (3)

 #                                                                     #
 #*********************************************************************#
 
+include OMyMakeroot
+
 ########################################## You may want to change these
 
 # Specify non standard include directories
 
 ########################################################################
 
-VERSION=3.3.0
+VERSION=4.0.0
 
 # for src/META
 PACKAGE_NAME=camlimages
-#*********************************************************************#
-#                                                                     #
-#                          Caml Images                                #
-#                                                                     #
-#            Fran輟is Pessaux, projet Cristal, INRIA Rocquencourt     #
-#            Pierre Weis, projet Cristal, INRIA Rocquencourt          #
-#            Jun Furuse, projet Cristal, INRIA Rocquencourt           #
-#                                                                     #
-#  Copyright 1999-2004,                                               #
-#  Institut National de Recherche en Informatique et en Automatique.  #
-#  Distributed only by permission.                                    #
-#                                                                     #
-#*********************************************************************#
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
 
+########################################################################
+# The standard OMakeroot file.
+# You will not normally need to modify this file.
+# By default, your changes should be placed in the
+# OMakefile in this directory.
+#
+# If you decide to modify this file, note that it uses exactly
+# the same syntax as the OMakefile.
+#
+
+#
+# Include the standard installed configuration files.
+# Any of these can be deleted if you are not using them,
+# but you probably want to keep the Common file.
+#
 open build/C
 open build/OCaml
 open build/LaTeX
 
+#
+# The command-line variables are defined *after* the
+# standard configuration has been loaded.
+#
 DefineCommandVars()
 
-######################################################################## tools
-
-USE_OCAMLFIND = true
-
-if $(not $(OCAMLFIND_EXISTS))
-   eprintln(This project requires ocamlfind, but is was not found.)
-   eprintln(You need to install ocamlfind and run "omake --configure".)
-   exit 1
-
-OCAML_WHERE = $(shell ocamlc -where)
-
-##################################################################### configure
-
-open configure/Configure
-
-Check_header_library(xlib, xheader, xfunc) =
-  return $(and $(VerboseCheckCHeader $(xheader)), $(VerboseCheckCLib $(xlib), $(xfunc)))
-
-Have_library(libname, lib, header, func) =
-  setvar(this.HAVE_$(libname), $(Check_header_library $(lib), $(header), $(func)))
-  export
-
-Check_ocamlfind_package(package) = 
-  ConfMsgChecking($(package))
-  ConfMsgFound($(shell-success ocamlfind query $(package)))
-
-Check_pkg_config(package, option) =
-  ConfMsgChecking(Freetype)
-  ConfMsgFound($(shell-success $(package)-config $(option)))
-
-where1(com) =
-  WHERE = $(where $(prog))
-  if $(WHERE)
-    value $(nth 0, $(WHERE))
-  else
-    value
-
-# export $(WHERE)
-Check_prog_in_path(prog) =
-   ConfMsgChecking(for $(prog))
-   WHERE = $(where1 $(prog))
-   export WHERE
-   if $(WHERE)
-      ConfMsgResult(found $(WHERE))
-      return true
-   else
-      ConfMsgResult(FAILED - no $(prog) found)
-      return false
-
-# export $(WHERE)
-Check_file_in_path(path, file) =
-  ConfMsgChecking(for $(file))
-  WHERE = $(find-in-path-optional $(path), $(file))
-  export WHERE
-  if $(WHERE)
-    WHERE = $(nth 0, $(WHERE))
-    export WHERE
-    ConfMsgResult(found $(WHERE))
-    return true
-  else
-    WHERE =
-    export WHERE
-    ConfMsgResult(FAILED - no $(file) found)
-    return false
-  export WHERE
-
-# Return the size of word in bytes. Uses omake's arithmetic which depends
-# on OCaml's int
-Word_size() =
-  if $(lt $(add $(int 1073741823) $(int 1)), $(int 0))
-    value 4
-  else
-    value 8
-
-#################################################################### build rule
-
-# annot, spot, spit files
-%.annot %.spot: %.ml %.cmi
-	$(OCamlC) -c $<
-
-%.spit: %.mli 
-	$(OCamlC) -c $<
-
-# of course it only works with unix
-OCamlMkLibC(name, files, ldflags) =
-  protected.COBJS=$(addsuffix .o, $(files))
-  dll$(name).so lib$(name).a: $(COBJS)
-    $(OCAMLMKLIB) -o $(name) $(LDFLAGS) $(ldflags) $(COBJS)
-  return $(array dll$(name).so, lib$(name).a)
-
-# If ocamlmklib does not work for you, you can do:
-# 1. Put -verbose switch to the above call of $(OCAMLMKLIB) and see the command.
-# 2. Tweak the commands ocamlmklib invokes for you environment.
-# 3. Redefine OCamlMklibC with the tweaked commands.
-# For example, in Linux,
 #
-# OCamlMkLibC(name, files, ldflags) =
-#   protected.COBJS=$(addsuffix .o, $(files))
-#   dll$(name).so lib$(name).a: $(COBJS)
-#     # Change the following
-#     $(CC) -shared -o dll$(name).so $(LDFLAGS) $(ldflags) $(COBJS)
-#     ar rc lib$(name).a $(COBJS); ranlib lib$(name).a
-#     # Upto here
-#   return $(array dll$(name).so, lib$(name).a)
-
-################################################################ config replace
-
-ConfReplaceAt(file)=
-  $(file): $(file).in
-    section: # I dunno but section is required
-      stdout = $(fopen $(file), w)
-      fsubst($(file).in)
-      case $"@\([A-Z0-9_]+\)@" g
-        getvar($1)
-      close($(stdout))
-
-ConfReplaceConfigH(file)=
-  $(file): $(file).in
-    section: # I dunno but section is required
-      stdout = $(fopen $(file), w)
-      fsubst($(file).in)
-      case $"#undef \([A-Z_0-9]+\)" g
-        try
-          v=$(getvar $1)
-          value $"#define $1 $(v)"
-        default
-          value $"/* undef $1 */"
-      close($(stdout))
-
-##################################################################### directory
-
-ROOT = $(dir .)
-SRCDIR = $(ROOT)/src
-
-################################################################### local build
-
-Subpackages_available(packs) =
-  sequence-forall($(fun elem, $(mem $(elem), all supported $(SUPPORTED_SUBPACKAGES))), $(packs))
-
-BuildExample(namex, modules, packages) = 
-  .PHONY: clean
-  if $(Subpackages_available $(packages))
-    subs=core $(packages)
-    # the library is created with -dllib: no -custom required
-    OCAML_BYTE_LINK_FLAGS=
-    OCAMLINCLUDES += $(SRCDIR)
-    OCAML_LIBS+= $(addprefix $(SRCDIR)/camlimages_, $(subs))
-    OCAML_BYTE_LINK_FLAGS+=-dllpath $(SRCDIR)
-    export
-    .DEFAULT: $(OCamlProgram $(namex), $(modules))
-  else
-    println(Warning: $(namex) is not built: it requires $(string $(packages)))
-
-  clean:
-    rm -f $(filter-proper-targets $(ls R, .))
-
-  export
-
-
-###############################################################################
-
+# Include the OMakefile in this directory.
+#
 .SUBDIRS: .
+#*********************************************************************#
+#                                                                     #
+#                          Caml Images                                #
+#                                                                     #
+#            Fran輟is Pessaux, projet Cristal, INRIA Rocquencourt     #
+#            Pierre Weis, projet Cristal, INRIA Rocquencourt          #
+#            Jun Furuse, projet Cristal, INRIA Rocquencourt           #
+#                                                                     #
+#  Copyright 1999-2004,                                               #
+#  Institut National de Recherche en Informatique et en Automatique.  #
+#  Distributed only by permission.                                    #
+#                                                                     #
+#*********************************************************************#
+
+DefineCommandVars()
+
+######################################################################## tools
+
+USE_OCAMLFIND = true
+
+if $(not $(OCAMLFIND_EXISTS))
+   eprintln(This project requires ocamlfind, but is was not found.)
+   eprintln(You need to install ocamlfind and run "omake --configure".)
+   exit 1
+
+OCAML_WHERE = $(shell ocamlc -where)
+
+##################################################################### configure
+
+open configure/Configure
+
+Check_header_library(xlib, xheader, xfunc) =
+  return $(and $(VerboseCheckCHeader $(xheader)), $(VerboseCheckCLib $(xlib), $(xfunc)))
+
+Have_library(libname, lib, header, func) =
+  setvar(this.HAVE_$(libname), $(Check_header_library $(lib), $(header), $(func)))
+  export
+
+Check_ocamlfind_package(package) = 
+  ConfMsgChecking($(package))
+  ConfMsgFound($(shell-success ocamlfind query $(package)))
+
+Check_pkg_config(package, option) =
+  ConfMsgChecking(Freetype)
+  ConfMsgFound($(shell-success $(package)-config $(option)))
+
+where1(com) =
+  WHERE = $(where $(prog))
+  if $(WHERE)
+    value $(nth 0, $(WHERE))
+  else
+    value
+
+# export $(WHERE)
+Check_prog_in_path(prog) =
+   ConfMsgChecking(for $(prog))
+   WHERE = $(where1 $(prog))
+   export WHERE
+   if $(WHERE)
+      ConfMsgResult(found $(WHERE))
+      return true
+   else
+      ConfMsgResult(FAILED - no $(prog) found)
+      return false
+
+# export $(WHERE)
+Check_file_in_path(path, file) =
+  ConfMsgChecking(for $(file))
+  WHERE = $(find-in-path-optional $(path), $(file))
+  export WHERE
+  if $(WHERE)
+    WHERE = $(nth 0, $(WHERE))
+    export WHERE
+    ConfMsgResult(found $(WHERE))
+    return true
+  else
+    WHERE =
+    export WHERE
+    ConfMsgResult(FAILED - no $(file) found)
+    return false
+  export WHERE
+
+# Return the size of word in bytes. Uses omake's arithmetic which depends
+# on OCaml's int
+Word_size() =
+  if $(lt $(add $(int 1073741823) $(int 1)), $(int 0))
+    value 4
+  else
+    value 8
+
+#################################################################### build rule
+
+# annot, spot, spit files
+%.annot %.spot: %.ml %.cmi
+	$(OCamlC) -c $<
+
+%.spit: %.mli 
+	$(OCamlC) -c $<
+
+# of course it only works with unix
+OCamlMkLibC(name, files, ldflags) =
+  protected.COBJS=$(addsuffix .o, $(files))
+  dll$(name).so lib$(name).a: $(COBJS)
+    $(OCAMLMKLIB) -o $(name) $(LDFLAGS) $(ldflags) $(COBJS)
+  return $(array dll$(name).so, lib$(name).a)
+
+# If ocamlmklib does not work for you, you can do:
+# 1. Put -verbose switch to the above call of $(OCAMLMKLIB) and see the command.
+# 2. Tweak the commands ocamlmklib invokes for you environment.
+# 3. Redefine OCamlMklibC with the tweaked commands.
+# For example, in Linux,
+#
+# OCamlMkLibC(name, files, ldflags) =
+#   protected.COBJS=$(addsuffix .o, $(files))
+#   dll$(name).so lib$(name).a: $(COBJS)
+#     # Change the following
+#     $(CC) -shared -o dll$(name).so $(LDFLAGS) $(ldflags) $(COBJS)
+#     ar rc lib$(name).a $(COBJS); ranlib lib$(name).a
+#     # Upto here
+#   return $(array dll$(name).so, lib$(name).a)
+
+################################################################ config replace
+
+ConfReplaceAt(file)=
+  $(file): $(file).in
+    section: # I dunno but section is required
+      stdout = $(fopen $(file), w)
+      fsubst($(file).in)
+      case $"@\([A-Z0-9_]+\)@" g
+        getvar($1)
+      close($(stdout))
+
+ConfReplaceConfigH(file)=
+  $(file): $(file).in
+    section: # I dunno but section is required
+      stdout = $(fopen $(file), w)
+      fsubst($(file).in)
+      case $"#undef \([A-Z_0-9]+\)" g
+        try
+          v=$(getvar $1)
+          value $"#define $1 $(v)"
+        default
+          value $"/* undef $1 */"
+      close($(stdout))
+
+##################################################################### directory
+
+ROOT = $(dir .)
+SRCDIR = $(ROOT)/src
+
+################################################################### local build
+
+Subpackages_available(packs) =
+  sequence-forall($(fun elem, $(mem $(elem), all supported $(SUPPORTED_SUBPACKAGES))), $(packs))
+
+BuildExample(namex, modules, packages) = 
+  .PHONY: clean
+  if $(Subpackages_available $(packages))
+    subs=core $(packages)
+    # the library is created with -dllib: no -custom required
+    OCAML_BYTE_LINK_FLAGS=
+    OCAMLINCLUDES += $(SRCDIR)
+    OCAML_LIBS+= $(addprefix $(SRCDIR)/camlimages_, $(subs))
+    OCAML_BYTE_LINK_FLAGS+=-dllpath $(SRCDIR)
+    export
+    .DEFAULT: $(OCamlProgram $(namex), $(modules))
+  else
+    println(Warning: $(namex) is not built: it requires $(string $(packages)))
+
+  clean:
+    rm -f $(filter-proper-targets $(ls R, .))
+
+  export
+
+
+###############################################################################
+