Duplicate $ (info) calls

I have a makefile that displays a couple of information to the user using function calls to $(info) . However, the makefile also includes files with auto-generated dependencies updated with gcc -M . Whenever such a dependency needs to be redone, GNU Make re-processes everything, duplicating the result generated with $(info) and similar calls.

Is there a way to determine if GNU Make performs the first or second such pass in the makefile to avoid duplicating the $(info) lines?

+4
source share
1 answer

I just found this: the MAKE_RESTARTS variable MAKE_RESTARTS defined if GMake restarted in the above circumstances. For example, the construction:

 ifndef MAKE_RESTARTS $(info Hello!) endif 

will only display the specified message in the first such pass of Make.

+5
source