Skip to content

Commit

Permalink
Started the portage to Dibrawi.
Browse files Browse the repository at this point in the history
Installed the omake setup, and started removing the Batteries
dependency.
  • Loading branch information
smondet committed Dec 6, 2009
1 parent 226c013 commit 3e4f108
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 122 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,6 @@ dbw
dbw.native
dbwpp
dbwpp.native
*~
*.omc
.omake*
47 changes: 47 additions & 0 deletions OMakefile
@@ -0,0 +1,47 @@



.PHONY: clean update_yaboons

USE_OCAMLFIND = true

OCAMLPACKS[] =
xml-light
unix
extlib
pcre
sexplib.syntax


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

NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))

OCAMLFLAGS +=
OCAMLCFLAGS +=
OCAMLOPTFLAGS +=
OCAML_LINK_FLAGS +=
OCAML_BYTE_LINK_FLAGS +=
OCAML_NATIVE_LINK_FLAGS +=
OCAMLFINDFLAGS += -syntax camlp4o


clean:
rm -fr _build OMakefile.omc OMakeroot.omc .omakedb .omakedb.lock

update_yaboons: # Go for the last version
svn export http\://yaboon.googlecode.com/svn/trunk/PolyComp/PolyComp.ml src/lib/Yaboon_PolyComp.ml


if $(not $(file-exists _build/))
mkdir -p _build/lib _build/app

vmount(-l, src/, _build/)


.SUBDIRS: _build/lib _build/app

9 changes: 9 additions & 0 deletions OMakeroot
@@ -0,0 +1,9 @@

#open build/C
open build/OCaml
#open build/LaTeX

DefineCommandVars()


.SUBDIRS: .
76 changes: 0 additions & 76 deletions myocamlbuild.ml

This file was deleted.

7 changes: 7 additions & 0 deletions src/app/OMakefile
@@ -0,0 +1,7 @@

OCAML_LIBS += ../lib/dibrawi
OCAMLINCLUDES += ../lib/

test_dbw: $(OCamlProgram test_dbw, test_dbw)

.DEFAULT: $(OCamlProgram dbw, dbw) $(OCamlProgram dbwpp, dbwpp)
10 changes: 10 additions & 0 deletions src/lib/OMakefile
@@ -0,0 +1,10 @@

LIB_MODULES[] =
Yaboon_PolyComp
dibrawi_std
dibrawi_templating
dibrawi

LIB_NAME = dibrawi

.DEFAULT: $(OCamlLibrary $(LIB_NAME), $(LIB_MODULES))
89 changes: 89 additions & 0 deletions src/lib/Yaboon_PolyComp.ml
@@ -0,0 +1,89 @@
(******************************************************************************)
(* Copyright (c) 2008, Sebastien Mondet *)
(* *)
(* Permission is hereby granted, free of charge, to any person *)
(* obtaining a copy of this software and associated documentation *)
(* files (the "Software"), to deal in the Software without *)
(* restriction, including without limitation the rights to use, *)
(* copy, modify, merge, publish, distribute, sublicense, and/or sell *)
(* copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following *)
(* conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be *)
(* included in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE 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 SOFTWARE OR THE USE OR *)
(* OTHER DEALINGS IN THE SOFTWARE. *)
(******************************************************************************)

module Comparisons = struct
let eqpoly = (=)
let nepoly = (<>)
let ltpoly = (<)
let gtpoly = (>)
let lepoly = (<=)
let gepoly = (>=)

let eqphy = (==)

let eqi (a:int) (b:int) = eqpoly a b
let eqf (a:float) (b:float) = eqpoly a b
let nei (a:int) (b:int) = nepoly a b
let nef (a:float) (b:float) = nepoly a b
let lti (a:int) (b:int) = ltpoly a b
let ltf (a:float) (b:float) = ltpoly a b
let gti (a:int) (b:int) = gtpoly a b
let gtf (a:float) (b:float) = gtpoly a b
let lei (a:int) (b:int) = lepoly a b
let lef (a:float) (b:float) = lepoly a b
let gei (a:int) (b:int) = gepoly a b
let gef (a:float) (b:float) = gepoly a b

let eqs (a:string) (b:string) = (String.compare a b) = 0

let minpoly = min
let maxpoly = max
let mini (a:int) (b:int) = minpoly a b
let minf (a:float) (b:float) = minpoly a b
let maxi (a:int) (b:int) = maxpoly a b
let maxf (a:float) (b:float) = maxpoly a b
end
module NoPolyPhy = struct
type shouldnt_be_used
let (==) (x:shouldnt_be_used) (y:shouldnt_be_used) = false
let (!=) (x:shouldnt_be_used) (y:shouldnt_be_used) = false
end

module CompAndNoPolyPhy = struct
include Comparisons
include NoPolyPhy
end

module CompAndOveridePoly = struct
include CompAndNoPolyPhy
let (=) = eqi
let (=.) = eqf
let (<>) = eqi
let (<>.) = eqf
let (<) = lti
let (<.) = ltf
let (>) = gti
let (>.) = gtf
let (<=) = lei
let (<=.)= lef
let (>=) = gei
let (>=.)= gef
let (=$=) = eqs
let (=@=) = eqpoly
let min = mini
let max = maxi
end


0 comments on commit 3e4f108

Please sign in to comment.