3 # This script will generate all manual pages
4 # in the current directory. It is recommeded that
5 # you run it from the man/man1 subdirectory under
6 # your GROMACS source tree. The manual pages will
7 # be installed by the "make install" command.
9 $bindir = shift || die("Error: provide the binary directory as first argument.");
10 $ptxt = shift || die("give me the location of the programs.txt file");
12 printf "Generating unix manual for GROMACS programs\n";
13 printf "Man pages will be written in the current dir.\n";
14 printf "-------------------------------------------\n";
17 open(MAM
,">$mam") || die("Opening $mam for writing");
18 printf(MAM
"# This file has been generated by mknroff.pl. Don't edit it.\n");
19 printf(MAM
"man_MANS = ");
24 @exclude = ( "my_dssp", "copyrgt", "addquote", "GMXRC", "completion.csh",
25 "completion.zsh", "average", "completion.bash", "luck",
26 "xplor2gmx.pl", "mptest", "ffscan", "demux.pl", "gentop", "mkyaw",
27 "tune_dip", "tune_pol", "hrefify", "options", "genvsites",
28 "pdtest", "bastat", "ehole", "GMXRC.bash", "GMXRC.csh",
32 open(PPP
,"$ptxt") || die("Can't open $ptxt");
34 while($line = <PPP
>) {
35 if ((index($line,"\|") > 0) && (index($line,"HEAD") < 0)) {
37 @tmp = split('\|',$line);
39 if (!defined $desc{$tmp[0]}) {
40 $desc{$tmp[0]} = $tmp[1];
44 printf("Multiple entries for $tmp[0] in $ptxt\n");
49 printf("npp = $npp\n");
53 @PROGRAMS = glob("[a-z]*");
57 foreach $program ( @PROGRAMS ) {
59 foreach $exc ( @exclude ) {
60 if ( $exc eq $program ) {
64 # Kick out the double precision variants
65 if ($program ne "${prev}_d" ) {
66 if ($cont && ( -x
"$bindir/$program" )) {
68 system("$bindir/$program -quiet -man nroff >& /dev/null");
69 $pn = "${program}.nroff";
72 open(PN
,"$pn") || die("Opening $pn");
73 open(P1
,">$p1") || die("Opening $p1 for writing");
76 if ($line eq $program) {
77 if (defined $desc{$program}) {
79 printf(P1
"$program - $desc{$program}\n");
82 printf (" - please add description in $ptxt\n");
83 printf (P1
"$program\n");
87 printf(P1
"%s\n",$line);
93 printf(MAM
" \\\n\t$p1");
99 printf(MAM
"\n\nEXTRA_DIST = \${man_MANS}\n\n");