how to write makefile for python?

How to write a makefile for python, R and bash scripts

  • I am a statistician, and I recently wrote an bash pipeline for a research project, it is basically a main bash scripts calling bash, python and R scripts at each step of analysis, and there are lots of steps and lots scripts of course. My friend told me that I can create a makefile for them, but I have little experience on computer except writing scripts. I found somes examples but they are for VC. Does my cases also need to compile like VC programs? Can anyone share me some of his experience? For example, I have main.sh, which calls step1.py, step2.sh, step3.r, and step2.sh calls step2.1.py, step2.2.r how do I link them by makefile?

  • Answer:

    step1: step1.py;\ $(MAKE) step2;\ step3.r step2: step2.1.py;\ step2.2.r all: step1 echo "Done" From your description, it sounds like main.sh and step2.sh just call the python and R scripts. If so, then the above is the Makefile that would replace them. If they have other steps in them, then you can add those bash commands in the step1 or step2 targets. Using a Makefile like this will allow you to also execute only part of your execution sequence for debugging purposes.

user1269298 at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.