# Makefile

> Guidelines when dealing with Makefiles

- Skill: `majiayu000/makefile-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/makefile-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/makefile-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/makefile-2

---


# Makefile Formatting

## Instructions

When writing or modifying Makefiles, follow these formatting guidelines:

1. Each target should have a `.PHONY` declaration
2. Format should follow this pattern:
   - `.PHONY: target-name` on its own line
   - `target-name:` on the next line
   - Commands indented with a tab
   - Empty line between targets

## Example

```makefile
.PHONY: foo
foo:
	@echo 'foo'

.PHONY: bar
bar:
	@echo 'bar'
```

## When to Use

Apply these guidelines when:
- Creating new Makefile targets
- Modifying existing Makefiles
- Reviewing Makefile code

