I'm trying to build an out-of-tree module against a downloaded kernel tree.
My Makefile looks like this:
obj-m += userModule.oARCH := armCC := arm-linux-gnueabihf-KERN_DIR := /home/user/Downloads/beaglebone-linux-5.10/CD := /home/user/Downloads/userModule/all: make ARCH=$(ARCH) CROSS_COMPILE=$(CC) -C $(KERN_DIR) M=$(CD) modulesclean: make ARCH=$(ARCH) CROSS_COMPILE=$(CC) -C $(KERN_DIR) M=$(CD) cleanhelp: make ARCH=$(ARCH) CROSS_COMPILE=$(CC) -C $(KERN_DIR) M=$(CD) helpWhen I execute: $make, I get an error:
$makesudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/user/Downloads/beaglebone-linux-5.10/ M=/home/user/Downloads/userModule/ modulesmake: Entering directory '/home/user/Downloads/beaglebone-linux-5.10' CC [M] /home/user/Downloads/userModule//userModule.o/bin/sh: 1: arm-linux-gnueabihf-: not foundmake[1]: *** [scripts/Makefile.build:280: /home/user/Downloads/userModule//userModule.o] Error 127make: *** [Makefile:1825: /home/user/Downloads/userModule/] Error 2make: Leaving directory '/home/user/Downloads/beaglebone-linux-5.10'make: *** [Makefile:9: all] Error 2But, when I comment out the entire Makefile except for the first line, so it looks like this:
obj-m += userModule.oand I execute the same command but this time from the command line, everything is built with no error:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/user/Downloads/beaglebone-linux-5.10/ M=$PWD modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/user/Downloads/beaglebone-linux-5.10/ M=$PWD modulesmake: Entering directory '/home/user/Downloads/beaglebone-linux-5.10'CC [M] /home/user/Downloads/userModule/userModule.oMODPOST /home/user/Downloads/userModule/Module.symversCC [M] /home/user/Downloads/userModule/userModule.mod.oLD [M] /home/user/Downloads/userModule/userModule.komake: Leaving directory '/home/user/Downloads/beaglebone-linux-5.10'everything goes just fine.
I compared the 2 commands as they are shown in the building messages and they look the same.Has anybody experienced such behavior?