X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=Goalfile.in;h=7a085e33cee2f79e318967893c4938cf34644af2;hb=81394242a7d6a47fad6d84ce33d488d38de2647a;hp=393b4e96b86da5ff7dde3a4530c6ab509377ad5c;hpb=2ac1b84cb49ad04e27b4543436b0227153fbfb15;p=goals.git diff --git a/Goalfile.in b/Goalfile.in index 393b4e9..7a085e3 100644 --- a/Goalfile.in +++ b/Goalfile.in @@ -18,20 +18,54 @@ include "ocaml.gl" +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 + + # 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. + let MENHIR = "@MENHIR@" let OCAMLDEP = "@OCAMLDEP@" let OCAMLFIND = "@OCAMLFIND@" let OCAMLLEX = "@OCAMLLEX@" # XXX let OCAMLFLAGS = [ "-g", "-safe-string", "-warn-error", "CDEFLMPSUVYZX+52-3" ] -let OCAMLPACKAGES = [ "-package", "str,unix", "-I", "src" ] +let OCAMLPACKAGES = [ "-package", "str,unix,threads", "-I", "src", "-thread" ] #let OCAMLFLAGS = "@OCAMLFLAGS@" #let OCAMLPACKAGES = "@OCAMLPACKAGES@" let objects = [ + # These must be in dependency order. "src/config.cmx", "src/utils.cmx", "src/cmdline.cmx", + "src/jobs.cmx", "src/ast.cmx", "src/parser.cmx", "src/lexer.cmx", @@ -41,27 +75,9 @@ let objects = [ "src/main.cmx" ] -let subdirs = [ "m4", "src", "stdlib", "tests" ] - -goal all = : "Goalfile", ocaml_link ("src/goals", objects) - -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 - - # 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 -} +goal tool = : ocaml_link ("src/goals", objects) ; +# Parser. "src/parser.mli", "src/parser.ml" : "src/parser.mly" { %MENHIR --explain %< # Hack required to break circular dependencies. @@ -76,7 +92,7 @@ goal maintainer-clean = : clean { # XXX Goalfile itself depends on this and we should probably have a # way to reevaluate it. # XXX Atomic output. -goal depend () = +goal depend = "src/.depend" : wildcard ("src/*.ml"), wildcard ("src/*.mli") { rm -f %@ %@-t # Like many existing tools, ocamldep produces make-compatible @@ -90,9 +106,23 @@ goal depend () = -include "src/.depend"; -"Goalfile": "Goalfile.in", "config.status" { - ./config.status %@ -} -"src/config.ml" : "src/config.ml.in", "config.status" { - ./config.status %@ -} +#---------------------------------------------------------------------- +# Documentation. + +let POD2MAN = "@POD2MAN@" + +goal documentation = : pod2man ("goals", "1"), + pod2man ("Goalfile", "5"), + pod2man ("goals-reference", "5") + +goal pod2man (page, section) = +"man/%page.%section" : "docs/%page.pod" { + rm -f %@ %@-t + mkdir -p man + %POD2MAN \ + -u \ + -c "goals" \ + --release "@PACKAGE_NAME@-@PACKAGE_VERSION@" \ + --section %section %< > %@-t + mv %@-t %@ +} \ No newline at end of file