home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / amigalib.mk < prev    next >
Makefile  |  1994-11-27  |  3KB  |  93 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 archives for the material in this tree on a "per submission"
  20. #    basis, and install them in the BBS tree on this CD, along with
  21. #    appropriate product info files.
  22. #
  23.  
  24. SHELL=/bin/sh
  25. CONTENTS_FORMAT = "==========\n\n%N    %V    %S\n\n%d\n\nAuthor: %a\nPath: %P\n\n"
  26. INDEX_FORMAT = "%-16.16N  %8.8V   %-S\n"
  27. LOCATE_FORMAT =    "%-16.16N  %8.8V   %P\n"
  28.  
  29. # This is the default thing to do.
  30.  
  31. all:    CONTENTS INDEX LOCATE AllList
  32.  
  33.  
  34. # Generate a summary file called "CONTENTS".  Note that the entries in the
  35. # contents are generated in pathname sorted, case independent, order.
  36.  
  37. CONTENTS: AllList
  38.     @echo >$@ "This file is generated automatically from the product info files"
  39.     @echo >>$@ "included in this tree."
  40.     @echo >>$@ ""
  41.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  42.         pitool -f - -b -F $(CONTENTS_FORMAT) - >>$@
  43.     @if test  -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  44.  
  45.  
  46. # Generate a quick reference file, which contains the name of the product,
  47. # the version number, and the short description; one product per line.
  48.  
  49. INDEX: AllList
  50.     @echo >$@ "This file is generated automatically from the product info files"
  51.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  52.     @echo >>$@ "information about each item."
  53.     @echo >>$@ ""
  54.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  55.         pitool -b -F $(INDEX_FORMAT) -f - - | sort -f | uniq >>$@
  56.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  57.  
  58. # Generate a quick reference file, which contains the name of the product,
  59. # the version number, and the short description; one product per line.
  60.  
  61. LOCATE:    AllList
  62.     @echo >$@ "This file is generated automatically from the product info files"
  63.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  64.     @echo >>$@ "information about each item."
  65.     @echo >>$@ ""
  66.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  67.         pitool -b -F $(LOCATE_FORMAT) -f - - | sort -f | uniq >>$@
  68.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  69.  
  70. # Generate a list of all files and directories rooted at this point.
  71.  
  72. AllList:
  73.     find . -print | sort -f | sed "s:^./::" >/tmp/all.tmp
  74.     cp /tmp/all.tmp $@
  75.  
  76. # Feed the list of files and directories to the Pack.sh script, which picks
  77. # out all names of files or directories that are 3 levels deep and examines
  78. # them as potential candidates from which to generate archives in the BBS
  79. # tree.
  80.  
  81. BBS:    AllList
  82.     $(SHELL) Pack.sh AllList
  83.  
  84. # Clean up files that are trash.
  85.  
  86. clean:
  87.     rm -f *! *~
  88.  
  89. # Remove all automatically generated files.
  90.  
  91. clobber: clean
  92.     rm -f CONTENTS INDEX LOCATE AllList
  93.