Package: lablgl / 1:1.05-2

compilation-examples Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Contributed-by: Russell Sears <sears@cs.berkeley.edu>
Integrated: Ralf Treinen <treinen@debian.org>
Fixes-bug:  #425465
Description: make examples compile via "make"
Sent-to-upstream: to Jacques Garrigue by Ralf Treinen, Dec 3 2009

--- a/Togl/examples/Makefile
+++ b/Togl/examples/Makefile
@@ -1,4 +1,16 @@
 # Makefile for examples subdir
 
+PACKAGES = lablgl.togl,unix
+DERIVEDML = $(patsubst %.ml.gz,%.ml,$(wildcard *.ml.gz))
+
+all: $(patsubst %.ml,%.opt,$(wildcard *.ml) $(DERIVEDML))
+
+%.ml : %.ml.gz
+	gunzip -c $^ > $@
+
+%.opt : %.ml
+	ocamlfind ocamlopt -package $(PACKAGES) -c  $^
+	ocamlfind ocamlopt -package $(PACKAGES) -linkpkg -o $@ $^
+
 clean:
-	rm -f *.cm* *.o *.opt
+	rm -f *.cm* *.o *.opt $(DERIVEDML)
--- a/Togl/examples/planet.ml
+++ b/Togl/examples/planet.ml
@@ -1,6 +1,6 @@
 (* $Id: planet.ml,v 1.17 2001-09-07 06:50:01 garrigue Exp $ *)
 
-#load"unix.cma";;
+open Unix
 
 class planet togl = object (self)
   val togl = togl