Merged silc_1_0_branch to trunk.
[silc.git] / scripts / silcdoc / silcdoc
index bf5069aab9e603f46729d76d1ed206a4727ce566..8425249ec14c828c0fb9f2fc2e139b764bed43c7 100755 (executable)
@@ -77,7 +77,8 @@ if [ "$TYPE" = "PS" ]; then
 
   cd $path
 
-#  rm -rf /tmp/silcdoc.tex
+  rm -rf /tmp/silcdoc.tex
+  exit 0
 fi
 
 #
@@ -99,11 +100,11 @@ if [ "$TYPE" = "HTML" ]; then
 
   # Generate index template from the DIRECTORY files. The template for
   # the generated index template is INDEX.tmpl.
-  files=`find $SRC -name "DIRECTORY"`
-  for i in $files
+  dfiles=`find $SRC -name "DIRECTORY"`
+  for i in $dfiles
   do
     # Get library name
-    name=`grep "@LIBRARY=" $i |cut -d=  -f2`
+    name=`grep "@LIBRARY=" $i |cut -d=  -f2-`
     fname=`grep "@FILENAME=" $i |cut -d=  -f2`
     links=`grep "@LINK=" $i |cut -d=  -f2 |cut -d:  -f1`
 
@@ -112,7 +113,7 @@ if [ "$TYPE" = "HTML" ]; then
     echo "<a href="$fname"><img src="box.gif" border="0" alt="">$name</a><br />" >>$DST/index.tmpl
     for k in $links
     do
-      n=`grep $k $i |cut -d=  -f2 |cut -d:  -f2`
+      n=`grep $k $i |cut -d=  -f2 |cut -d:  -f2-`
       echo "<li><a href="$k">$n</a>" >>$DST/$fname.links
       echo "&nbsp;&nbsp;&nbsp; <a href="$k"><img src="box2.gif" border="0" alt="">$n</a><br />" >>$DST/index.tmpl
     done
@@ -169,18 +170,17 @@ if [ "$TYPE" = "HTML" ]; then
     files=`find $DST -name ""$i"-*.html"`
     for k in $files
     do
-      sh gen.sh $DST gen_index.php 0 $k $k
+      sh gen.sh $DST gen_index.php 0 "$k" "$k"
     done
 
     rm -f $DST/$i-index.tmpl
   done
 
   # Generate the index and TOC files from the DIRECTORY files
-  files=`find $SRC -name "DIRECTORY"`
-  for i in $files
+  for i in $dfiles
   do
     # Get library name
-    name=`grep "@LIBRARY=" $i |cut -d=  -f2`
+    name=`grep "@LIBRARY=" $i |cut -d=  -f2-`
     fname=`grep "@FILENAME=" $i |cut -d=  -f2`
 
     # Generate links for this library
@@ -196,17 +196,18 @@ if [ "$TYPE" = "HTML" ]; then
 
   # Generate the top index.html file
   index=`find $SRC -name "LIBINDEX"`
-  version=`grep SILC_VERSION_STRING $SRC/../includes/version_internal.h |cut -d\"  -f2`
+  version=`grep "define SILC_VERSION_STRING" $SRC/../includes/silcversion.h |cut -d\"  -f2`
   curdate=`date`
   sed -e "/@VERSION@/s//$version/" -e "/@DATE@/s//$curdate/" -e "/@BODY@/ r $DST/index.html.tmp" -e s/@BODY@//g $index >$DST/index.html
   sh gen.sh $DST gen_index.php 2 $DST/index.html $DST/index.html
 
   # Generate the index toolkit_index.html file
-  $ROBO /tmp/silcdoc.html/silcdoc_xref $DST/toolkit_index.html INDEX HTML TITLE "SILC Toolkit Index"
+  $ROBO $DST/silcdoc_xref $DST/toolkit_index.html INDEX HTML TITLE "SILC Toolkit Index"
   sh gen.sh $DST gen_index.php 2 $DST/toolkit_index.html $DST/toolkit_index.html
 
   # Cleanup
   rm -rf $DST/index.html.tmp
   rm -rf /tmp/silcdoc.html
   rm -rf /tmp/silcdoc_html.html
+  exit 0
 fi