# Root MKPKG for IRAF.  The bootstrap utilities and libraries in the HOST
# subdirectory must be made before this can be run.

$verbose
$call	mkall					# make everything
$exit

sysgen:
	$call mkall
	$call update
	;

mkall:
	$ifeq (hostid, unix)  !(date)  $endif
	$echo "==================== MAKE IRAF! ========================="
	$echo "+"
	$call syslibs
	$call mathlibs
	$ifeq (USE_SHLIB, yes) $call shlib $endif
	# (fall through)
relink:
	$call sysexe
	$call packages
	$echo "====================== (done) ==========================="
	$ifeq (hostid, unix)  !(date)  $endif
	;

update:
	$call sysexe
	$call packages
	;

syslibs:
	$echo "====================== SYSLIBS =========================="
	$echo "+"
	$call sysgen@sys
	$echo "+" $echo "+"
	;

sysexe:
	$echo "====================== SYSEXE ==========================="
	$echo "+" $echo "+"
	$call update@sys
	$echo "+" $echo "+"
	;

mathlibs:
	$echo "====================== MATHLIBS ========================="
	$echo "+" $echo "+"
	$call mathgen@math
	$echo "+" $echo "+"
	;

packages:
	$echo "====================== PACKAGES ========================="
	$echo "+" $echo "+"
	$call update@pkg
	$echo "+" $echo "+"
	;

# STRIP -- Strip the system of all sources and other files not required to
# run the system, or for user programming.

strip:
	$echo "Ignore any messages about cannot delete a file."
	$echo "Be sure to do a `cd noao; mkpkg strip' as well."
	$echo "Stripping non-runtime files from IRAF source tree..."
	!rmfiles -f $(hlib)strip.iraf
	;

# SRCARC -- Make a source archive (TAR format) of the system.

srcarc:
	!wtar -of $(?tarfile) README mkpkg lib sys math pkg doc
	;
