title: Special file compile in Linux kernel module makefile
body: <p>I have a kernel module in which I would like to include a special file. The file is an ASM file. Nothing special about that, but the file extension is also ".asm" which isn't recognized by gcc. I would like to avoid any renaming due to portability. (It's also used in another non-GNU compiler.)</p>
  
  <p>Usually my makefiles look something like this:</p>
  
  <pre><code>obj-m := chardev.o
  chardev-objs := chardev2.o file2.o asm_test.o
  
  all:
      make -C $(uClinux_dist_path) M=$$PWD modules
  
  clean:
      make -C $(uClinux_dist_path) M=$$PWD clean
  </code></pre>
  
  <p>The asm_test is the offending one, as it's named "asm_test.asm". (It would work if named "asm_test.S".)</p>
  
  <p>In my user space programs I can solve this by inserting the following rule:</p>
  
  <pre><code>asm_test.o:
      $(CC) -c -x assembler-with-cpp asm_test.asm
  </code></pre>
  
  <p>But that doesn't work in kernel makefiles it seems.</p>
  
  <p>Anyone knows how to create special file rules in kernel makefiles?</p>
  
  <p><br/><br/>Btw, I'm working with a cross compiled Blackfin uClinux dist. if it makes a difference.</p>