makefile

Write portable Makefiles with standard targets, safe shell recipes, and help conventions.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/Fidasek009/agents --skill makefile-fidasek009
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: makefile
Source: https://github.com/Fidasek009/agents/tree/main/.kilo/skills/makefile
Command: npx skills add https://github.com/Fidasek009/agents --skill makefile-fidasek009

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Makefiles often break due to subtle syntax errors, missing tabs, unescaped shell variables, or inconsistent target naming, making build automation fragile and hard to maintain across teams. ## Core Features & Use Cases - Syntax Standards: Enforces tab-indented recipes, .PHONY declarations, correct use of := and ?= assignment, and $$var shell variable escaping. - Standard Command Surface: Defines conventional targets like help, setup, test, lint, build, and clean, including a self-documenting help target using grep and awk. - Safety Guardrails: Requires variable validation before deploy or destructive targets and explicit handling of missing files. - Use Case: When setting up a new project's developer Makefile, apply these guidelines to produce a consistent, self-documenting build interface that any contributor can run immediately. ## Quick Start Ask the AI to create or review a Makefile for your project following these Makefile guidelines.

Frequently Asked Questions about makefile

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 a help target that pipes Makefile comments through grep and awk to print target names with descriptions. Use the pattern `grep -E '^[a-zA-Z_-]+:.*?## .*$$'` and set `.DEFAULT_GOAL := help` so running bare `make` shows usage.

What is the difference between := and ?= in Makefiles?▼

`:=` evaluates the value once at assignment time, making behavior predictable. `?=` sets a default only if the variable is not already defined, which is ideal for user-overridable settings like environment-specific configuration.

Why does my Makefile recipe fail with missing separator error?▼

Recipe lines must start with a tab character, not spaces. Editors that convert tabs to spaces cause the 'missing separator' error, so configure your editor to preserve tabs in Makefiles.

How do I use shell variables inside Makefile recipes?▼

Escape shell variables by doubling the dollar sign, writing `$$var` instead of `$var`. A single `$` is interpreted by Make itself, while `$$` passes a literal dollar sign to the shell.

When should I declare targets as .PHONY in a Makefile?▼

Declare any target that does not produce a file as `.PHONY`, such as `test`, `lint`, `clean`, or `help`. Without this, Make skips the recipe if a file with the same name exists in the directory.