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" );
31 open(PPP
,"$ptxt") || die("Can't open $ptxt");
33 while($line = <PPP
>) {
34 if ((index($line,"\|") > 0) && (index($line,"HEAD") < 0)) {
35 @tmp = split('\|',$line);
37 if (!defined $desc{$tmp[0]}) {
38 $desc{$tmp[0]} = $tmp[1];
42 printf("Multiple entries for $tmp[0] in $ptxt\n");
47 printf("npp = $npp\n");
51 @PROGRAMS = glob("[a-z]*");
55 foreach $program ( @PROGRAMS ) {
57 foreach $exc ( @exclude ) {
58 if ( $exc eq $program ) {
62 # Kick out the double precision variants
63 if ($program ne "${prev}_d" ) {
64 if ($cont && ( -x
"$bindir/$program" )) {
66 system("$bindir/$program -quiet -man nroff >& /dev/null");
67 $pn = "${program}.nroff";
70 open(PN
,"$pn") || die("Opening $pn");
71 open(P1
,">$p1") || die("Opening $p1 for writing");
74 if ($line eq $program) {
75 if (defined $desc{$program}) {
77 printf(P1
"$program - $desc{$program}\n");
80 printf (" - please add description in $ptxt\n");
81 printf (P1
"$program\n");
85 printf(P1
"%s\n",$line);
91 printf(MAM
" \\\n\t$p1");
97 printf(MAM
"\n\nEXTRA_DIST = \${man_MANS}\n\n");