[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FP4YZ56V4TT76SCY3ZTR7T":3,"skill-same:01M6FP4YZ56V4TT76SCY3ZTR7T":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":57,"install":58,"resources":71},"01M6FP4YZ56V4TT76SCY3ZTR7T","makefile-build",null,"Write Makefiles for any project type. Use when setting up build automation, defining multi-target builds, managing dependencies between tasks, creating project task runners, or using Make for non-C projects (Go, Python, Docker, Node.js). Also covers Just and Task as modern alternatives.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgitgoodordietrying\u002Fmakefile-build\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"makefile build","makefile","build","use","multi","type","as","project","dependencies","task","up","python","just","projects","runners","win32","tasks","automation","linux","docker","2026-11-10 10:12:30",false,"---\nname: makefile-build\ndescription: Write Makefiles for any project type. Use when setting up build automation, defining multi-target builds, managing dependencies between tasks, creating project task runners, or using Make for non-C projects (Go, Python, Docker, Node.js). Also covers Just and Task as modern alternatives.\nmetadata: {\"clawdbot\":{\"emoji\":\"?\",\"requires\":{\"anyBins\":[\"make\",\"just\",\"task\"]},\"os\":[\"linux\",\"darwin\",\"win32\"]}}\n---\n\n# Makefile & Build\n\nWrite Makefiles for project automation across any language. Covers targets, dependencies, variables, pattern rules, phony targets, and using Make for Go, Python, Docker, and Node.js projects. Includes Just and Task as modern alternatives.\n\n## When to Use\n\n- Automating build, test, lint, deploy commands\n- Defining dependencies between tasks (build before test)\n- Creating a project-level task runner (consistent across team)\n- Replacing long CLI commands with short memorable targets\n- Managing multi-step build processes\n- Any project that needs a `make build && make test && make deploy` workflow\n\n## Makefile Basics\n\n### Structure\n\n```makefile\n# target: prerequisites\n#     recipe (MUST be indented with TAB, not spaces)\n\nbuild: src\u002Fmain.go\n\tgo build -o bin\u002Fapp src\u002Fmain.go\n\ntest: build\n\tgo test .\u002F...\n\nclean:\n\trm -rf bin\u002F\n\n# First target is the default (runs with bare `make`)\n```\n\n### Variables\n\n```makefile\n# Simple assignment\nCC = gcc\nCFLAGS = -Wall -O2\n\n# Deferred assignment (expanded when used)\nFILES = $(wildcard src\u002F*.go)\n\n# Immediate assignment (expanded when defined)\nVERSION := $(shell git describe --tags --always)\n\n# Conditional assignment (only if not already set)\nPORT ?= 8080\n\n# Use variables\nbuild:\n\t$(CC) $(CFLAGS) -o app main.c\n\t@echo \"Version: $(VERSION)\"\n```\n\n### Automatic variables\n\n```makefile\n# $@ = target name\n# $\u003C = first prerequisite\n# $^ = all prerequisites\n# $* = stem (pattern match)\n# $(@D) = directory of target\n# $(@F) = filename of target\n\nbin\u002Fapp: src\u002Fmain.go src\u002Futil.go\n\tgo build -o $@ $^\n# $@ = bin\u002Fapp\n# $^ = src\u002Fmain.go src\u002Futil.go\n# $\u003C = src\u002Fmain.go\n\n# Pattern rule\n%.o: %.c\n\t$(CC) -c -o $@ $\u003C\n# For foo.o: $@ = foo.o, $\u003C = foo.c, $* = foo\n```\n\n### Phony targets (not files)\n\n```makefile\n# Without .PHONY, if a file named \"clean\" exists, `make clean` does nothing\n.PHONY: build test clean lint fmt help\n\nbuild:\n\tgo build -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest:\n\tgo test .\u002F...\n\nclean:\n\trm -rf bin\u002F dist\u002F\n\n# List all targets\nhelp:\n\t@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \\\n\t\tawk 'BEGIN {FS = \":.*?## \"}; {printf \"  \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'\n```\n\n### Self-documenting Makefile\n\n```makefile\n.DEFAULT_GOAL := help\n\nbuild: ## Build the application\n\tgo build -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest: ## Run all tests\n\tgo test -v .\u002F...\n\nlint: ## Run linters\n\tgolangci-lint run\n\nclean: ## Remove build artifacts\n\trm -rf bin\u002F dist\u002F\n\nhelp: ## Show this help\n\t@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \\\n\t\tawk 'BEGIN {FS = \":.*?## \"}; {printf \"  \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'\n```\n\n## Language-Specific Makefiles\n\n### Go\n\n```makefile\nBINARY_NAME := myapp\nVERSION := $(shell git describe --tags --always --dirty)\nLDFLAGS := -ldflags \"-X main.version=$(VERSION)\"\nGOFILES := $(shell find . -name '*.go' -not -path '.\u002Fvendor\u002F*')\n\n.PHONY: all build test lint clean run\n\nall: lint test build\n\nbuild: ## Build binary\n\tCGO_ENABLED=0 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME) .\u002Fcmd\u002F$(BINARY_NAME)\n\ntest: ## Run tests\n\tgo test -race -coverprofile=coverage.out .\u002F...\n\ntest-coverage: test ## Show coverage report\n\tgo tool cover -html=coverage.out\n\nlint: ## Run linters\n\tgolangci-lint run .\u002F...\n\nfmt: ## Format code\n\tgofmt -w $(GOFILES)\n\nrun: build ## Build and run\n\t.\u002Fbin\u002F$(BINARY_NAME)\n\nclean: ## Clean build artifacts\n\trm -rf bin\u002F coverage.out\n\n# Cross-compilation\nbuild-linux: ## Build for Linux\n\tGOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-linux-amd64 .\u002Fcmd\u002F$(BINARY_NAME)\n\nbuild-all: ## Build for all platforms\n\tGOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-linux-amd64 .\u002Fcmd\u002F$(BINARY_NAME)\n\tGOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-darwin-arm64 .\u002Fcmd\u002F$(BINARY_NAME)\n\tGOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-windows-amd64.exe .\u002Fcmd\u002F$(BINARY_NAME)\n```\n\n### Python\n\n```makefile\nPYTHON := python3\nVENV := .venv\nBIN := $(VENV)\u002Fbin\n\n.PHONY: all install test lint fmt clean run\n\nall: install lint test\n\n$(VENV)\u002Fbin\u002Factivate:\n\t$(PYTHON) -m venv $(VENV)\n\t$(BIN)\u002Fpip install --upgrade pip\n\ninstall: $(VENV)\u002Fbin\u002Factivate ## Install dependencies\n\t$(BIN)\u002Fpip install -r requirements.txt\n\t$(BIN)\u002Fpip install -r requirements-dev.txt\n\ntest: ## Run tests\n\t$(BIN)\u002Fpytest -v --cov=src --cov-report=term-missing\n\nlint: ## Run linters\n\t$(BIN)\u002Fruff check src\u002F tests\u002F\n\t$(BIN)\u002Fmypy src\u002F\n\nfmt: ## Format code\n\t$(BIN)\u002Fruff format src\u002F tests\u002F\n\nrun: ## Run application\n\t$(BIN)\u002Fpython -m src.main\n\nclean: ## Remove venv and caches\n\trm -rf $(VENV) __pycache__ .pytest_cache .mypy_cache .ruff_cache\n\tfind . -type d -name '__pycache__' -exec rm -rf {} + 2>\u002Fdev\u002Fnull || true\n```\n\n### Node.js \u002F TypeScript\n\n```makefile\n.PHONY: all install build test lint clean dev\n\nall: install lint test build\n\nnode_modules: package.json\n\tnpm install\n\t@touch node_modules\n\ninstall: node_modules ## Install dependencies\n\nbuild: node_modules ## Build TypeScript\n\tnpx tsc\n\ntest: node_modules ## Run tests\n\tnpx vitest run\n\ntest-watch: node_modules ## Run tests in watch mode\n\tnpx vitest\n\nlint: node_modules ## Lint code\n\tnpx eslint src\u002F --ext .ts,.tsx\n\tnpx tsc --noEmit\n\nfmt: node_modules ## Format code\n\tnpx prettier --write 'src\u002F**\u002F*.{ts,tsx}'\n\ndev: node_modules ## Run in development mode\n\tnpx tsx watch src\u002Findex.ts\n\nclean: ## Clean build artifacts\n\trm -rf dist\u002F node_modules\u002F.cache\n```\n\n### Docker\n\n```makefile\nIMAGE_NAME := myapp\nVERSION := $(shell git describe --tags --always)\nREGISTRY := ghcr.io\u002Fmyorg\n\n.PHONY: build push run stop clean\n\nbuild: ## Build Docker image\n\tdocker build -t $(IMAGE_NAME):$(VERSION) -t $(IMAGE_NAME):latest .\n\npush: build ## Push to registry\n\tdocker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)\u002F$(IMAGE_NAME):$(VERSION)\n\tdocker tag $(IMAGE_NAME):latest $(REGISTRY)\u002F$(IMAGE_NAME):latest\n\tdocker push $(REGISTRY)\u002F$(IMAGE_NAME):$(VERSION)\n\tdocker push $(REGISTRY)\u002F$(IMAGE_NAME):latest\n\nrun: ## Run container\n\tdocker run --rm -p 8080:8080 --name $(IMAGE_NAME) $(IMAGE_NAME):latest\n\nstop: ## Stop container\n\tdocker stop $(IMAGE_NAME) 2>\u002Fdev\u002Fnull || true\n\nclean: ## Remove images\n\tdocker rmi $(IMAGE_NAME):$(VERSION) $(IMAGE_NAME):latest 2>\u002Fdev\u002Fnull || true\n\ncompose-up: ## Start with docker compose\n\tdocker compose up -d --build\n\ncompose-down: ## Stop compose\n\tdocker compose down\n\ncompose-logs: ## Follow compose logs\n\tdocker compose logs -f\n```\n\n## Advanced Patterns\n\n### Conditional logic\n\n```makefile\n# OS detection\nUNAME := $(shell uname -s)\nifeq ($(UNAME),Darwin)\n    SED := sed -i ''\nelse\n    SED := sed -i\nendif\n\n# Environment-based config\nENV ?= development\nifeq ($(ENV),production)\n    CFLAGS += -O2\n    LDFLAGS += -s -w\nelse\n    CFLAGS += -g -O0\nendif\n\n# Check if command exists\nHAS_DOCKER := $(shell command -v docker 2>\u002Fdev\u002Fnull)\ndocker-build:\nifndef HAS_DOCKER\n\t$(error \"docker is not installed\")\nendif\n\tdocker build -t myapp .\n```\n\n### Multi-directory builds\n\n```makefile\nSERVICES := api worker scheduler\n\n.PHONY: build-all test-all $(SERVICES)\n\nbuild-all: $(SERVICES)\n\n$(SERVICES):\n\t$(MAKE) -C services\u002F$@ build\n\ntest-all:\n\t@for svc in $(SERVICES); do \\\n\t\techo \"Testing $$svc...\"; \\\n\t\t$(MAKE) -C services\u002F$$svc test || exit 1; \\\n\tdone\n```\n\n### Include other Makefiles\n\n```makefile\n# Split large Makefile into modules\ninclude mk\u002Fdocker.mk\ninclude mk\u002Ftest.mk\ninclude mk\u002Fdeploy.mk\n\n# Optional include (no error if missing)\n-include .env.mk\n```\n\n### Silent execution and output control\n\n```makefile\n# @ suppresses command echo\ninstall:\n\t@echo \"Installing dependencies...\"\n\t@npm install\n\n# .SILENT for entire targets\n.SILENT: help clean\n\n# Make less verbose globally\nMAKEFLAGS += --no-print-directory\n```\n\n## Just (Modern Alternative)\n\n### Justfile syntax\n\n```just\n# justfile — simpler than Make, no TAB requirement\n\n# Set shell\nset shell := [\"bash\", \"-euo\", \"pipefail\", \"-c\"]\n\n# Variables\nversion := `git describe --tags --always`\ndefault_port := \"8080\"\n\n# Default recipe (first one)\ndefault: lint test build\n\n# Recipes\nbuild: ## Build the application\n    go build -ldflags \"-X main.version={{version}}\" -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest: ## Run tests\n    go test -race .\u002F...\n\nlint: ## Run linters\n    golangci-lint run\n\nrun port=default_port: build ## Run with optional port\n    .\u002Fbin\u002Fapp --port {{port}}\n\nclean: ## Clean artifacts\n    rm -rf bin\u002F dist\u002F\n\n# Recipes with dependencies\ndeploy: build test\n    .\u002Fscripts\u002Fdeploy.sh\n\n# OS-specific\n[linux]\ninstall-deps:\n    sudo apt install -y build-essential\n\n[macos]\ninstall-deps:\n    brew install go golangci-lint\n\n# List recipes\nhelp:\n    @just --list\n```\n\n```bash\n# Install: https:\u002F\u002Fgithub.com\u002Fcasey\u002Fjust\n# Run:\njust          # Default recipe\njust build    # Specific recipe\njust run 9090 # With argument\njust --list   # List all recipes\n```\n\n## Task (Go Task Runner)\n\n### Taskfile.yml\n\n```yaml\n# Taskfile.yml\nversion: '3'\n\nvars:\n  VERSION:\n    sh: git describe --tags --always\n  BINARY: myapp\n\ntasks:\n  default:\n    deps: [lint, test, build]\n\n  build:\n    desc: Build the application\n    cmds:\n      - go build -ldflags \"-X main.version={{.VERSION}}\" -o bin\u002F{{.BINARY}} .\u002Fcmd\u002F{{.BINARY}}\n    sources:\n      - .\u002F**\u002F*.go\n    generates:\n      - bin\u002F{{.BINARY}}\n\n  test:\n    desc: Run tests\n    cmds:\n      - go test -race .\u002F...\n\n  lint:\n    desc: Run linters\n    cmds:\n      - golangci-lint run\n\n  run:\n    desc: Build and run\n    deps: [build]\n    cmds:\n      - .\u002Fbin\u002F{{.BINARY}} {{.CLI_ARGS}}\n\n  clean:\n    desc: Clean artifacts\n    cmds:\n      - rm -rf bin\u002F dist\u002F\n\n  docker:build:\n    desc: Build Docker image\n    cmds:\n      - docker build -t {{.BINARY}}:{{.VERSION}} .\n\n  # Task with preconditions\n  deploy:\n    desc: Deploy to production\n    preconditions:\n      - sh: test -f bin\u002F{{.BINARY}}\n        msg: \"Build first: task build\"\n      - sh: git diff --quiet\n        msg: \"Uncommitted changes detected\"\n    cmds:\n      - .\u002Fscripts\u002Fdeploy.sh\n```\n\n```bash\n# Install: https:\u002F\u002Ftaskfile.dev\u002Finstallation\u002F\n# Run:\ntask          # Default task\ntask build    # Specific task\ntask --list   # List all tasks\n```\n\n## Make vs Just vs Task\n\n| Feature | Make | Just | Task |\n|---|---|---|---|\n| Config format | Makefile (TAB-sensitive) | justfile | Taskfile.yml |\n| Dependencies | File-based + phony | Recipe-based | Task-based |\n| File change detection | Built-in | No | sources\u002Fgenerates |\n| Variables | Yes (complex) | Yes (simple) | Yes (YAML) |\n| Cross-platform | Needs make installed | Single binary | Single binary |\n| Learning curve | High | Low | Low |\n| Best for | C\u002FC++ builds, complex deps | Task runner replacement | YAML-native projects |\n\n## Tips\n\n- The number one Makefile bug: using spaces instead of tabs for indentation. Make requires literal TAB characters in recipes.\n- `.PHONY` every target that isn't a real file. Without it, `make clean` won't run if a file named `clean` exists.\n- Use `@` prefix to suppress command echo for cleaner output: `@echo \"Building...\"` prints only \"Building...\", not the echo command itself.\n- The self-documenting `help` target (with `## comments`) is worth adding to every Makefile. `make help` becomes the project's command reference.\n- Make is overkill for simple task running. If you just want named commands, Just or Task are simpler and don't have the TAB footgun.\n- Use `?=` for variables users might want to override: `PORT ?= 8080` lets `PORT=9090 make run` work.\n- For polyglot projects (Go + Python + Docker), a Makefile at the root that delegates to language-specific tools is a clean pattern.\n- Make's file-based dependency tracking is genuinely powerful for build systems. If your project compiles files, Make's `target: prerequisites` model avoids unnecessary rebuilds.\n","# Makefile & Build\n\nWrite Makefiles for project automation across any language. Covers targets, dependencies, variables, pattern rules, phony targets, and using Make for Go, Python, Docker, and Node.js projects. Includes Just and Task as modern alternatives.\n\n## When to Use\n\n- Automating build, test, lint, deploy commands\n- Defining dependencies between tasks (build before test)\n- Creating a project-level task runner (consistent across team)\n- Replacing long CLI commands with short memorable targets\n- Managing multi-step build processes\n- Any project that needs a `make build && make test && make deploy` workflow\n\n## Makefile Basics\n\n### Structure\n\n```makefile\n# target: prerequisites\n#     recipe (MUST be indented with TAB, not spaces)\n\nbuild: src\u002Fmain.go\n\tgo build -o bin\u002Fapp src\u002Fmain.go\n\ntest: build\n\tgo test .\u002F...\n\nclean:\n\trm -rf bin\u002F\n\n# First target is the default (runs with bare `make`)\n```\n\n### Variables\n\n```makefile\n# Simple assignment\nCC = gcc\nCFLAGS = -Wall -O2\n\n# Deferred assignment (expanded when used)\nFILES = $(wildcard src\u002F*.go)\n\n# Immediate assignment (expanded when defined)\nVERSION := $(shell git describe --tags --always)\n\n# Conditional assignment (only if not already set)\nPORT ?= 8080\n\n# Use variables\nbuild:\n\t$(CC) $(CFLAGS) -o app main.c\n\t@echo \"Version: $(VERSION)\"\n```\n\n### Automatic variables\n\n```makefile\n# $@ = target name\n# $\u003C = first prerequisite\n# $^ = all prerequisites\n# $* = stem (pattern match)\n# $(@D) = directory of target\n# $(@F) = filename of target\n\nbin\u002Fapp: src\u002Fmain.go src\u002Futil.go\n\tgo build -o $@ $^\n# $@ = bin\u002Fapp\n# $^ = src\u002Fmain.go src\u002Futil.go\n# $\u003C = src\u002Fmain.go\n\n# Pattern rule\n%.o: %.c\n\t$(CC) -c -o $@ $\u003C\n# For foo.o: $@ = foo.o, $\u003C = foo.c, $* = foo\n```\n\n### Phony targets (not files)\n\n```makefile\n# Without .PHONY, if a file named \"clean\" exists, `make clean` does nothing\n.PHONY: build test clean lint fmt help\n\nbuild:\n\tgo build -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest:\n\tgo test .\u002F...\n\nclean:\n\trm -rf bin\u002F dist\u002F\n\n# List all targets\nhelp:\n\t@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \\\n\t\tawk 'BEGIN {FS = \":.*?## \"}; {printf \"  \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'\n```\n\n### Self-documenting Makefile\n\n```makefile\n.DEFAULT_GOAL := help\n\nbuild: ## Build the application\n\tgo build -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest: ## Run all tests\n\tgo test -v .\u002F...\n\nlint: ## Run linters\n\tgolangci-lint run\n\nclean: ## Remove build artifacts\n\trm -rf bin\u002F dist\u002F\n\nhelp: ## Show this help\n\t@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \\\n\t\tawk 'BEGIN {FS = \":.*?## \"}; {printf \"  \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'\n```\n\n## Language-Specific Makefiles\n\n### Go\n\n```makefile\nBINARY_NAME := myapp\nVERSION := $(shell git describe --tags --always --dirty)\nLDFLAGS := -ldflags \"-X main.version=$(VERSION)\"\nGOFILES := $(shell find . -name '*.go' -not -path '.\u002Fvendor\u002F*')\n\n.PHONY: all build test lint clean run\n\nall: lint test build\n\nbuild: ## Build binary\n\tCGO_ENABLED=0 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME) .\u002Fcmd\u002F$(BINARY_NAME)\n\ntest: ## Run tests\n\tgo test -race -coverprofile=coverage.out .\u002F...\n\ntest-coverage: test ## Show coverage report\n\tgo tool cover -html=coverage.out\n\nlint: ## Run linters\n\tgolangci-lint run .\u002F...\n\nfmt: ## Format code\n\tgofmt -w $(GOFILES)\n\nrun: build ## Build and run\n\t.\u002Fbin\u002F$(BINARY_NAME)\n\nclean: ## Clean build artifacts\n\trm -rf bin\u002F coverage.out\n\n# Cross-compilation\nbuild-linux: ## Build for Linux\n\tGOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-linux-amd64 .\u002Fcmd\u002F$(BINARY_NAME)\n\nbuild-all: ## Build for all platforms\n\tGOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-linux-amd64 .\u002Fcmd\u002F$(BINARY_NAME)\n\tGOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-darwin-arm64 .\u002Fcmd\u002F$(BINARY_NAME)\n\tGOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin\u002F$(BINARY_NAME)-windows-amd64.exe .\u002Fcmd\u002F$(BINARY_NAME)\n```\n\n### Python\n\n```makefile\nPYTHON := python3\nVENV := .venv\nBIN := $(VENV)\u002Fbin\n\n.PHONY: all install test lint fmt clean run\n\nall: install lint test\n\n$(VENV)\u002Fbin\u002Factivate:\n\t$(PYTHON) -m venv $(VENV)\n\t$(BIN)\u002Fpip install --upgrade pip\n\ninstall: $(VENV)\u002Fbin\u002Factivate ## Install dependencies\n\t$(BIN)\u002Fpip install -r requirements.txt\n\t$(BIN)\u002Fpip install -r requirements-dev.txt\n\ntest: ## Run tests\n\t$(BIN)\u002Fpytest -v --cov=src --cov-report=term-missing\n\nlint: ## Run linters\n\t$(BIN)\u002Fruff check src\u002F tests\u002F\n\t$(BIN)\u002Fmypy src\u002F\n\nfmt: ## Format code\n\t$(BIN)\u002Fruff format src\u002F tests\u002F\n\nrun: ## Run application\n\t$(BIN)\u002Fpython -m src.main\n\nclean: ## Remove venv and caches\n\trm -rf $(VENV) __pycache__ .pytest_cache .mypy_cache .ruff_cache\n\tfind . -type d -name '__pycache__' -exec rm -rf {} + 2>\u002Fdev\u002Fnull || true\n```\n\n### Node.js \u002F TypeScript\n\n```makefile\n.PHONY: all install build test lint clean dev\n\nall: install lint test build\n\nnode_modules: package.json\n\tnpm install\n\t@touch node_modules\n\ninstall: node_modules ## Install dependencies\n\nbuild: node_modules ## Build TypeScript\n\tnpx tsc\n\ntest: node_modules ## Run tests\n\tnpx vitest run\n\ntest-watch: node_modules ## Run tests in watch mode\n\tnpx vitest\n\nlint: node_modules ## Lint code\n\tnpx eslint src\u002F --ext .ts,.tsx\n\tnpx tsc --noEmit\n\nfmt: node_modules ## Format code\n\tnpx prettier --write 'src\u002F**\u002F*.{ts,tsx}'\n\ndev: node_modules ## Run in development mode\n\tnpx tsx watch src\u002Findex.ts\n\nclean: ## Clean build artifacts\n\trm -rf dist\u002F node_modules\u002F.cache\n```\n\n### Docker\n\n```makefile\nIMAGE_NAME := myapp\nVERSION := $(shell git describe --tags --always)\nREGISTRY := ghcr.io\u002Fmyorg\n\n.PHONY: build push run stop clean\n\nbuild: ## Build Docker image\n\tdocker build -t $(IMAGE_NAME):$(VERSION) -t $(IMAGE_NAME):latest .\n\npush: build ## Push to registry\n\tdocker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)\u002F$(IMAGE_NAME):$(VERSION)\n\tdocker tag $(IMAGE_NAME):latest $(REGISTRY)\u002F$(IMAGE_NAME):latest\n\tdocker push $(REGISTRY)\u002F$(IMAGE_NAME):$(VERSION)\n\tdocker push $(REGISTRY)\u002F$(IMAGE_NAME):latest\n\nrun: ## Run container\n\tdocker run --rm -p 8080:8080 --name $(IMAGE_NAME) $(IMAGE_NAME):latest\n\nstop: ## Stop container\n\tdocker stop $(IMAGE_NAME) 2>\u002Fdev\u002Fnull || true\n\nclean: ## Remove images\n\tdocker rmi $(IMAGE_NAME):$(VERSION) $(IMAGE_NAME):latest 2>\u002Fdev\u002Fnull || true\n\ncompose-up: ## Start with docker compose\n\tdocker compose up -d --build\n\ncompose-down: ## Stop compose\n\tdocker compose down\n\ncompose-logs: ## Follow compose logs\n\tdocker compose logs -f\n```\n\n## Advanced Patterns\n\n### Conditional logic\n\n```makefile\n# OS detection\nUNAME := $(shell uname -s)\nifeq ($(UNAME),Darwin)\n    SED := sed -i ''\nelse\n    SED := sed -i\nendif\n\n# Environment-based config\nENV ?= development\nifeq ($(ENV),production)\n    CFLAGS += -O2\n    LDFLAGS += -s -w\nelse\n    CFLAGS += -g -O0\nendif\n\n# Check if command exists\nHAS_DOCKER := $(shell command -v docker 2>\u002Fdev\u002Fnull)\ndocker-build:\nifndef HAS_DOCKER\n\t$(error \"docker is not installed\")\nendif\n\tdocker build -t myapp .\n```\n\n### Multi-directory builds\n\n```makefile\nSERVICES := api worker scheduler\n\n.PHONY: build-all test-all $(SERVICES)\n\nbuild-all: $(SERVICES)\n\n$(SERVICES):\n\t$(MAKE) -C services\u002F$@ build\n\ntest-all:\n\t@for svc in $(SERVICES); do \\\n\t\techo \"Testing $$svc...\"; \\\n\t\t$(MAKE) -C services\u002F$$svc test || exit 1; \\\n\tdone\n```\n\n### Include other Makefiles\n\n```makefile\n# Split large Makefile into modules\ninclude mk\u002Fdocker.mk\ninclude mk\u002Ftest.mk\ninclude mk\u002Fdeploy.mk\n\n# Optional include (no error if missing)\n-include .env.mk\n```\n\n### Silent execution and output control\n\n```makefile\n# @ suppresses command echo\ninstall:\n\t@echo \"Installing dependencies...\"\n\t@npm install\n\n# .SILENT for entire targets\n.SILENT: help clean\n\n# Make less verbose globally\nMAKEFLAGS += --no-print-directory\n```\n\n## Just (Modern Alternative)\n\n### Justfile syntax\n\n```just\n# justfile — simpler than Make, no TAB requirement\n\n# Set shell\nset shell := [\"bash\", \"-euo\", \"pipefail\", \"-c\"]\n\n# Variables\nversion := `git describe --tags --always`\ndefault_port := \"8080\"\n\n# Default recipe (first one)\ndefault: lint test build\n\n# Recipes\nbuild: ## Build the application\n    go build -ldflags \"-X main.version={{version}}\" -o bin\u002Fapp .\u002Fcmd\u002Fapp\n\ntest: ## Run tests\n    go test -race .\u002F...\n\nlint: ## Run linters\n    golangci-lint run\n\nrun port=default_port: build ## Run with optional port\n    .\u002Fbin\u002Fapp --port {{port}}\n\nclean: ## Clean artifacts\n    rm -rf bin\u002F dist\u002F\n\n# Recipes with dependencies\ndeploy: build test\n    .\u002Fscripts\u002Fdeploy.sh\n\n# OS-specific\n[linux]\ninstall-deps:\n    sudo apt install -y build-essential\n\n[macos]\ninstall-deps:\n    brew install go golangci-lint\n\n# List recipes\nhelp:\n    @just --list\n```\n\n```bash\n# Install: https:\u002F\u002Fgithub.com\u002Fcasey\u002Fjust\n# Run:\njust          # Default recipe\njust build    # Specific recipe\njust run 9090 # With argument\njust --list   # List all recipes\n```\n\n## Task (Go Task Runner)\n\n### Taskfile.yml\n\n```yaml\n# Taskfile.yml\nversion: '3'\n\nvars:\n  VERSION:\n    sh: git describe --tags --always\n  BINARY: myapp\n\ntasks:\n  default:\n    deps: [lint, test, build]\n\n  build:\n    desc: Build the application\n    cmds:\n      - go build -ldflags \"-X main.version={{.VERSION}}\" -o bin\u002F{{.BINARY}} .\u002Fcmd\u002F{{.BINARY}}\n    sources:\n      - .\u002F**\u002F*.go\n    generates:\n      - bin\u002F{{.BINARY}}\n\n  test:\n    desc: Run tests\n    cmds:\n      - go test -race .\u002F...\n\n  lint:\n    desc: Run linters\n    cmds:\n      - golangci-lint run\n\n  run:\n    desc: Build and run\n    deps: [build]\n    cmds:\n      - .\u002Fbin\u002F{{.BINARY}} {{.CLI_ARGS}}\n\n  clean:\n    desc: Clean artifacts\n    cmds:\n      - rm -rf bin\u002F dist\u002F\n\n  docker:build:\n    desc: Build Docker image\n    cmds:\n      - docker build -t {{.BINARY}}:{{.VERSION}} .\n\n  # Task with preconditions\n  deploy:\n    desc: Deploy to production\n    preconditions:\n      - sh: test -f bin\u002F{{.BINARY}}\n        msg: \"Build first: task build\"\n      - sh: git diff --quiet\n        msg: \"Uncommitted changes detected\"\n    cmds:\n      - .\u002Fscripts\u002Fdeploy.sh\n```\n\n```bash\n# Install: https:\u002F\u002Ftaskfile.dev\u002Finstallation\u002F\n# Run:\ntask          # Default task\ntask build    # Specific task\ntask --list   # List all tasks\n```\n\n## Make vs Just vs Task\n\n| Feature | Make | Just | Task |\n|---|---|---|---|\n| Config format | Makefile (TAB-sensitive) | justfile | Taskfile.yml |\n| Dependencies | File-based + phony | Recipe-based | Task-based |\n| File change detection | Built-in | No | sources\u002Fgenerates |\n| Variables | Yes (complex) | Yes (simple) | Yes (YAML) |\n| Cross-platform | Needs make installed | Single binary | Single binary |\n| Learning curve | High | Low | Low |\n| Best for | C\u002FC++ builds, complex deps | Task runner replacement | YAML-native projects |\n\n## Tips\n\n- The number one Makefile bug: using spaces instead of tabs for indentation. Make requires literal TAB characters in recipes.\n- `.PHONY` every target that isn't a real file. Without it, `make clean` won't run if a file named `clean` exists.\n- Use `@` prefix to suppress command echo for cleaner output: `@echo \"Building...\"` prints only \"Building...\", not the echo command itself.\n- The self-documenting `help` target (with `## comments`) is worth adding to every Makefile. `make help` becomes the project's command reference.\n- Make is overkill for simple task running. If you just want named commands, Just or Task are simpler and don't have the TAB footgun.\n- Use `?=` for variables users might want to override: `PORT ?= 8080` lets `PORT=9090 make run` work.\n- For polyglot projects (Go + Python + Docker), a Makefile at the root that delegates to language-specific tools is a clean pattern.\n- Make's file-based dependency tracking is genuinely powerful for build systems. If your project compiles files, Make's `target: prerequisites` model avoids unnecessary rebuilds.\n",{"name":5,"metadata":43,"description":7},{"clawdbot":44},{"os":45,"emoji":47,"requires":48},[36,46,33],"darwin","?",{"anyBins":49},[50,30,27],"make","main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Fgitgoodordietrying\u002Fmakefile-build",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add kbarbel640-del\u002Fskills --skill makefile-build",{"tool":64,"command":65},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill makefile-build",{"tool":67,"command":68},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill makefile-build","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgitgoodordietrying\u002Fmakefile-build\u002FSKILL.md",true,[72],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"_meta.json","REFERENCE","参考文档",294,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgitgoodordietrying\u002Fmakefile-build\u002F_meta.json",[79,105,127,145,150,168],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":38},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],"crowd prompting","prompting","api","with","tokens","domain","world","prompts","operations","instructions","text","tool","system","improve","productivity","marketplace","https","content","ai agents",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":38},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[112,88,113,114,115,116,117,35,118,119,120,121,122,123,124,125,126,93,21],"dilemm ai","arena","analyze","browser","openclaw agent","create","browser automation","bot","openclaw","design","strategy","headless","compete","submit","matchmaking",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":38},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[],[134,135,136,137,138,139,140,89,141,125,21,142,88,143,144],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http","via",{"skillNo":146,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":38},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[137,136,135,134,144,139,140,89,138,125,21,141,142,88,143],{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":38},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[157,158,159,160,161,33,162,36,163,164,165,166,167],"git","summary","git summary","commits","repository","status","contributors","true","quick","get","branches",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":38},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[],[175,176,177,178,89,179,180,51,181,142,182,183,31,184,185,102,186,187,188],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","compliance","actions","state","governance","github"]