I would like to know how to add a prerequisite to a rule with an empty recipe in GNU make. Here is a short example I made in order to explain the problem. I have a Test.c file which depends on a certain file header1.h, which includes another file header2.h. This is the make file:
Test : Test.c header1.h
gcc -o Test Test.c
header1.h : header2.h
The last row is not empty it contains a tab character. Now assume I run make and Test is created. Afterwards I change header2.h. If I run make again, make says that Test is already updated. I expected make to remake Test since header2.h is newer than header1.h.
If I add a trivial recipe to the last rule like this
Test : Test.c header1.h
gcc -o Test Test.c
header1.h : header2.h
echo foo
make behaves as I expected. I also tried adding a semicolon after header2.h in the prerequisite list but this did not help.