home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd2.bin / bbs / amigalib.mk < prev    next >
Makefile  |  1994-11-28  |  3KB  |  99 lines

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