summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 21:54:20 +0200
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 21:54:20 +0200
commit8456506c0b9c8e78eec2cc464851cef36ca03398 (patch)
tree497522a4422a1290ac3dae006c2808c293216c5d
parent60ba54ffe01be85ec6f1d6948c1ca4b6db1cf165 (diff)
downloadSystemeReseaux-Projet-8456506c0b9c8e78eec2cc464851cef36ca03398.tar.gz
SystemeReseaux-Projet-8456506c0b9c8e78eec2cc464851cef36ca03398.zip
Revise build system.
-rw-r--r--src/Makefile16
-rw-r--r--src/_tags1
-rw-r--r--src/primes.ml2
-rw-r--r--src/util.ml9
4 files changed, 17 insertions, 11 deletions
diff --git a/src/Makefile b/src/Makefile
index dca72f6..0662993 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,13 +1,15 @@
-OCAMLBUILD=ocamlbuild -classic-display \
- -tags annot,debug,thread \
- -libs unix
+CAML=example.ml primes.ml \
+ manager.ml poolserver.ml poolclient.ml \
+ kahn_pipe.ml kahn_seq.ml kahn_stdio.ml \
+ proto.ml util.ml
-all: primes.native example.native manager.native poolserver.native poolclient.native
+BIN=example.native primes.native \
+ manager.native poolserver.native poolclient.native
-%.native: %.ml kahn_pipe.ml kahn_seq.ml kahn_stdio.ml proto.ml util.ml
- $(OCAMLBUILD) $@
+all: $(CAML)
+ ocamlbuild $(BIN)
clean:
- $(OCAMLBUILD) -clean
+ ocamlbuild -clean
diff --git a/src/_tags b/src/_tags
new file mode 100644
index 0000000..788612f
--- /dev/null
+++ b/src/_tags
@@ -0,0 +1 @@
+true: use_unix, debug, thread, annot
diff --git a/src/primes.ml b/src/primes.ml
index 592fdc9..a91b11c 100644
--- a/src/primes.ml
+++ b/src/primes.ml
@@ -36,7 +36,7 @@ module Primes (K : Kahn.S) = struct
let main : int process =
(delay new_channel ()) >>=
- (fun (q_in, q_out) -> doco [ integers 500 q_out ; primes q_in ])
+ (fun (q_in, q_out) -> doco [ integers 2000 q_out ; primes q_in ])
>>= (fun () -> return 42)
end
diff --git a/src/util.ml b/src/util.ml
index ae1f049..87e779e 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -2,9 +2,12 @@ open Unix
let (@@) a b = a b
-type id = int * int
-let new_id () : id = (Random.int 10000000, Random.int 10000000)
-let id_str (a, b) = Format.sprintf "%d.%d" a b
+type id = int * int * int
+let new_id () : id =
+ ( Random.int 10000000,
+ Random.int 10000000,
+ Random.int 10000000 )
+let id_str (a, b, c) = Format.sprintf "%d.%d.%d" a b c
(* make_addr : string -> int -> sockaddr *)
let make_addr host port =