Skip to content

Instantly share code, notes, and snippets.

@abtris
Created June 22, 2021 07:54
Show Gist options
  • Save abtris/70f0b33da24c0b81867776c2e6515dce to your computer and use it in GitHub Desktop.
Save abtris/70f0b33da24c0b81867776c2e6515dce to your computer and use it in GitHub Desktop.
VSCode Snippets for Makefile
{
"default-makefile": {
"prefix": "help",
"body": [
"# https://suva.sh/posts/well-documented-makefiles/#simple-makefile",
".DEFAULT_GOAL:=help",
"SHELL:=/bin/bash",
"",
".PHONY: help deps clean build watch",
"",
"help: ## Display this help",
" @awk 'BEGIN {FS = \":.*##\"; printf \"\\nUsage:\\n make \\033[36m<target>\\033[0m\\n\\nTargets:\\n\"} /^[a-zA-Z_-]+:.*?##/ { printf \" \\033[36m%-10s\\033[0m %s\\n\", \\$\\$1, \\$\\$2 }' $(MAKEFILE_LIST)",
"",
"deps: ## Check dependencies",
" $(info Checking and getting dependencies)",
"",
"clean: ## Cleanup the project folders",
" $(info Cleaning up things)",
"",
"build: clean deps ## Build the project",
" $(info Building the project)",
"",
"watch: clean deps ## Watch file changes and build",
" $(info Watching and building the project)",
],
"description": "Default makefile",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment