Skip to content

dsiebel/make-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

make-bootstrap

Basic, universal setup for projects using Makefiles.

Prerequisites

  • Make (duh! ideally v4+)

Installation

Just download the most recent .bootstrap.mk file from Github to your project's root directory

curl -lO https://github.com/raw/dsiebel/make-bootstrap/master/.bootstrap.mk

and start using it in your Makefile (see Makefile)

include .bootstrap.mk

# your make targets here

Updating

The bootstrap file provides a self-update target, which essentially executes the same cURL seen above under "Installation":

$ make self-update
backing up existing bootstrap file...
downloading latest version from github.com/dsiebel/make-bootstrap (master)
done!

Alternative help goals

Simple version using sed. Requires comment before the target declaration

## help: display this help
help:
	@sed -n 's/^##//p' $(MAKEFILE_LIST)

Another simple but sophisticated version using awkthat supports sections via ##@.

##@ Help section

help: ## Shows this help message
	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n"} /^[.a-zA-Z0-9_-]+:.*?##/ { printf "  \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

About

Basic setup for projects using Makefiles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published