On Fri, Jan 6, 2017 at 7:54 PM, Bob Dunlop <[email protected]> wrote:
> I'm not sure passing the parameters to make like this works,
> they don't get passed to sub processes ?  I've always set them
> in the environment so all children are guaranteed to see them.
>
> I'd stick the commands in a scripts for easy repetition and tweaking.
> Something like this:
>
>   #!/bin/bash
>
>   # Export cross build parameters to environment
>   export ARCH=arm
>   export CROSS_COMPILE=arm-cortex_a15-linux-gnueabihf-
>
>   # Put compiler bin in the front of my PATH (automatically exported)
>   TOOLCHAIN=/home/zvivered/module/CARD/linux4.1.13/toolchain
>   PATH=$TOOLCHAIN/crosstool/release/bin:$PATH
>
>   # Build
>   make clean
>   make defconfig
>   make
>
>   # Use absolute path for install directory
>   make CONFIG_PREFIX=$(pwd)/../../../rootfs install

Makefiles don't always honor environment variables like you expect.
In most cases you are expected to *overwrite* certain variables, for
example $CC to make it work. If unsure, read the makefile code.

Do you know the difference between these two make invocations?

# This overwrites $CC so that make will use your value despite how
# makefile defines the variable $CC.
make CC=arm-cortex_a15-linux-gnueabihf-gcc
# This sets $CC as environment variable before invoking make, but
# makefile may not honor the variable.
CC=arm-cortex_a15-linux-gnueabihf-gcc make

I would recommend against having $ARCH or $CROSS_COMPILE
defined as environment variables. It's better to use overwrite method
for these two. (But it's safe to export $PATH environment variable
because makefiles defining it to something else is unlikely.)
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to