# Amiga Library Services - CD Administration Makefile
#
# This Makefile goes in the root directory of the CD-ROM master file
# tree and is responsible for doing such things as:
#
#   *	Building the automatically generated files for the release.
#
#   *	"Cleaning up" the file tree.


# These things will probably need to be changed with each CD release
# or whenever the host system changes configuration.

CDNAME =	Online_Library
VOLNAME =	$(CDNAME)
IMAGE =		ISO1:$(VOLNAME).iso

# These things will probably remain constant across CD releases.

PUBLISHER =	"Amiga Library Services - (602) 491-0442"
PREPARER =	"Fred Fish"

MAKE =		make
MAKEFILE =	Makefile
SHELL =		/bin/sh

# The default thing to do is nothing, except to suggest things that
# can be done.		

all:
	@echo "rerun make with one of:"
	@echo "  [iso, rebuild, CRCList]"

# This target will rebuild all the machine generated files, after doing
# a "make clobber".

rebuild: CRCList

# -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:	CRCList
	mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
	  -V $(VOLNAME) $(VOLNAME):

# Build a CRCList file that can be used by brik to validate the CD-ROM
# contents at any time.  Since we can't compute a CRC for the CRCList
# file itself without major trickery, we remove it first so it does not
# show up in our file list.

CRCList:
	rm -f CRCList
	find . -type f -print | sort | sed "s:^./::" >/tmp/FileList
	sed "/^CRCList$$/d" </tmp/FileList >/tmp/FileList2
	brik -Gvbf /tmp/FileList2 >$@
	rm -f /tmp/FileList /tmp/FileList2

# Clean out the machine generated files in preparation for rebuilding them.

clobber: clean
	rm -f CRCList

clean:
	rm -f *! *~
