# FILE: makerules.def
#
# This file contains a default set of MakeRules.  It is evaluated by
# pimake each time pimake loads another makerules.tcl file.
#
# NOTE: loading this file in every directory can be expensive.
# Comment out all the default rules except those that are actually in use.
########################################################################

########################################################################
# Default targets -- GNU conventions
########################################################################
# The 'all' target will be the default target adopted in any directory
# where the makerules.tcl file contains no MakeRules.  It should compile 
# and link any source code in the current directory and its 
# subdirectories into binary libraries and executables for the current 
# platform.
MakeRule Define {
    -targets		all
    -dependencies	configure
    -script		{Recursive all}
    -ruleType		default
}

# The 'configure' target should create any files and directories which 
# contain platform differences.
MakeRule Define {
    -targets		configure
    -dependencies	{}
    -script		{Recursive configure}
    -ruleType		default
}

#MakeRule Define {
#    -targets		check
#    -dependencies	all
#    -script		{Recursive check}
#    -ruleType		default
#}
#
#MakeRule Define {
#    -targets		install
#    -dependencies	all
#    -script		{Recursive install}
#    -ruleType		default
#}
#
#MakeRule Define {
#    -targets		install-strip
#    -dependencies	all
#    -script		{Recursive install-strip}
#    -ruleType		default
#}
#
#MakeRule Define {
#    -targets		uninstall
#    -dependencies	{}
#    -script		{Recursive uninstall}
#    -ruleType		default
#}

# The 'clean' target should remove all files created by the 'all'
# target, returning the directory to the state it is in following
# the build of the 'configure' target.
MakeRule Define {
    -targets		clean
    -dependencies	mostlyclean
    -script		{Recursive clean}
    -ruleType		default
}

# The 'mostlyclean' target should remove most files created by the
# 'all' target.  In most instances it does the same thing as 'clean'.
# It should only leave behind those files constructed by the 'all'
# target which take a long time to rebuild, and are unlikely to need
# rebuilding.
MakeRule Define {
    -targets		mostlyclean
    -dependencies	objclean
    -script		{Recursive mostlyclean}
    -ruleType		default
}

# The 'objclean' target should remove any intermediate files created
# by the compile and link processes which are not the final executable
# and library files, and any other analogous intermediate files of other
# parts of the ' all' target.
MakeRule Define {
    -targets		objclean
    -dependencies	{}
    -script		{Recursive objclean}
    -ruleType		default
}

MakeRule Define {
    -targets		maintainer-clean
    -dependencies	distclean
    -script		{Recursive maintainer-clean}
    -ruleType		default
}

# The 'distclean' target should remove all files created by the 'configure'
# target, leaving the directory in the same state in which it was distributed.
MakeRule Define {
    -targets		distclean
    -dependencies	clean
    -script		{Recursive distclean}
    -ruleType		default
}

# The 'upgrade' target should be built after unpacking a new release over
# the top of an old release.  It might remove files not found in the new
# release, or convert formats, etc.  It depends on distclean, so that
# the upgrade is done on a source code basis
MakeRule Define {
    -targets		upgrade
    -script		{Recursive upgrade}
    -ruleType		default
}

#MakeRule Define {
#    -targets		srcdist
#    -dependencies	{}
#    -ruleType		default
#}
#
#MakeRule Define {
#    -targets		bindist
#    -dependencies	install
#    -ruleType		default
#}
#

# A 'help' target which lists the default set of targets
MakeRule Define {
    -targets		help
    -script		{
	puts "Default targets:\n\thelp\t\tprint this message\n\tall\t\tbuild\
	all executables\n\tconfigure\tplatform-specific preparations
	objclean\tremove intermediate object files\n\tclean\t\tremove\
	executables and libraries\n\tdistclean\tremove all files not in\
	source distribution\n\tmaintainer-clean\tremove all generated files
	upgrade\t\tremove all files not in latest release"
			}
    -ruleType		default
}
