home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD1.bin / useful / amigalib.mk < prev    next >
Makefile  |  1995-04-18  |  5KB  |  121 lines

  1. # Amiga Library Services - CD Administration Makefile
  2. #
  3. # This Makefile goes in the root directory of the "Useful Material" 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. #    This is a comprehensive listing of the material that includes
  8. #    much of the relevant information from the product info file,
  9. #    such as name, version, short description, long description, author,
  10. #    and path to the material.
  11. #
  12. # (2)    Build an INDEX file for all material in this tree.  This is a
  13. #    quick reference file that lists the program name, version, and
  14. #    short description of the material.
  15. #
  16. # (3)    Build a LOCATE file for all material in this tree.  This is a
  17. #    quick reference file that lists the program name, version, and
  18. #    and the path to the material.
  19. #
  20. # (4)    Build archives for the material in this tree on a "per submission"
  21. #    basis, and install them in the BBS tree on this CD, along with
  22. #    appropriate product info files.
  23.  
  24. SHELL =    /bin/sh
  25.  
  26. CONTENTS_FORMAT = "==========\n\n%N    %V    %S\n\n%d\n\nAuthor: %a\nPath: %P\n\n"
  27. INDEX_FORMAT =    "%-16.16N  %8.8V   %-S\n"
  28. LOCATE_FORMAT =    "%-16.16N  %8.8V   %P\n"
  29.  
  30. # The "base name" of this CD set.  Supply a default value here that is
  31. # typically overridden by an upper level make, or else passed as a command
  32. # line arg.
  33.  
  34. CDNAME =    FreshFish-Vol9
  35.  
  36. # This is the root directory for the BBS tree.  Typically it is assigned
  37. # a value like "FreshFish-Vol9-2:BBS" via a command line arg to Make, or
  38. # else is passed in by an upper level make.
  39.  
  40. BBSROOT =    $(CDNAME)-2:BBS
  41.  
  42. # This is the default thing to do.
  43.  
  44. all:    CONTENTS.guide CONTENTS INDEX LOCATE AllList
  45.  
  46.  
  47. # Generate a summary file called "CONTENTS".  Note that the entries in the
  48. # contents are generated in pathname sorted, case independent, order.
  49.  
  50. CONTENTS: AllList
  51.     @echo >$@ "This file is generated automatically from the product info files"
  52.     @echo >>$@ "included in this tree."
  53.     @echo >>$@ ""
  54.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  55.         pitool -f - -b -F $(CONTENTS_FORMAT) - >>$@
  56.     @if test  -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  57.  
  58.  
  59. # Generate an AmigaGuide format summary file called "CONTENTS.guide".
  60.  
  61. CONTENTS.guide: AllList CONTENTS-header
  62.     $(SHELL) GenCONTENTS.sh AllList >$@
  63.     @if test  -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  64.  
  65.  
  66. # Generate a quick reference file, which contains the name of the product,
  67. # the version number, and the short description; one product per line.
  68.  
  69. INDEX: AllList
  70.     @echo >$@ "This file is generated automatically from the product info files"
  71.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  72.     @echo >>$@ "information about each item."
  73.     @echo >>$@ ""
  74.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  75.         pitool -b -F $(INDEX_FORMAT) -f - - | sort -f | uniq >>$@
  76.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  77.  
  78. # Generate a quick reference file, which contains the name of the product,
  79. # the version number, and the short description; one product per line.
  80.  
  81. LOCATE:    AllList
  82.     @echo >$@ "This file is generated automatically from the product info files"
  83.     @echo >>$@ "included in this tree.  See the 'CONTENTS' file for additional"
  84.     @echo >>$@ "information about each item."
  85.     @echo >>$@ ""
  86.     egrep "/Product-Info$$|\.pi$$" <AllList | \
  87.         pitool -b -F $(LOCATE_FORMAT) -f - - | sort -f | uniq >>$@
  88.     @if test -f $@.info; then true; else echo "WARNING - missing $@.info"; fi
  89.  
  90. # Generate a list of all files and directories rooted at this point in the
  91. # file tree.  This target is only rebuilt when it does not exist, so the only
  92. # way to get rid of it is to either make "clobber" or manually delete it.
  93.  
  94. AllList:
  95.     find . -print | sort -f | sed "s:^./::" >/tmp/all.tmp
  96.     cp /tmp/all.tmp $@
  97.  
  98. # Pack selected material into archives in the BBS directory.  Note that
  99. # we have a hardwired hack to remove the PasTeX files from consideration
  100. # because if put in a single archive, it would be about 20Mb or more.
  101. # The PasTeX tree has to be specially treated and packed by hand.
  102. # (FIXME:  We would look in the same directory as the Product-Info file
  103. # for a script to run for such cases that need to be treated specially.)
  104.  
  105. BBS:    AllList
  106.     sed -e "/text\/tex\/PasTeX/d" \
  107.         -e "/sys\//d" <AllList >/tmp/all.tmp
  108.     $(SHELL) Pack.sh /tmp/all.tmp $(BBSROOT)
  109.  
  110. # Clean up files that are trash
  111.  
  112. clean:
  113.     rm -f *! *~
  114.  
  115. # Remove all automatically generated files.
  116.  
  117. clobber: clean
  118.     rm -f CONTENTS.guide CONTENTS INDEX LOCATE AllList
  119.  
  120.  
  121.