protected String
	findRelPath(Makefile descendant) throws NotDescendantException,
					 	IOException
	{
		String root_path = getBuildPath();
		String descendant_path = descendant.getBuildPath();

		if (descendant_path.startsWith(root_path)) {
			/*
			 * find depth of descendant relative to root,
			 * and generate the path to go up the file tree
			 */
			String
			path_to_undo = descendant_path
				       .substring(root_path.length());
			String[]
			descent_segments = path_to_undo.split(File.separator);
			int depth = 0;
			StringBuilder path_builder;

			for (String descent_segment : descent_segments) {
				/* does segment go into a directory */
				if (descent_segment.length() > 0) {
					depth++;
				}
			}
			path_builder = new StringBuilder(TOWARDS_PARENT.length *
							 depth
							 + 1);
			for (int segment_i = 0; segment_i < depth;
			     segment_i++) {
				path_builder.append(TOWARDS_PARENT);
			}

			return path_builder.toString();
		} else {
			throw new NotDescendantException(descendant_path);
		}
	}