home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 10 / Fresh_Fish_10_2352.bin / amigalib.mk < prev    next >
Makefile  |  1995-08-25  |  6KB  |  168 lines

  1. # Amiga Library Services - CD Administration Makefile
  2. #
  3. # This Makefile goes in the root directory of the CD-ROM master file
  4. # tree and is responsible for doing such things as:
  5. #
  6. #   *    Building the automatically generated files for the release.
  7. #
  8. #   *    "Cleaning up" the file tree.
  9. #
  10. #
  11. # Note:  The following list is incomplete as of vol 8.  More work
  12. # still needs to be done...
  13. # In order to build a new CD-ROM release, the following targets need
  14. # to be made, in the given order:
  15. #
  16. #   *    GNUdiffs    Populate the directory GNU:src/diffs, which
  17. #            contains diff files created from the contents
  18. #            of GNU:src/baseline and GNU:src/amiga.
  19. #
  20. #   *    coverage    Check that the manifest files completely cover
  21. #            the contents of the GNU: tree.
  22. #
  23. #   *    BBS        Populate the BBS portion of the CD-ROM from
  24. #            other parts.
  25. #
  26. #   *    iso        Build the ISO-9660 image suitable for writing
  27. #            to a CD recorder for testing.
  28.  
  29. # These things will probably need to be changed with each CD release
  30. # or whenever the host system changes configuration.
  31.  
  32. CDNAME =    FreshFish-Vol10
  33. VOLNAME =    $(CDNAME)
  34. IMAGE =        ISO3:$(VOLNAME).iso
  35. SCRATCHDIR =    /iso/scratch
  36.  
  37. # These things will probably remain constant across CD releases.
  38.  
  39. PUBLISHER =    "Amiga Library Services - (602) 491-0442"
  40. PREPARER =    "Fred Fish"
  41.  
  42. MAKE =        make
  43. MAKEFILE =    AmigaLib.mk
  44. SHELL =        /bin/sh
  45.  
  46. # Macros which are composites of other macros.
  47.  
  48. BBSROOT =    $(CDNAME):BBS
  49.  
  50. FLAGS_TO_PASS = \
  51.         "MAKE=$(MAKE)" \
  52.         "MAKEFILE=$(MAKEFILE)" \
  53.         "CDNAME=$(CDNAME)" \
  54.         "BBSROOT=$(BBSROOT)" \
  55.         "SCRATCHDIR=$(SCRATCHDIR)"
  56.  
  57. # The default thing to do is nothing, except to suggest things that
  58. # can be done.        
  59.  
  60. all:
  61.     @echo "rerun make with one of:"
  62.     @echo "  [iso, rebuild, FileList, CRCList, CONTENTS.guide]"
  63.  
  64. # This target will rebuild all the machine generated files, after doing
  65. # a "make clobber".
  66.  
  67. rebuild: DirList FileList CRCList
  68.  
  69. # -a    Include all files
  70. # -A    Map filenames to ISO compliant file names.
  71. # -c    Do not convert filenames
  72. # -e    Sort file extents by common extensions.
  73. # -r    Inhibit relocation of directories.
  74. # -R    Enable RockRidge extensions.
  75. # -T    Generate a file TRANS.TBL to make ISO names to original names.
  76.  
  77. iso:    CRCList
  78.     mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
  79.       -V $(VOLNAME) $(VOLNAME):
  80.  
  81. # Build the DirList, FileList and CRCList files.  Note that we ensure
  82. # that a FileList and CRCList file exist by touching them before building
  83. # the updated FileList, and then removing the CRCList file (even a
  84. # previously existing one) after building the new FileList, since the
  85. # CRCList needs to be rebuilt anyway if the FileList is touched.  However
  86. # since we can't compute a CRC for the CRC file itself without major
  87. # trickery, the CRCList is generated using a copy of FileList that has
  88. # had the CRCList line removed.  All these gyrations ensure that the
  89. # FileList file includes entries for both itself and the CRCList file,
  90. # while the CRCList file contains no entry for itself.
  91. #
  92. # Also note that the output is stored in a temporary file on a different
  93. # volume, so as to avoid problems on the Amiga with "find" trying to
  94. # lock CRCList while it is open for write.
  95.  
  96. DirList:
  97.     find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/DirList
  98.     cp /tmp/DirList $@
  99.     rm -f /tmp/DirList
  100.  
  101. FileList: DirList
  102.     touch $@ CRCList All.api CONTENTS.guide PIList
  103.     find . -type f -print | sort | sed "s:^./::" >/tmp/FileList
  104.     cp /tmp/FileList $@
  105.     rm -f /tmp/FileList CRCList All.api CONTENTS.guide PIList
  106.  
  107. CRCList: All.api CONTENTS.guide
  108.     sed "/^CRCList$$/d" <FileList >/tmp/FileList
  109.     brik -Gvbf /tmp/FileList >$@
  110.  
  111. # Generate a list of all product-info files in this tree, sorted by the
  112. # actual name of the product as recorded in the ".name" field and list
  113. # with fully qualified pathnames (not relative names).
  114. # Note that the sed command assumes that pwd returns the
  115. # unix style name "/FreshFish-Vol10/..."
  116.  
  117. PIList:    FileList
  118.     egrep -i <$? "Product-Info$$|\.pi$$" \
  119.       | sed -e "s:^:`pwd`/:" -e "s:^/::" -e "s@/@:@" \
  120.       | pitool -b -F "@%N@%i\n" -f - - \
  121.       | sort -f \
  122.       | sed -e "s:@.*@::" >$@
  123.  
  124. # Generate an accumulated product info file to use for searches.
  125.  
  126. All.api: PIList
  127.     pitool -s - <$? >$@
  128.     
  129. # Build the CONTENTS, LOCATE, and INDEX files in each major subtree.
  130. #
  131. # CONTENTS:
  132. #    (cd GNU && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) CONTENTS LOCATE INDEX)
  133. #    (cd New && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) CONTENTS LOCATE INDEX)
  134. #    (cd Useful && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) CONTENTS LOCATE INDEX)
  135.  
  136. # Build an amigaguide file CONTENTS.guide that directly accesses all
  137. # material on this disk that has a product info file.
  138.  
  139. CONTENTS.guide: PIList GenCONTENTS.sh
  140.     $(SHELL) GenCONTENTS.sh PIList >$@
  141.  
  142. # Do everything that needs to be done to populate the BBS section
  143. # of the CD-ROM set.  Normally expensive operations are not repeated
  144. # but simple copies are.
  145. #
  146. #BBS:
  147. #    (cd GNU && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) $@)
  148. #    (cd New && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) $@)
  149. #    (cd Useful && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) $@)
  150.  
  151. # Populate the GNU:src/diffs directory.
  152. # FIXME: This was broken in the move to an archived source dir.
  153. #GNUdiffs:
  154. #    (cd GNU/src/diffs && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) $@)
  155.  
  156. # Test the GNU: tree for coverage represented by manifest files.
  157. #
  158. #coverage:
  159. #    (cd GNU/manifests && $(MAKE) -f $(MAKEFILE) $(FLAGS_TO_PASS) $@)
  160.  
  161. # Clean out the machine generated files in preparation for rebuilding them.
  162.  
  163. clobber: clean
  164.     rm -f DirList FileList CRCList PIList All.api CONTENTS.guide
  165.     
  166. clean:
  167.     rm -f *! *~
  168.