简体   繁体   中英

build multiple targets in a makefile without all target

I have a list of targets that are all calling msgfmt for a specific language. I would like to call them all, but I do not really want to create a huge all target. Is there some other way to tell make that multiple targets should be build?

The all target is not special in any way. It is only by convention that this is the first, and thus the default target. Any other phony target can take its' place.

Just create some target, declare it as .PHONY , let all your msgfmt targets as prerequisites of this target, and make it something other then your first one.

If you already have a list of targets in a variable, you can use that variable as the prerequisite list.

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