create-makefiles

Author and review GNU Make Makefiles with safe shell defaults and per-language templates.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/lurodrisilva/personal-skills --skill create-makefiles-lurodrisilva
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-makefiles
Source: https://github.com/lurodrisilva/personal-skills/tree/main/coding/create-makefiles
Command: npx skills add https://github.com/lurodrisilva/personal-skills --skill create-makefiles-lurodrisilva

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Makefiles by hand leads to silent failures, portability bugs, and inconsistent targets. This Skill encodes GNU Make best practices so every Makefile you create or edit starts with safe shell defaults, a self-documenting help target, and correct phony/pattern-rule usage. ## Core Features & Use Cases - Non-negotiable prologue: Enforces SHELL := bash, .SHELLFLAGS := -eu -o pipefail -c, .DELETE_ON_ERROR, and --warn-undefined-variables so broken recipes fail loudly instead of silently. - Self-documenting targets: Ships the canonical awk-based help target plus the ## description comment convention so bare make prints usage. - Per-language templates: Provides ready-to-adapt Makefile templates for Go, Node/TypeScript, Python, .NET, C/C++, and Docker, plus deep Go guidance (audit targets, go run tool@version, cross-compilation, ldflags version injection). - Use Case: You are setting up a Go service and want one command for build, test, lint, and docker. Ask for a Makefile and get a prologue-hardened file with build, test -race, audit, docker/build, and a working help target. ## Quick Start Create a Makefile for my Go project with build, test, lint, and docker targets using the create-makefiles skill.

Frequently Asked Questions about create-makefiles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a self-documenting Makefile help target?▼

Add an awk-based help target that scans $(MAKEFILE_LIST) for lines matching `target: ## description` and prints them formatted. Set `.DEFAULT_GOAL := help` so running bare `make` shows the target list instead of executing the first rule.

What shell flags should every Makefile set for safety?▼

Set `SHELL := /usr/bin/env bash` and `.SHELLFLAGS := -eu -o pipefail -c` so recipes exit on errors, unset variables, and failed pipes. Add `.DELETE_ON_ERROR:` to remove partially written targets when a recipe fails mid-way.

When should I not use Make as a task runner?▼

Skip Make for single-file scripts with no build step, projects where a native runner like cargo or npm scripts already suffices, Windows-primary projects without a POSIX shell, and trivially linear one-command workflows.

Does this Makefile guidance work with macOS default make?▼

macOS ships GNU Make 3.81, which lacks 4.x features like `!=` and `$(file ...)`. The guidance assumes GNU Make 4.0+; on macOS install newer make via Homebrew and invoke it as `gmake`.

How do I make a Makefile safe for parallel execution with make -j?▼

Declare output directories as order-only prerequisites using `| $(BUILDDIR)`, ensure no two targets write the same file, and avoid hidden side-effect dependencies. Test with `make -j8 clean && make -j8 all` repeatedly to surface race conditions.

How do I manage Go tool dependencies in a Makefile without global installs?▼

Use `go run <tool>@<version>` directly in recipes, for example `go run golang.org/x/vuln/cmd/[email protected] ./...`. This pins tool versions in the Makefile, requires zero setup, and avoids GOPATH pollution.