Git Product home page Git Product logo

mmake's Introduction

Modern Make

About

Mmake is a small program which wraps make to provide additional functionality, such as user-friendly help output, remote includes, and eventually more. It otherwise acts as a pass-through to standard make.

Installation

Grab a binary or:

$ go get github.com/tj/mmake/cmd/mmake

Next add the following alias to your profile:

alias make=mmake

Features

Help output

Make's primary function is not to serve as a "task runner", however it's often used for that scenario due to its ubiquitous nature, and if you're already using it, why not! Make is however lacking a built-in mechanism for displaying help information.

Here's an example Makefile:

# Start the dev server.
#
# Note that the API server must
# also be running.
start:
	@gopherjs -m -v serve --http :3000 github.com/tj/docs/client
.PHONY: start

# Start the API server.
api:
	@go run server/cmd/api/api.go
.PHONY: api

# Display dependency graph.
deps:
	@godepgraph github.com/tj/docs/client | dot -Tsvg | browser
.PHONY: deps

# Display size of dependencies.
size:
	@gopherjs build client/*.go -m -o /tmp/out.js
	@du -h /tmp/out.js
	@gopher-count /tmp/out.js | sort -nr
.PHONY: size

Mmake provides a help command to display all target comments in short form:

$ alias make=mmake
$ make help

  start      Start the dev server.
  api        Start the API server.
  deps       Display dependency graph.
  size       Display size of dependencies.

The help <target> command is also supported to display long form:

$ make help start

  Start the dev server.

  Note that the API server must
  also be running.

The default behaviour of Make is of course preserved:

$ make
serving at http://localhost:3000 and on port 3000 of any available addresses

$ make size
...

Remote includes

Includes may specify a URL for inclusion, which are automatically downloaded to /usr/local/include and become available to Make. Note that make resolves includes to this directory by default, so the Makefile will still work for regular users.

Includes are resolved recursively. For example you may have a standard set of includes for your team to run tests, lint, and deploy:

include github.com/apex/make/deploy
include github.com/apex/make/lint
include github.com/apex/make/test

This can be a lot to remember, so you could also provide a file which includes the others:

include github.com/apex/make/all

Or perhaps one per dev environment such as Node or Golang:

include github.com/apex/make/node
include github.com/apex/make/golang

If you're worried about arbitrary code execution, then simply fork a project and maintain control over it.

Registry

If you're looking to find or share makefiles check out the Wiki, and feel free to add a category if it is missing.

Links

Badges

Build Status GoDoc


tjholowaychuk.com  ·  GitHub @tj  ·  Twitter @tjholowaychuk

mmake's People

Contributors

a8m avatar tj avatar

Watchers

 avatar  avatar  avatar

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.