Giter Club home page Giter Club logo

supermake's Introduction

Supermake

Supermake is an alternative to Make, the popular build automation tool. It offers builtin parallelism and container support, all using the a Makefile-like format developers know and love.

Note

Supermake is very much still in-development. It has not yet reached feature-parity. Bugs are to be expected.

Contributions in the form of PR's, documentation improvements, bug reports and feature requests are all welcome.

Features ๐Ÿ’ก

  1. Automatic parallelisation of targets whenever possible, increasing speed by utilizing all CPU cores.
  2. Allows nested targets, increasing readability.
  3. Run (part of) your recipes in different shells, interpreters and even containers ๐Ÿณ.
  4. Make-like syntax. Re-purpose your Makefiles with a few tweaks.

Roadmap ๐Ÿ—บ๏ธ

  • Parametrized targets. Like build_container(stage):
  • Supermake directory trees. Automatically run matching targets of Supermake files in subdirectories.

Installation

Grab a pre-built executable from the latest release or build it yourself.

git clone [email protected]:KillianMeersman/Supermake.git
cd Supermake
make install

Usage

Once installed, it's as simple as running

smake run <target>

If you want to find out more, you can use the help command and/or flag.

smake help
smake run --help

Example

TAG ?= latest  # Inherit from environment variable, using 'latest' as fallback
BASE_IMAGE = ghcr.io/killianmeersman/supermake/example/base:${{ TAG }}
CI_IMAGE = ghcr.io/killianmeersman/supermake/example/ci${{ TAG }}

build:  # build will run both the base and ci target
	base:
		docker build --target base -t ${{ BASE_IMAGE }}

	ci: base  # ci will wait until base is done
		docker build --target ci -t ${{ CI_IMAGE }}


test: build::ci  # Wait until the ci subtarget is done, both subtargets will run in parallel
	test_module_a:
		@python:3.11  # Will run inside the python:3.11 image, with the current directory mounted inside
		pytest a/
	
	test_module_b:
		@${{ CI_IMAGE }}  # Will run inside the newly built ci image, with the current directory mounted inside
		pytest b/

Differences with Make โš ๏ธ

  • Supermake has no conditional syntax (yet).
  • Every Supermake recipe runs in the same shell, making .ONESHELL redundant. Make will, by default, run every recipe line in a new shell, .
  • Supermake uses ${{ IDENTIFIER }} variable notation (spaces are optional), instead of Make's $(IDENTIFIER) notation.

Further reading

Check out out the user guide for a quickstart or the docs for a deep-dive into Supermake.

supermake's People

Contributors

killianmeersman avatar dependabot[bot] avatar

Stargazers

Dries Desmet avatar

Watchers

 avatar

supermake's Issues

Can't install on os X

go version go1.22.2 darwin/amd6
OS X version: 14.2.1

When running make install this is the output I'm getting:

โžœ  Supermake git:(main) make
go test -v ./...



?   	github.com/KillianMeersman/Supermake	[no test files]
?   	github.com/KillianMeersman/Supermake/cmd	[no test files]
?   	github.com/KillianMeersman/Supermake/pkg/supermake/datastructures	[no test files]
?   	github.com/KillianMeersman/Supermake/pkg/supermake/docker	[no test files]
?   	github.com/KillianMeersman/Supermake/pkg/supermake/log	[no test files]
?   	github.com/KillianMeersman/Supermake/pkg/supermake/shell	[no test files]
?   	github.com/KillianMeersman/Supermake/pkg/supermake/util	[no test files]
=== RUN   TestContainerLogs
INFO  root                 @local | pulling image [image=docker.io/library/alpine:3]
INFO  root                 @local | pulled image [image=docker.io/library/alpine:3]
INFO  test::error::0       @docker.io/library/alpine:3 | Test error start
INFO  test::error::0       @docker.io/library/alpine:3 | Test error stop
panic: http: read on closed response body

goroutine 34 [running]:
github.com/KillianMeersman/Supermake/pkg/supermake/log.StreamReaderNewLines(0xc0003883e0, {0x51ef8e0?, 0xc0003a61c0?})
	/Users/dries/src/Supermake/pkg/supermake/log/util.go:17 +0x10a
created by github.com/KillianMeersman/Supermake/pkg/supermake.(*DockerEnvironment).Execute in goroutine 24
	/Users/dries/src/Supermake/pkg/supermake/executor_docker.go:91 +0x1125
FAIL	github.com/KillianMeersman/Supermake/pkg/supermake	4.692s
=== RUN   TestParsing
--- PASS: TestParsing (0.00s)
=== RUN   TestVariableSubstitution
--- PASS: TestVariableSubstitution (0.00s)
PASS
ok  	github.com/KillianMeersman/Supermake/pkg/supermake/parse	0.235s
FAIL
make: *** [Makefile:10: test] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.