home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / docs / src / makefile2html.gawk (.txt) < prev    next >
LaTeX Document  |  1997-01-24  |  891b  |  41 lines

  1. BEGIN {
  2.     active=0;
  3. /^\#[ \t]+BEGIN_DESC/ {
  4.     active=1;
  5.     match($0,/{.*}/);
  6.     section=substr($0,RSTART+1,RLENGTH-2);
  7.     next
  8. /^\#[ \t]+END_DESC/ {
  9.     active=0;
  10.     next
  11. /^\#/ {
  12.     if (active)
  13.     {
  14.     line=$0;
  15.     gsub(/^\#[ \t]*/,"",line);
  16.     sections[section]=sections[section] line "\n";
  17.     }
  18. END {
  19.     if ("makefile" in sections)
  20.     {
  21.     print sections["makefile"];
  22.     }
  23.     nfilt=split(secfilt,a_filt,/,[ \t]+/);
  24.     for (t=1; t<=nfilt; t++)
  25.     {
  26.     if (a_filt[t] in sections)
  27.         if (section=="makefile")
  28.         {
  29.         # nop
  30.         }
  31.         else if (section=="target")
  32.         print "This makefile defines the following targets:"
  33.         else if (section=="makevar")
  34.         print "This makefile defines the following targets:"
  35.         else
  36.         print "The section "section" contains:"
  37.         print "\\begin{description}\n"
  38.         print sections[section]
  39.         print "\n\\end{description}\n"
  40.     }
  41.