stdlib: Implement split() function.
[goals.git] / Goalfile.in
index d38e70f..32ff7b5 100644 (file)
@@ -29,13 +29,15 @@ goal all = : "Goalfile", tool, documentation;
     ./config.status %@
 }
 
-goal clean = {
-    for d in %subdirs; do
-        pushd $d
-        rm -f *~
-        rm -f *.cmi *.cmo *.cmx *.o
-        popd
-    done
+goal clean = : wrap ("clean-subdir", subdirs), clean-subdir ("."), clean-other
+
+goal clean-subdir (dir) = {
+    cd %dir
+    rm -f *~
+    rm -f *.cmi *.cmo *.cmx *.o
+}
+
+goal clean-other = {
     rm -f src/parser.ml src/parser.mli src/lexer.ml src/parser.conflicts
     rm -f man/*.1 man/*.5
     rm -f tests/*.log
@@ -57,13 +59,9 @@ let MENHIR = "@MENHIR@"
 let OCAMLDEP = "@OCAMLDEP@"
 let OCAMLFIND = "@OCAMLFIND@"
 let OCAMLLEX = "@OCAMLLEX@"
-# XXX
-let CFLAGS = [ "-g", "-O2", "-I%OCAMLLIB", "-I." ]
-#let CFLAGS = "@CFLAGS@ -I%OCAMLLIB -I."
-let OCAMLFLAGS = [ "-g", "-safe-string", "-warn-error", "CDEFLMPSUVYZX+52-3" ]
-let OCAMLPACKAGES = [ "-package", "str,unix,threads", "-I", "src", "-thread" ]
-#let OCAMLFLAGS = "@OCAMLFLAGS@"
-#let OCAMLPACKAGES = "@OCAMLPACKAGES@"
+let CFLAGS = join (split ("@CFLAGS@"), ["-I%OCAMLLIB", "-I."])
+let OCAMLFLAGS = split ("@OCAMLFLAGS@")
+let OCAMLPACKAGES = join (split ("@OCAMLPACKAGES@"), ["-I", "src"])
 
 let objects = [
     # These must be in dependency order.
@@ -124,8 +122,7 @@ goal depend =
 let POD2MAN = "@POD2MAN@"
 
 goal documentation = : pod2man ("goals", "1"),
-                       pod2man ("Goalfile", "5"),
-                       pod2man ("goals-reference", "5")
+                       pod2man ("Goalfile", "5")
 
 goal pod2man (page, section) =
 "man/%page.%section" : "docs/%page.pod" {