Makefiles are fantastic tools. They help us automate stuff.
I often run commands like :
make epub or
make docs or
make site etc
I have a simple makefile where I write in shell code. And
make simplifies my life
The commands we write inside makefile are actually shell commands.
Is there a way to write a python file. and run its functions like make.
hi: echo hi this is makefile func: # ... some work
- We can run
makewhich would execute stuff under hi,
- while running
make funcwould execute lines under func.
- If there is no Makefile, make would do nothing
Now A python alternative would look like this
''' hi this is python do file ''' def func(): # stuff here
adowould print the docstring.
ado funcwould run func.
If there is no do.py file in current directory then ado would do nothing