[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#425465: Examples are difficult to build



Package: liblablgl-ocaml-dev
Version: 1.02-2

The example directory has a makefile, but it doesn't include targets for the example binaries. Also, ocamlc won't build planet.ml. (I get a syntax error on: load "unix.cma";;)

The attached patch to /usr/share/doc/liblablgl-ocaml-dev/examples/ addresses both issues.

In the Makefile, the packages lablgl and lablgl.glut aren't strictly necessary. lablgl.togl pulls them in automatically.

Thanks!

-Rusty

diff -u examples-orig/Makefile examples/Makefile
--- examples-orig/Makefile	2007-05-21 13:37:31.000000000 -0700
+++ examples/Makefile	2007-05-21 13:34:19.000000000 -0700
@@ -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 -u examples-orig/planet.ml examples/planet.ml
--- examples-orig/planet.ml	2007-05-21 13:37:31.000000000 -0700
+++ examples/planet.ml	2007-05-21 13:22:15.000000000 -0700
@@ -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

Reply to: