home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / amigalib.mk next >
Makefile  |  1995-07-25  |  4KB  |  123 lines

  1. # Amiga Library Services - CD Administration Makefile
  2.  
  3. CDNAME =    FrozenFish-Aug95
  4. VOLNAME =    FZFAUG95
  5. PUBLISHER =    "Amiga Library Services - (602) 491-0442"
  6. PREPARER =    "Fred Fish"
  7. IMAGE =        ISO3:$(CDNAME).iso
  8. CONTENTSFMT =    "==========\n\n%N    %V    %S\n\n%d\n\nAuthor: %a\nArchive: %P\n\n"
  9. QUICKREFFMT =    "%-12.12B %8.8V %9s  %-S\n"
  10. BUILT_FILES =    CONTENTS.TXT QUICKREF.TXT DIRLIST.TXT FILELIST.TXT CRCLIST.TXT
  11.  
  12. all:
  13.     @echo "rerun make with one of:"
  14.     @echo "  [iso rebuild $(BUILT_FILES)]"
  15.  
  16. # This target will rebuild all the machine generated files, after doing
  17. # a "make clobber".
  18.  
  19. rebuild: $(BUILT_FILES)
  20.  
  21. # -a    Include all files
  22. # -A    Map filenames to ISO compliant file names.
  23. # -c    Do not convert filenames
  24. # -e    Sort file extents by common extensions.
  25. # -r    Inhibit relocation of directories.
  26. # -R    Enable RockRidge extensions.
  27. # -T    Generate a file TRANS.TBL to make ISO names to original names.
  28.  
  29. iso:
  30.     mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
  31.       -V $(VOLNAME) $(CDNAME):
  32.  
  33. # Build the DIRLIST.TXT, FILELIST.TXT and CRCLIST.TXT files.  Note that we ensure
  34. # that a FILELIST.TXT and CRCLIST.TXT file exist by touching them before building
  35. # the updated FILELIST.TXT, and then removing the CRCLIST.TXT file (even a
  36. # previously existing one) after building the new FILELIST.TXT, since the
  37. # CRCLIST.TXT needs to be rebuilt anyway if the FILELIST.TXT is touched.  However
  38. # since we can't compute a CRC for the CRC file itself without major
  39. # trickery, the CRCLIST.TXT is generated using a copy of FILELIST.TXT that has
  40. # had the CRCLIST.TXT line removed.  All these gyrations ensure that the
  41. # FILELIST.TXT file includes entries for both itself and the CRCLIST.TXT file,
  42. # while the CRCLIST.TXT file contains no entry for itself.
  43. #
  44. # Also note that the output is stored in a temporary file on a different
  45. # volume, so as to avoid problems on the Amiga with "find" trying to
  46. # lock CRCLIST.TXT while it is open for write.
  47.  
  48. DIRLIST.TXT:
  49.     find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/$@
  50.     cp /tmp/$@ $@
  51.     rm -f /tmp/$@
  52.  
  53. FILELIST.TXT: DIRLIST.TXT CONTENTS.TXT QUICKREF.TXT
  54.     touch $@ CRCLIST.TXT
  55.     find . -type f -print | sort | sed "s:^./::" >/tmp/$@
  56.     cp /tmp/$@ $@
  57.     rm -f /tmp/$@ CRCLIST.TXT
  58.  
  59. CRCLIST.TXT: FILELIST.TXT
  60.     sed "/^CRCLIST.TXT$$/d" <FILELIST.TXT >/tmp/FILELIST.TXT
  61.     brik -Gvbf /tmp/FILELIST.TXT >$@
  62.     rm -f /tmp/FILELIST.TXT
  63.  
  64. # Generate a summary file called "CONTENTS.TXT".
  65.  
  66. CONTENTS.TXT:
  67.     echo "This file is generated automatically from the product info files" >$@
  68.     echo "included in this tree." >>$@
  69.     echo "Note that the 1000 nearly identical entries for the floppy disks" >>$@
  70.     echo "are not included." >>$@
  71.     echo "" >>$@
  72.     find . \( -name Product-Info -o -name '*.PI' \) -print \
  73.       | sort -f \
  74.       | sed "s:^./::" \
  75.       | sed "/D[0-9]*XX/d" \
  76.       | pitool -b -D -f - -F $(CONTENTSFMT) - >>/tmp/$@
  77.     cp /tmp/$@ $@
  78.     rm -f /tmp/$@
  79.  
  80. # Generate a quick reference file, which contains the name of the product,
  81. # the version number, and the short description; one product per line.
  82.  
  83. QUICKREF.TXT:
  84.     echo "This file is generated automatically from the product info files" >$@
  85.     echo "included in this tree.  See the 'CONTENTS.TXT' file for additional" >>$@
  86.     echo "information about each item." >>$@
  87.     echo "Note that the 1000 nearly identical entries for the floppy disks" >>$@
  88.     echo "are not included." >>$@
  89.     echo "" >>$@
  90.     pitool -b -D -F $(QUICKREFFMT) -f - . \
  91.       | sort -f \
  92.       | sed "/AmigaLibDisk/d" \
  93.       | uniq >>/tmp/$@
  94.     cp /tmp/$@ $@
  95.     rm -f /tmp/$@
  96.  
  97. # Clean out all the machine generated files in preparation for rebuilding them
  98. # all.
  99.  
  100. clean:
  101.     rm -f *! *~
  102.  
  103. clobber: clean
  104.     rm -f $(BUILT_FILES)
  105.  
  106. # Examine the FILELIST.TXT and gripe about any names that are not strictly
  107. # MS-DOS conformant (8.3, uppercase alphanumeric, etc).
  108.  
  109. dosnames: FILELIST.TXT
  110.     -doschk <FILELIST.TXT
  111.     grep "[^A-Z_0-9./]" <FILELIST.TXT >/tmp/badchars || true
  112.     @if test -s /tmp/badchars ; then \
  113.         echo "WARNING - The following pathnames contain illegal MS-DOS characters:"; \
  114.         cat /tmp/badchars; \
  115.     else true; fi
  116.     rm -f /tmp/badchars
  117.     grep "[A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9]" <FILELIST.TXT >/tmp/TooLong || true
  118.     @if test -s /tmp/TooLong ; then \
  119.         echo "WARNING - The following pathnames contain prefixes or suffixes over 8 characters long:"; \
  120.         cat /tmp/TooLong; \
  121.     else true; fi
  122.     rm -f /tmp/TooLong
  123.