[U-Boot] [PATCH] Don't add symlink in srctree when using an objtree

Loïc Minier lool at dooz.org
Mon Jan 3 16:11:32 CET 2011


On Sat, Dec 18, 2010, Loïc Minier wrote:
> > Don't make it that complicated. Just change the line into
> > 	@rm -fr$(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
>  I think I had this in my first version, but had an issue with it; I
>  will retest

 This works just fine and is much simpler; thanks.  I will send an
 updated patch to use this

> > Also a question: how has this change been tested?

 I'm attaching a test script which, starting from a clean tree, will try
 to distclean, to configure + distclean, and finally to configure +
 build + distclean.  It tries both with and without an objdir in all
 make calls, and checks whether the tree is really clean with:
    git clean -d -x -n.

 This script uncovered another issue with .boards.depend which was not
 cleaned up by distclean O=foo because it's created in the srctree.

 I will send a separate patch for this issue as well.

-- 
Loïc Minier
-------------- next part --------------
#!/bin/sh

set -e

self="$(basename "$0")"

do_make() {
    make CROSS_COMPILE=arm-linux-gnueabi- "$@"
}

distclean() {
    do_make distclean "$@"
}

config() {
    do_make omap3_beagle_config "$@"
}

build() {
    do_make -j2 "$@"
}

check_clean() {
    clean_output="$(git clean -x -d -n "$@" 2>&1)"
    if [ -n "$clean_output" ]; then
        echo "Expected a clean tree but got: $clean_output" >&2
        exit 1
    fi
}

objdir=""
cleanup() {
    if [ -n "$objdir" ]; then
        rm -rf "$objdir"
    fi
}
trap "cleanup" 0 1 2 3 9 11 13 15

objdir="$(mktemp -dt)"

# this will stop the test if the tree isn't clean to start with
check_clean

for with_objdir in yes no; do
    echo "I: objdir: $with_objdir" >&2
    for seq in "distclean" "config distclean" "config build distclean"; do
        echo "I: sequence: $seq" >&2
        for step in $seq; do
            echo "I: step: $step" >&2
            if [ "$with_objdir" = yes ]; then
                $step "O=$objdir" >/dev/null 2>&1
            else
                $step >/dev/null 2>&1
            fi
        done
        check_clean
    done
done



More information about the U-Boot mailing list