File: compilation-examples

package info (click to toggle)
lablgl 1%3A1.06-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,316 kB
  • sloc: ansic: 12,852; ml: 12,372; tcl: 342; makefile: 307; xml: 84; perl: 12
file content (47 lines) | stat: -rw-r--r-- 1,372 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
46
47
From: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Date: Wed, 7 Aug 2019 10:50:23 +0200
Subject: make examples compile via "make"

Contributed-by: Russell Sears <sears@cs.berkeley.edu>
Integrated: Ralf Treinen <treinen@debian.org>
Fixes-bug:  #425465
Sent-to-upstream: to Jacques Garrigue by Ralf Treinen, Dec 3 2009
---
 Togl/examples/Makefile  | 14 +++++++++++++-
 Togl/examples/planet.ml |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Togl/examples/Makefile b/Togl/examples/Makefile
index 86fe6ca..da2168f 100644
--- 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)
diff --git a/Togl/examples/planet.ml b/Togl/examples/planet.ml
index 0a0f3fb..9d84849 100644
--- 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