Write a makefile to compile a .h .hpp and .cpp together into an executable
<p>So I have a straightforward problem.</p>

<p>I have files <code>List.hpp</code>, <code>List.h</code>, and <code>test_list.cpp</code></p>

<p>List.hpp contains function definitions for the List.h file.
The List.h file includes "List.hpp" in the 3rd to last line.
test_list.cpp runs the program and includes "List.h" at the top.</p>

<p>I need a makefile that will compile these into an executable "project.x".</p>

<p>So far  have this:</p>

<pre><code>    proj2: List.o test_list.o
        gcc -o proj2.x List.o test_list.o

    List.o:
        gcc -c List.hpp


    test_list.o:
        gcc -c test_list.cpp

    clean:
        rm *.o proj2.x
</code></pre>

<p>However, it results in all kinds of errors, all dealing with lines that have <code>List &lt;T&gt;</code> in them, stating that <code>List</code> does not name a type. I think this is because I am not properly including the header file.</p>

<p>How would I make this makefile?</p>