Can't rebuild the kernel Image without wiping the build directory
I'm trying to build the kernel locally.
First run of make diot_v2.build works fine, but any subsequent call will fail with:
(petalinux) adrian@pcte247806:$ make diot_v2.build
make -C projects/diot_v2 build
make[1]: Entering directory '/home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2'
Makefile:16: warning: overriding recipe for target 'prepare_config'
../Makefile.rules:74: warning: ignoring old recipe for target 'prepare_config'
Makefile:20: warning: overriding recipe for target 'prepare_dtb'
../Makefile.rules:107: warning: ignoring old recipe for target 'prepare_dtb'
Makefile:24: warning: overriding recipe for target 'copy_dtb'
../Makefile.rules:113: warning: ignoring old recipe for target 'copy_dtb'
cp -v config/diot_defconfig /home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir/arch/arm64/configs/
'config/diot_defconfig' -> '/home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir/arch/arm64/configs/diot_defconfig'
eval " make -C /home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir CROSS_COMPILE=aarch64-none-elf- ARCH=arm64 diot_defconfig -j8 O=/home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir/build-arm64"
make[2]: Entering directory '/home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir'
make[3]: Entering directory '/home/adrian/praca/diot/linux-debian/kernel/projects/diot_v2/work_dir/build-arm64'
***
*** The source tree is not clean, please run 'make ARCH=arm64 mrproper'
The problem is that this behavior breaks the standard make flow where multiple calls to the same command will either do nothing, or produce similar output.
Sure, I can workaround this by going to the work directory and manually typing the relevant kernel make commands but I think it's missing the point.
My workflow when working with this repo is:
0. Download the repo
- Build the kernel/dtb
- Copy to SB, boot and test
- Make a change to the device tree and/or kernel source
- Goto (1), repeat until my thing works
I'd like to be able to use DIOT-provided build flow for the whole process, which provides a nice abstraction over many steps needed to gen an Image/DT binary.