[jamming] Confused by SubDir

Russell rjshaw at iprimus.com.au
Mon Feb 3 06:38:53 PST 2003


Hi all,

When i put: SubDir TOP d1 ... dn ;
into a jamfile, is the directory: TOP d1 ... dn
always supposed to be the current directory of that jamfile,
or is it designed so that the following commands can be made to
work in a directory other than the current one?

http://public.perforce.com/public/jam/src/Jambase

rule SubDir
{
	#
	# SubDir TOP d1 ... ;
	#
	# Support for a project tree spanning multiple directories.
	#
	# SubDir introduces a Jamfile that is part of a project tree whose
	# root is $(TOP).  TOP is a user-selected variable name for the
	# tree; d1 ... are the directory elements that lead from the root
	# of the tree to the directory of the Jamfile.
	#
	# When jam reads the Jamfile in the current working directory
	# (CWD), the first SubDir call sets $(TOP) to the back path to
	# the project root for use by subsequent SubDir calls.  The path
	# contains one ../ for each directory from the root.
	#
	# Each SubDir call sets the (fixed) variable $(SUBDIR) to the path
	# from the CWD to the named directory.  SubDir also sets other
	# Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) to $(SUBDIR),
	# so that file names within the Jamfile refer to $(SUBDIR).
	#
	# The first invocation of SubDir for TOP includes the
	# project-specific rules files $(TOPRULES).  If $(TOPRULES) is
	# not set SubDir looks for a Jamrules in $(TOP) and includes that
	# if present.
	#
	# SubDir supports different TOPs for separate project trees; it
	# simply uses the last value of $(SUBDIR) instead of the CWD when
	# computing the path to $(TOP).




More information about the jamming mailing list