[Pkg-ocaml-maint-commits] r1438 - trunk/tools/dh_ocaml

Stefano Zacchiroli zack@costa.debian.org
Sat, 09 Jul 2005 12:05:13 +0000


Author: zack
Date: 2005-07-09 12:05:12 +0000 (Sat, 09 Jul 2005)
New Revision: 1438

Modified:
   trunk/tools/dh_ocaml/Makefile
Log:
- enable native code building of ocaml-md5sums
- no longer uses findlib
- clean up


Modified: trunk/tools/dh_ocaml/Makefile
===================================================================
--- trunk/tools/dh_ocaml/Makefile	2005-07-09 11:52:32 UTC (rev 1437)
+++ trunk/tools/dh_ocaml/Makefile	2005-07-09 12:05:12 UTC (rev 1438)
@@ -1,5 +1,4 @@
 
-SCRIPTS = postinst-ocaml postrm-ocaml
 # DEBHELPER_VERSION := $(shell grep-available -X -F Package -s Version debhelper | cut -f 2 -d ' ')
 DEBHELPER_VERSION = 4.9.3
 OCAML_VERSION = 3.08.3
@@ -9,12 +8,18 @@
 DEBHELPER_DIR = debhelper-$(DEBHELPER_VERSION)
 NEW_DEBHELPER_DIR = debhelper-$(NEW_DEBHELPER_VERSION)
 FED_SUMS = ocaml-nox.md5sums ocaml.md5sums ocaml-compiler-libs.md5sums
+OCAMLC = ocamlc
+OCAMLOPT = ocamlopt
+OCAML_LIBS = unix str
 
-# all: ocaml-md5sums $(SCRIPTS) debhelper
-all: ocaml-md5sums $(SCRIPTS)
+all: ocaml-md5sums
+opt: ocaml-md5sums.opt
+world: all opt
 
 ocaml-md5sums: ocaml-md5sums.ml
-	ocamlfind ocamlc -package str,unix -linkpkg -o $@ $<
+	$(OCAMLC) $(patsubst %,%.cma,$(OCAML_LIBS)) -o $@ $<
+ocaml-md5sums.opt: ocaml-md5sums.ml
+	$(OCAMLOPT) $(patsubst %,%.cmxa,$(OCAML_LIBS)) -o $@ $<
 
 $(DEBHELPER_DSC):
 	apt-get -d source debhelper
@@ -51,5 +56,6 @@
 	wml -p 1-3 $< > $@
 
 clean:
-	rm -f $(TARGETS) $(FED_SUMS)
+	rm -f ocaml-md5sums ocaml-md5sums.opt $(FED_SUMS)
+	rm -f *.cm[aiox] *.cmxa *.[ao]