Undefined reference to main, makefile
<p>I have a simple structure as:</p>

<pre><code>sample2Make$ ls

ADD DIV inc_print.h main.c makefile multiplication.o printer.o response.o subtraction.o addition.o division.o inc_resp.h main.o MUL printer.c response.c SUB
</code></pre>

<p>where ADD, DIV, SUB, MUL are subdirectories containing a source file for the operation and a header file. The makefile is:</p>

<pre><code>app: addition.o subtraction.o multiplication.o division.o response.o
        gcc -o app response.o addition.o subtraction.o multiplication.o division.o

response.o: inc_resp.h inc_print.h response.c printer.c main.c
    gcc -c response.c printer.c main.c

addition.o: ADD/inc_add.h ADD/addition.c
    gcc -c ADD/addition.c

subtraction.o: SUB/inc_sub.h SUB/subtraction.c
    gcc -c SUB/subtraction.c

multiplication.o: MUL/inc_mul.h MUL/multiplication.c
    gcc -c MUL/multiplication.c

division.o: DIV/inc_div.h DIV/division.c
    gcc -c DIV/division.c
</code></pre>

<p>The header files just have declarations of their respective functions. Now after writing a command:</p>

<pre><code>sample2Make$ make -f makefile
</code></pre>

<p>The output I am getting is:</p>

<pre><code>gcc -c ADD/addition.c
gcc -c SUB/subtraction.c
gcc -c MUL/multiplication.c
gcc -c DIV/division.c
gcc -c response.c printer.c main.c
gcc -o app addition.o subtraction.o multiplication.o division.o response.o
/usr/lib/gcc/i686-linux-gnu/4.9/../../../i386-linux-gnu/crt1.o: In function `_start':
/build/buildd/glibc-2.21/csu/../sysdeps/i386/start.S:111: undefined reference to `main'
collect2: error: ld returned 1 exit status
makefile:3: recipe for target 'app' failed
make: *** [app] Error 1
</code></pre>