makefile: how to specify header files
<p>I'm trying to write a makefile for all of my cpp prjects. After searching from the internet, I make a makefile as below:<br></p>

<pre><code>g++11=g++ -std=c++11 -stdlib=libc++

CPPFILES=$(wildcard *.cpp)
OBJFILES=$(CPPFILES:.cpp=.o)


res.out: $(OBJFILES)
    $(g++11) -lncurses -o $@ $^ -g

#obj/%.o: %.cpp
%.o: %.cpp
    $(g++11) -c -o $@ $&lt; -g


clean:
    rm *.o *.out
</code></pre>

<p>I tried to use this file to compile my cpp projects and it worked well.<br></p>

<p>However, when I make some change in the header files, it doesn't work anymore because this makefile can't detect the modification in header files.<br></p>

<p>Is there any easy way to specify header files in the makefile?<br>
Ofc I don't want to specify them one by one.</p>