Replace PWD=$(pwd) with PWD=$(shell pwd)
On Mon, Feb 16, 2015 at 1:53 PM, Paul Bolle <pebolle@xxxxxxxxxx> wrote:
On Mon, 2015-02-16 at 12:14 +0530, noyb noybee wrote:
> Hi all. This is the error that I am getting when I try to compile a
> loadable module(it tries to intercept a system call by directly
> editing the sys_call_table in the memory):-
>
> make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M= modules
> make[1]: Entering directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64'
> make[2]: Nothing to be done for `all'.
> CHK include/linux/version.h
> CHK include/linux/utsrelease.h
> SYMLINK include/asm -> include/asm-x86
> make[2]: *** No rule to make target `missing-syscalls'. Stop.
> make[1]: *** [prepare0] Error 2
> make[1]: Leaving directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64'
> make: *** [all] Error 2
>
> The Makefile is:-
>
> obj-m +:= hijack.o
You want ":=" here. "+:=" gives
Makefile:1: *** empty variable name. Stop.
when I try it.
> PWD := $(pwd)
I think this line sets the value of variable PWD to the value of the
variable pwd, which is probably empty. Look at "M=" in the output you
quoted above.
> all:
> make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) modules
> clean:
> make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) clean
>
> I have googled the error but most links are unresolved. I am trying to
> install this against the currently running kernel and not the complete
> source.
I'm not sure what you're trying to do here, and I'm not really
comfortable reading Makefiles. But the examples in "3. Creating a Kbuild
File for an External Module" in Documentation/kbuild/modules.txt suggest
you could also drop the assignment to PWD and use 'M=$$PWD' in those two
lines.
Hope this helps,
Paul Bolle
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies