LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in compile library file command "make" (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-compile-library-file-command-make-754341/)

reallynewbie2009 09-11-2009 02:57 AM

Problem in compile library file command "make"
 
I have encountered the following problem when trying to compile the static library murtc.o


Error message when I run the "make" command in the directory of where Makefile located.

"
make -C /lib/modules/2.6.26-2-686/build M=/opt/EFCS/MURTC/module KBUILD_VERBOSE=1 modules
make: *** /lib/modules/2.6.26-2-686/build: No such file or directory. Stop.
make: *** [murtc.o] Error 2
"

The directory ...686/build does not existed, however, when i manually created one and run the make command again. still get the same message.


Thanks for any help and nice day!

ongte 09-11-2009 03:09 AM

Most likely you don't have the kernel source files installed.

reallynewbie2009 09-11-2009 03:38 AM

Thanks very much, Ongte! Where does the kernel source file supposed to be located? There are files like "modules.usbmap, modules.symbols, etc" in the /lib/module/2.6.26-2-686/kernel folder. Actually, I did try to change the path of Kernel source pointing in the Makefile source code:

"KERNEL_SRC ?= /lib/modules/$(KERNEL_VERSION)/build" from "build" to "kernel"

However, I still got similar error message as bellow:

"
make -C /lib/modules/2.6.26-2-686/kernel M=/opt/EFCS/MURTC/module KBUILD_VERBOSE=1 modules
make[1]: Entering directory `/lib/modules/2.6.26-2-686/kernel'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/lib/modules/2.6.26-2-686/kernel'
make: *** [murtc.o] Error 2
"

the only difference is it entering the directory.

Thanks!

ongte 09-11-2009 04:18 AM

You don't need to change it, /lib/modules/$(KERNEL_VERSION)/build should be there. It's not there probably cuz you don't have the package installed.

Depending on your distro, you can normally install the kernel source & headers by looking in the package manager for: kernel-source and kernel-headers

reallynewbie2009 09-14-2009 10:04 AM

Thanks for the response, Ongte! Hope you had a nice weekend!. So should I download kernel package and looking in the manager for the kernel source and headers?


All times are GMT -5. The time now is 11:08 PM.