Skip to main content

Building blocks for make-like utils

Project description

libmake.py

A python library for implementing makefile.py scripts.

Run with pymake!

# makefile.py

import shutil

import libmake
from libmake import rule_vars as r

makefile = libmake.Makefile()


@makefile.add_rule("ciao.html", ["come.md", "va.scss"])
def test_rule():
    # fp = first_prerequisite
    # t = target
    shutil.copy(str(r.fp), str(r.t))
    print("Ciao, come va?")


if __name__ == "__main__":
    libmake.run_make(makefile)

Non-goals

The goal of this package it's not:

  • to provide any pre-built Makefile
  • to deliver an alternative build-system for compiled languages

For the second one there is already make, and other tools specific for more recent languages.

Instead...

Makefile's logic it's useful for projects' tasks automation further than compiling code, e.g.:

  • compiling templates and contents
  • define project's specific commands
    • useful also for collaboration (and to save working patterns anyhow)

Usage

Define a makefile.py using building blocks provided, then run it as a script with targets (so do python makefile.py args... in place of make args...).

See tests/makefile.py for an example makefile definition, and run tests.py to show its output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

libmake-0.3.1-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page