How can I use .NOTPARALLEL in makefile only on specific targets?

后端 未结 2 688
Happy的楠姐
Happy的楠姐 2021-01-03 05:52

I have 5 labels in Makefile:

all: label1 label2 label3 label4 last_label

I want last_label to be done last, and I want to use

2条回答
  •  再見小時候
    2021-01-03 06:36

    If the reason last_label needs to run last is that it needs data from the other labels, the best approach would be to tell make about that dependency:

    all: last_label
    
    last_label: label1 label2 label3 label4
    

    If there's not a true dependency (i.e., if you don't want last_label to be rebuilt if one of the others changes), and if you're using GNU Make, you can specify these as "order-only" dependencies--make will just make sure they exist before last_label is built:

    all: last_label
    
    last_label: | label1 label2 label3 label4
    

提交回复
热议问题