Python Script Executed with Makefile

后端 未结 3 1607
自闭症患者
自闭症患者 2021-02-14 12:41

I am writing python scripts and execute them in a Makefile. The python script is used to process data in a pipeline. I would like Makefile to execute the script every time I mak

3条回答
  •  忘掉有多难
    2021-02-14 12:57

    And in case when the scripts that need to be run don't produce any useful output file that can be used as a target, you can just use a dummy target:

    scripts=a.py b.py c.py
    checkfile=.pipeline_up_to_date
    
    $(checkfile): $(scripts)
        touch $(checkfile)
        echo "Launching some commands now."
    
    default: $(checkfile)
    

提交回复
热议问题