Building modules: missing scripts/basic/Makefile

Steven Laabs swlaabs at gmail.com
Mon Jun 6 12:47:45 EDT 2016


>Hi Steven,
>
>On Mon, Jun 6, 2016 at 12:14 AM, Steven Laabs <swlaabs at gmail.com> wrote:
>> Hi,
>>
>> I'm trying to build my first kernel module but when running the makefile, make tries to use a file at /usr/src/linux-headers-3.16.0-4-common/scripts/basic/Makefile which gives me the "No such file or directory" error. I've looked into the folder it is referencing and it  does not have any Makefile, the only file in that location is the fixdep executable. The scripts folder itself is linked to ../../lib/linux-kbuild-3.16/scripts.
>>
>> The Makefile I am using (located in a folder in my home directory):
>>
>> obj-m = hello.o
>> KDIR ?= /lib/modules/$(shell uname -r)/build
>>
>> all:
>>     make -C $(KDIR) M=$(PWD) modules
>>
>> clean:
>>     make -C $(KDIR) M=$(PWD) clean
>>
>> I'm not quite sure where to look for this Makefile as I believe I have all of the proper headers installed, and I am running everything with the proper permission level.
>>
>> Any ideas on what I may be missing here?
>>
>> Thanks,
>> Steven
>>
>
>You should use "+=" and not "="
>-- obj-m = hello.o
>++ obj-m += hello.o

Thanks for pointing that out, I've made that correction. Still missing the Makefile as previously mentioned unfortunately so I am unable to build.



More information about the Kernelnewbies mailing list