+let subdirs = [ "m4", "src", "stdlib", "docs", "man", "tests" ]
+
+goal all = : "Goalfile", tool, documentation;
+
+"Goalfile": "Goalfile.in", "config.status" {
+ ./config.status %@
+}
+"src/config.ml" : "src/config.ml.in", "config.status" {
+ ./config.status %@
+}
+
+goal clean = {
+ for d in %subdirs; do
+ pushd $d
+ rm -f *~
+ rm -f *.cmi *.cmo *.cmx *.o
+ popd
+ done
+ rm -f src/parser.ml src/parser.mli src/lexer.ml src/parser.conflicts
+ rm -f man/*.1 man/*.5
+ rm -f tests/*.log
+
+ # We don't delete src/goals because it is required to do builds.
+ # If you want to really delete it, use the maintainer-clean rule.
+}
+
+goal maintainer-clean = : clean {
+ rm -f src/goals
+}
+
+#----------------------------------------------------------------------
+# Build the goals tool itself.
+