title: Use the same makefile for make (Linux) and nmake (Windows)
body: <p>I have a simple C program (one source file) which I want to compile on Linux and on Windows via make and nmake, respectively. Is there a possibility to accomplish this with a single makefile?</p>
  
  <p>I thought about something like</p>
  
  <pre><code>ifeq($(MAKE), nmake)
      // nmake code here
  else
      // make code here
  endif
  </code></pre>
  
  <p>Unfortunately nmake seems not to understand <code>ifeq</code>, so I cannot use that. I have a working makefile, but that produces very ugly results:</p>
  
  <pre><code>hello: hello.c
      $(CC) hello.c
  </code></pre>
  
  <p>That works on both systems. The problem is that the outcome depends on the default behaviors of the respective compilers. Under Linux I get an executeable named 'a.out' rather than 'hello'. Under Windows I get 'hello.exe' but there is also 'hello.obj' which I do not want to have.</p>
  
  <p>Is there an alternative way? Or is what I'm trying absolutely impossible?</p>