home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
amigalib.mk
next >
Wrap
Makefile
|
1995-07-25
|
4KB
|
123 lines
# Amiga Library Services - CD Administration Makefile
CDNAME = FrozenFish-Aug95
VOLNAME = FZFAUG95
PUBLISHER = "Amiga Library Services - (602) 491-0442"
PREPARER = "Fred Fish"
IMAGE = ISO3:$(CDNAME).iso
CONTENTSFMT = "==========\n\n%N %V %S\n\n%d\n\nAuthor: %a\nArchive: %P\n\n"
QUICKREFFMT = "%-12.12B %8.8V %9s %-S\n"
BUILT_FILES = CONTENTS.TXT QUICKREF.TXT DIRLIST.TXT FILELIST.TXT CRCLIST.TXT
all:
@echo "rerun make with one of:"
@echo " [iso rebuild $(BUILT_FILES)]"
# This target will rebuild all the machine generated files, after doing
# a "make clobber".
rebuild: $(BUILT_FILES)
# -a Include all files
# -A Map filenames to ISO compliant file names.
# -c Do not convert filenames
# -e Sort file extents by common extensions.
# -r Inhibit relocation of directories.
# -R Enable RockRidge extensions.
# -T Generate a file TRANS.TBL to make ISO names to original names.
iso:
mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
-V $(VOLNAME) $(CDNAME):
# Build the DIRLIST.TXT, FILELIST.TXT and CRCLIST.TXT files. Note that we ensure
# that a FILELIST.TXT and CRCLIST.TXT file exist by touching them before building
# the updated FILELIST.TXT, and then removing the CRCLIST.TXT file (even a
# previously existing one) after building the new FILELIST.TXT, since the
# CRCLIST.TXT needs to be rebuilt anyway if the FILELIST.TXT is touched. However
# since we can't compute a CRC for the CRC file itself without major
# trickery, the CRCLIST.TXT is generated using a copy of FILELIST.TXT that has
# had the CRCLIST.TXT line removed. All these gyrations ensure that the
# FILELIST.TXT file includes entries for both itself and the CRCLIST.TXT file,
# while the CRCLIST.TXT file contains no entry for itself.
#
# Also note that the output is stored in a temporary file on a different
# volume, so as to avoid problems on the Amiga with "find" trying to
# lock CRCLIST.TXT while it is open for write.
DIRLIST.TXT:
find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/$@
cp /tmp/$@ $@
rm -f /tmp/$@
FILELIST.TXT: DIRLIST.TXT CONTENTS.TXT QUICKREF.TXT
touch $@ CRCLIST.TXT
find . -type f -print | sort | sed "s:^./::" >/tmp/$@
cp /tmp/$@ $@
rm -f /tmp/$@ CRCLIST.TXT
CRCLIST.TXT: FILELIST.TXT
sed "/^CRCLIST.TXT$$/d" <FILELIST.TXT >/tmp/FILELIST.TXT
brik -Gvbf /tmp/FILELIST.TXT >$@
rm -f /tmp/FILELIST.TXT
# Generate a summary file called "CONTENTS.TXT".
CONTENTS.TXT:
echo "This file is generated automatically from the product info files" >$@
echo "included in this tree." >>$@
echo "Note that the 1000 nearly identical entries for the floppy disks" >>$@
echo "are not included." >>$@
echo "" >>$@
find . \( -name Product-Info -o -name '*.PI' \) -print \
| sort -f \
| sed "s:^./::" \
| sed "/D[0-9]*XX/d" \
| pitool -b -D -f - -F $(CONTENTSFMT) - >>/tmp/$@
cp /tmp/$@ $@
rm -f /tmp/$@
# Generate a quick reference file, which contains the name of the product,
# the version number, and the short description; one product per line.
QUICKREF.TXT:
echo "This file is generated automatically from the product info files" >$@
echo "included in this tree. See the 'CONTENTS.TXT' file for additional" >>$@
echo "information about each item." >>$@
echo "Note that the 1000 nearly identical entries for the floppy disks" >>$@
echo "are not included." >>$@
echo "" >>$@
pitool -b -D -F $(QUICKREFFMT) -f - . \
| sort -f \
| sed "/AmigaLibDisk/d" \
| uniq >>/tmp/$@
cp /tmp/$@ $@
rm -f /tmp/$@
# Clean out all the machine generated files in preparation for rebuilding them
# all.
clean:
rm -f *! *~
clobber: clean
rm -f $(BUILT_FILES)
# Examine the FILELIST.TXT and gripe about any names that are not strictly
# MS-DOS conformant (8.3, uppercase alphanumeric, etc).
dosnames: FILELIST.TXT
-doschk <FILELIST.TXT
grep "[^A-Z_0-9./]" <FILELIST.TXT >/tmp/badchars || true
@if test -s /tmp/badchars ; then \
echo "WARNING - The following pathnames contain illegal MS-DOS characters:"; \
cat /tmp/badchars; \
else true; fi
rm -f /tmp/badchars
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
@if test -s /tmp/TooLong ; then \
echo "WARNING - The following pathnames contain prefixes or suffixes over 8 characters long:"; \
cat /tmp/TooLong; \
else true; fi
rm -f /tmp/TooLong