Skip to main content
Post Undeleted by terdon
included essential parts of the answer and provided link for reference
Source Link

BTW ... you can not just use Bash.

In fact you can write make target recipes in any scripting language you want.

Example snippet (SHELL config is in the GitHub repo linked below)using Python: Makefile snippet using Python as recipe language

...
SHELL != sh -c "command -v python"
.SHELLFLAGS := -c
.ONESHELL:

# et voilà : the recipe can now be written in pure python :-)
all: foo    
    # use some make variables
    print "# target name is '$@', depends on '$^'"

    import os
    print os.listdir ("..")

foo:
    # use some make variables
    print "# target name is '$@', depends on '$^'"

    import sys
    print 'python version is %s.%s.%s' % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
...

see an example in various languages : https://github.com/lgersman/make-recipes-in-different-scripting-languages-demo

BTW ... you can not just use Bash.

In fact you can write make target recipes in any scripting language you want.

Example snippet (SHELL config is in the GitHub repo linked below): Makefile snippet using Python as recipe language

see an example in various languages : https://github.com/lgersman/make-recipes-in-different-scripting-languages-demo

BTW ... you can not just use Bash.

In fact you can write make target recipes in any scripting language you want.

Example snippet using Python:

...
SHELL != sh -c "command -v python"
.SHELLFLAGS := -c
.ONESHELL:

# et voilà : the recipe can now be written in pure python :-)
all: foo    
    # use some make variables
    print "# target name is '$@', depends on '$^'"

    import os
    print os.listdir ("..")

foo:
    # use some make variables
    print "# target name is '$@', depends on '$^'"

    import sys
    print 'python version is %s.%s.%s' % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
...

see an example in various languages : https://github.com/lgersman/make-recipes-in-different-scripting-languages-demo

Post Deleted by Kusalananda
Source Link

BTW ... you can not just use Bash.

In fact you can write make target recipes in any scripting language you want.

Example snippet (SHELL config is in the GitHub repo linked below): Makefile snippet using Python as recipe language

see an example in various languages : https://github.com/lgersman/make-recipes-in-different-scripting-languages-demo