From: Adam Chlipala Date: Sat, 16 Dec 2006 20:38:27 +0000 (+0000) Subject: domtool-doc X-Git-Tag: release_2010-11-19~287 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/44a5ce2fefb401654d7578db21f7e4e88b60b851 domtool-doc --- diff --git a/Makefile b/Makefile index 70a347c..7cf54fa 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,8 @@ COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \ .PHONY: all mlton smlnj install -mlton: bin/domtool-server bin/domtool-client bin/domtool-slave bin/domtool-admin +mlton: bin/domtool-server bin/domtool-client bin/domtool-slave \ + bin/domtool-admin bin/domtool-doc smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm @@ -56,6 +57,10 @@ src/domtool-admin.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb $(MAKE_MLB_BASE) >src/domtool-admin.mlb echo "main-admin.sml" >>src/domtool-admin.mlb +src/domtool-doc.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb + $(MAKE_MLB_BASE) >src/domtool-doc.mlb + echo "main-doc.sml" >>src/domtool-doc.mlb + openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \ -cm libssl.h.cm -D__builtin_va_list="void*" \ @@ -90,6 +95,9 @@ bin/domtool-slave: $(COMMON_MLTON_DEPS) src/domtool-slave.mlb bin/domtool-admin: $(COMMON_MLTON_DEPS) src/domtool-admin.mlb mlton -output bin/domtool-admin -link-opt -ldl src/domtool-admin.mlb +bin/domtool-doc: $(COMMON_MLTON_DEPS) src/domtool-doc.mlb + mlton -output bin/domtool-doc -link-opt -ldl src/domtool-doc.mlb + install: cp scripts/domtool-publish /usr/local/sbin/ cp scripts/domtool-reset-global /usr/local/sbin/ @@ -103,6 +111,7 @@ install: cp bin/domtool-slave /usr/local/sbin/ cp bin/domtool-client /usr/local/bin/domtool cp bin/domtool-admin /usr/local/bin/ + cp bin/domtool-doc /usr/local/bin/ .PHONY: grab_lib diff --git a/bin/.cvsignore b/bin/.cvsignore index 27134a3..16e624b 100644 --- a/bin/.cvsignore +++ b/bin/.cvsignore @@ -2,3 +2,4 @@ domtool-server domtool-client domtool-slave domtool-admin +domtool-doc diff --git a/src/.cvsignore b/src/.cvsignore index 29f6762..5356e7a 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -6,3 +6,4 @@ domtool-server.mlb domtool-client.mlb domtool-slave.mlb domtool-admin.mlb +domtool-doc.mlb diff --git a/src/main-doc.sml b/src/main-doc.sml new file mode 100644 index 0000000..3df2ad3 --- /dev/null +++ b/src/main-doc.sml @@ -0,0 +1,42 @@ +(* HCoop Domtool (http://hcoop.sourceforge.net/) + * Copyright (c) 2006, Adam Chlipala + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + *) + +(* Driver for documentation generation *) + +fun processArgs (args, basis, outdir, files) = + case args of + [] => (basis, outdir, files) + | "-basis" :: rest => processArgs (rest, true, outdir, files) + | "-out" :: dir :: rest => processArgs (rest, basis, dir, files) + | file :: rest => processArgs (rest, basis, outdir, file :: files) + +val _ = + let + val (basis, outdir, files) = processArgs (CommandLine.arguments (), + false, + OS.FileSys.getDir (), + []) + + val files = if basis then + Main.listBasis () @ files + else + files + in + Tycheck.allowExterns (); + Autodoc.autodoc {outdir = outdir, infiles = files} + end diff --git a/src/main.sig b/src/main.sig index 791b357..f8d6b94 100644 --- a/src/main.sig +++ b/src/main.sig @@ -45,6 +45,7 @@ signature MAIN = sig val service : unit -> unit val slave : unit -> unit + val listBasis : unit -> string list val autodocBasis : string -> unit end diff --git a/src/main.sml b/src/main.sml index 91ae29e..7457545 100644 --- a/src/main.sml +++ b/src/main.sml @@ -766,7 +766,7 @@ fun slave () = OpenSSL.shutdown sock end -fun autodocBasis outdir = +fun listBasis () = let val dir = Posix.FileSys.opendir Config.libRoot @@ -781,10 +781,11 @@ fun autodocBasis outdir = :: files) else loop files - - val files = loop [] in - Autodoc.autodoc {outdir = outdir, infiles = files} + loop [] end +fun autodocBasis outdir = + Autodoc.autodoc {outdir = outdir, infiles = listBasis ()} + end