title: How to create a makefile in gcc
body: <p>I am trying to create a makefile but facing some issues.
  I installed gcc compiler in Windows 7, then created one simple helloworld example. After that compiled that C file using the following command:</p>
  <pre><code>gcc filename.c
  </code></pre>
  <p>After this I am getting an exe file. I am calling this project in some tool for that, tool required makefie.</p>
  <p>As I understood makefile is a text file, which tells or consist some commands how to build, run and clean the project.</p>
  <p>So according to this I am writing a makefile:</p>
  <pre><code>CC=gcc
  
  SRCS=src/hello.c
  
  .PHONY: all
  all: clean build
      @echo ========== Complete ==========
  
  .PHONY: build
  build: 
      @echo ========== Build ==========
      $(CC) hello.c
  
  .PHONY: run
  run: 
      @echo ========== Run ==========
      make
  
  .PHONY: clean
  clean:
      @echo ========== Clean ==========
      rm hello.exe
  
  ./obj:
      mkdir ./obj
  </code></pre>
  <p>While calling this simple project in tool, getting error
  &quot;no rule to make target clean&quot;</p>
  <p>Please tell me which steps I followed those are correct for creation of makefile or not, and what mistake I am doing? How to create a makefile?</p>