简体   繁体   中英

Makefile target references Makefile

I just discovered this line in a makefile:

%: Makefile

To me, that says "to make any target, you need this makefile" , which strikes me as somewhat obvious.

Is there any situation in which this is not a no-op?

As Etan commented, this will cause every target to be rebuilt whenever the Makefile changes. This is necessary so that anytime you make a change in the build configuration parameters the target will be rebuilt. Otherwise make won't know to rebuild with the new configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM