title: LKM compiling - modpost syntax error
body: <p>i'm currently trying to compile a simple kernel module (just prints HelloWorld). But everytime when I try to compile it, I get the error : "</p>
  
  <pre><code>    scripts/Makefile.modpost:91: recipe for target '__modpost'  failed"
  </code></pre>
  
  <p>My makefile looks like the following:</p>
  
  <pre><code>    obj-m +=mod_init.o
      mod_init-y += Tests/breakpoint.o
  
  
  
      all:
              make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules -w
              @echo "Modules build"
  
      clean:
              make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  </code></pre>
  
  <p>"Make clean" works flawlessly. But "make" always ends in this error.</p>
  
  <p>My system runs on ARM with a self compiled kernel (Linux 4.11.4 from Kernel.org) I cross compiled it by using a second pc with the following commands:</p>
  
  <p>PC2:</p>
  
  <pre><code>    export ARCH=arm
      export CROSS_COMPILE=arm-none-eabi-
      make mrproper
      make exynos_defconfig (exynos is my cpu on ARM + make menuconfig for my needs)
      make zImage (needed for my board)
      make modules
  </code></pre>
  
  <p>After this is copied the zImage (which boots according to uname -a)
  and copied the source folder to /usr/src/ on the ARM board). There i executed this:</p>
  
  <p>ARM Board:</p>
  
  <pre><code>    make modules_install
      make check_headers
      make headers_install
  </code></pre>
  
  <p>right after this i try to execute my makefile which won't end without the error.
  Executing it with "make V=1" prints this (in addition to the above mentioned error):</p>
  
  <p>make[1]: Entering directory '/usr/src/linux-4.11.4'
  test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
  echo >&amp;2;                                                       </p>
  
  <p>echo >&amp;2 "  ERROR: Kernel configuration is invalid.";           \</p>
  
  <p>echo >&amp;2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\</p>
  
  <p>echo >&amp;2 "         Run 'make oldconfig &amp;&amp; make prepare' on kernel src to fix it.";      \</p>
  
  <p>echo >&amp;2 ;                                                      \
  /bin/false)</p>
  
  <p>But these files are in /usr/src/linux-4.11.4/include/...</p>
  
  <p>Searching for this problem i found this (goo.gl/IZHp4j) but rewriting the makefile won't change anything</p>
  
  <p>Does anybody got an idea how to fix this? The only things i found refered to no installed headers (except my copied kernel source there is nothing in /usr/src) or not allowed signs in the makefile</p>
  
  <p>thank you in advance</p>