# of the License online. Please send any updates to "fred@gruntose.com". #
###############################################################################
+if [ ! -z "$CLEAN" ]; then
+ echo "in cleaning mode, will not build dependencies."
+ exit 0
+fi
+
# this script finds all of the headers used by a cpp file and outputs a
# list of other cpp files that are probably needed for building it.
##########################################################################
- local current_includes="$(mktemp $TEMPORARIES_DIR/zz_buildor_deps4-$base.XXXXXX)"
+ local current_includes="$(mktemp $TEMPORARIES_PILE/zz_buildor_deps4-$base.XXXXXX)"
rm -f "$current_includes"
- local partial_file="$(mktemp $TEMPORARIES_DIR/zz_buildor_deps5-$base.XXXXXX)"
+ local partial_file="$(mktemp $TEMPORARIES_PILE/zz_buildor_deps5-$base.XXXXXX)"
rm -f "$partial_file"
# find all the includes in this file and save to the temp file.
#echo "would write deps to: $code_file"
#echo ${dependency_accumulator[*]}
- local replacement_file="$(mktemp $TEMPORARIES_DIR/zz_buildor_deps3.XXXXXX)"
+ local replacement_file="$(mktemp $TEMPORARIES_PILE/zz_buildor_deps3.XXXXXX)"
# blanks is a list of blank lines that we save up in between actual content.
# if we don't hold onto them, we can have the effect of "walking" the static
echo -e "$opening_guard_line" >>"$replacement_file"
# now accumulate just the dependencies for a bit.
- local pending_deps="$(mktemp $TEMPORARIES_DIR/zz_buildor_deps2.XXXXXX)"
+ local pending_deps="$(mktemp $TEMPORARIES_PILE/zz_buildor_deps2.XXXXXX)"
rm -f "$pending_deps"
# iterate across all the dependencies we found.
# set the directory to that absolute path.
curr_parm="$prohibited_directory"
#echo "curr_parm: $curr_parm"
- outfile="$(mktemp $TEMPORARIES_DIR/zz_buildor_deps1.XXXXXX)"
+ outfile="$(mktemp $TEMPORARIES_PILE/zz_buildor_deps1.XXXXXX)"
find "$curr_parm" -iname "*.cpp" >"$outfile"
while read -r line_found; do
if [ $? != 0 ]; then break; fi