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