Makefile sequential execution

后端 未结 2 1677
南方客
南方客 2021-01-05 01:18

I have the following Makefile:

all: generate print # <-- doesn\'t work

date: 
    date > date.txt

ls:
    ls -la > ls.txt

generate: ls date

prin         


        
2条回答
  •  春和景丽
    2021-01-05 02:00

    Just add the pipe symbol:

    all: | generate print
    

    From the make manual:

    Order-only prerequisites can be specified by placing a pipe symbol (|) in the prerequisites list: any prerequisites to the left of the pipe symbol are normal; any prerequisites to the right are order-only:

    targets : normal-prerequisites | order-only-prerequisites
    

提交回复
热议问题