X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=build%2Fredo_scripts%2Fredo-ifchange;h=5f220a8002ac1b46206046a1fc3de2c30ccff5fe;hb=6cae62aad97d9220253cba2a9c0881f714a63d1c;hp=bdec2d4dae215b11ab69c6d3451f0317762fed95;hpb=68dc4d386509aeebbbc5ce20dddbe9c0bf4f6eb9;p=plomrogue diff --git a/build/redo_scripts/redo-ifchange b/build/redo_scripts/redo-ifchange index bdec2d4..5f220a8 100755 --- a/build/redo_scripts/redo-ifchange +++ b/build/redo_scripts/redo-ifchange @@ -70,6 +70,10 @@ _dependencies_ne_uptodate() { _target_uptodate() { target=$1 + # If a target is a top-level target, it is not up to date. + if [ -z "$REDO_TARGET" ]; then + return 1 + fi # If a target does not exist, it is not up to date. if [ ! -e "$target" ]; then _echo_debug_message "$target does not exist." @@ -192,7 +196,9 @@ _do() { [ -e "$target.do" ] || _find_dofile "$target" if [ ! -e "$dofile" ]; then # If .do file does not exist and target exists, it is a source file. - if [ -e "$target" ]; then + if [ -e "$target_abspath" ]; then + _add_dependency "$REDO_TARGET" "$target_abspath" + _add_ctime_md5sum "$target_abspath" return 0 # If .do file does not exist and target does not exist, stop. else @@ -231,7 +237,7 @@ _do() { "$REDO_DIR/$target_abspath".dependencies_ne >&2 fi # Some do files (like all.do) do not usually generate output. - if [ -e "$target" ]; then + if [ -e "$target_abspath" ]; then # Record dependency on parent target. _add_dependency "$REDO_TARGET" "$target_abspath" _add_ctime_md5sum "$target_abspath"