home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / amigalib.mk < prev    next >
Makefile  |  1995-01-31  |  3KB  |  91 lines

  1. # Amiga Library Services - CD Administration Makefile
  2. #
  3. # This Makefile goes in the root directory of the BBS tree, and
  4. # is responsible for doing such things as:
  5. #
  6. # (1)    Build an accumulated "Contents" file for all material in this tree.
  7. #
  8. # (2)    Build a "Quick Reference" file for all material in this tree.
  9. #
  10.  
  11. CONTENTS_FORMAT = "==========\n\n%N    %V    %S\n\n%d\n\nAuthor: %a\nPath: %P\n\n"
  12. INDEX_FORMAT =    "%-16.16N  %8.8V   %-S\n"
  13. LOCATE_FORMAT =    "%-16.16N  %8.8V   %P\n"
  14.  
  15. SHELL =    /bin/sh
  16.  
  17. all:    CONTENTS.guide CONTENTS INDEX LOCATE FILES.BBS
  18.  
  19. # Generate a summary file called "CONTENTS".  Note that the entries in the
  20. # contents are generated in pathname sorted, case independent, order.
  21.  
  22. CONTENTS: AllList
  23.     @echo >$@ "This file is generated automatically from the product info files"
  24.     @echo >>$@ "included in this tree."
  25.     @echo >>$@ ""
  26.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  27.         pitool -f - -b -F $(CONTENTS_FORMAT) - >>$@
  28.     @if test  -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  29.  
  30.  
  31. # Generate an AmigaGuide format summary file called "CONTENTS.guide".
  32.  
  33. CONTENTS.guide: AllList CONTENTS-header
  34.     $(SHELL) GenCONTENTS.sh AllList >$@
  35.     @if test  -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  36.  
  37. # Generate a quick reference file, which contains the name of the product,
  38. # the version number, and the short description; one product per line.
  39.  
  40. INDEX: AllList
  41.     @echo >$@ "This file is generated automatically from the product info files"
  42.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  43.     @echo >>$@ "information about each item."
  44.     @echo >>$@ ""
  45.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  46.         pitool -b -F $(INDEX_FORMAT) -f - - | sort -f | uniq >>$@
  47.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  48.  
  49. # Generate a quick reference file, which contains the name of the product,
  50. # the version number, and the short description; one product per line.
  51.  
  52. LOCATE:    AllList
  53.     @echo >$@ "This file is generated automatically from the product info files"
  54.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  55.     @echo >>$@ "information about each item."
  56.     @echo >>$@ ""
  57.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  58.         pitool -b -F $(LOCATE_FORMAT) -f - - | sort -f | uniq >>$@
  59.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  60.  
  61. # Generate a list of all files and directories rooted at this point in the
  62. # file tree.  This target is only rebuilt when it does not exist, so the only
  63. # way to get rid of it is to either make "clobber" or manually delete it.
  64.  
  65. AllList:
  66.     find . -print | sort -f | sed "s:^./::" >/tmp/all.tmp
  67.     cp /tmp/all.tmp $@
  68.  
  69. # Build default FILES.BBS files in all the directories that have 
  70. # product info files.  First we find and delete existing files, since
  71. # the default is to append to the file.  Note we have to sort the files
  72. # after creating them.
  73.  
  74. FILES.BBS:
  75.     rm -f */files.bbs
  76.     pitool -b .
  77.     for i in `find . -name files.bbs -print`; \
  78.     do \
  79.         sort -f <$$i >/tmp/files.bbs; \
  80.         cp /tmp/files.bbs $$i; \
  81.     done
  82.  
  83. clean:
  84.     rm -f *! *~
  85.  
  86. # Remove all automatically generated files.
  87.  
  88. clobber: clean
  89.     rm -f CONTENTS.guide CONTENTS INDEX LOCATE AllList
  90.     rm -f */files.bbs
  91.