/odin-native:makefrom ODIN Native
Writes and debugs Makefiles for C/C++ projects: pattern rules, automatic dependency generation, CFLAGS/LDFLAGS management, incremental builds, phony targets, and recursive make.
Ships in ODIN Native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Idiomatic Makefile patterns for C/C++ projects: phony targets, pattern rules, automatic dependency generation, and incremental-build hygiene. Grounded against GNU Make 4.4.
| Field | Bound contract |
|---|---|
| Trigger | The task writes or debugs a Makefile, sets up pattern rules or automatic dependency generation, manages CFLAGS/LDFLAGS, converts ad-hoc compile commands into a Makefile, or diagnoses incremental build failures. |
| Authority | Reversible local: writes only Makefile/*.mk files and local build outputs; rollback is version control plus make clean. No remote mutation. |
| Side effect | make runs the compiler and writes objects and binaries into the tree or build directory. |
| Done | make builds the target incrementally (a second run reports nothing to do) and make clean removes the outputs. |
.c/.cpp files and headers live.CC, CFLAGS, LDFLAGS, LDLIBS.make builds and make clean removes outputs.CC := gcc
CFLAGS := -std=c23 -Wall -Wextra -g -O2
LDFLAGS :=
LDLIBS :=
SRCS := $(wildcard src/*.c)
OBJS := $(SRCS:src/%.c=build/%.o)
TARGET := build/prog
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
build/%.o: src/%.c | build
$(CC) $(CFLAGS) -c -o $@ $<
build:
mkdir -p build
clean:
rm -rf build
Automatic variables: $@ is the target, $< the first prerequisite, $^ all prerequisites deduplicated, $* the pattern stem, $(@D) the target's directory part.
-MMD writes a .d file per object; -MP adds phony targets for headers so deleting one does not break the build. Done when: touching a header rebuilds exactly its dependents.DEPFLAGS = -MMD -MP
DEPS := $(OBJS:.o=.d)
build/%.o: src/%.c | build
$(CC) $(CFLAGS) $(DEPFLAGS) -MF $(@:.o=.d) -c -o $@ $<
-include $(DEPS) # leading - ignores missing .d files on first build
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.s: %.c
$(CC) $(CFLAGS) -S -o $@ $<
make BUILD=debug switches flags and make V=1 shows full commands.BUILD ?= release
ifeq ($(BUILD),debug)
CFLAGS += -g -Og -DDEBUG
else
CFLAGS += -O2 -DNDEBUG
endif
Q := $(if $(V),,@)
build/%.o: src/%.c | build
@echo " CC $<"
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
DESTDIR and PREFIX. Done when: make install DESTDIR=/tmp/stage stages the tree.PREFIX ?= /usr/local
install: $(TARGET)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/
.mk files, not recursive make. Recursive make fragments the dependency graph and breaks parallelism. Done when: one top-level Makefile sees every prerequisite.# Makefile
include lib/module.mk
include src/app.mk
# lib/module.mk
LIB_SRCS := $(wildcard lib/*.c)
LIB_OBJS := $(LIB_SRCS:lib/%.c=build/lib_%.o)
OBJS += $(LIB_OBJS)
build/lib_%.o: lib/%.c
$(CC) $(CFLAGS) -c -o $@ $<
| Error | Cause | Fix |
|---|---|---|
No rule to make target 'foo.o' | Missing source or rule | Check the source path and pattern rule |
Nothing to be done for 'all' | Targets up to date | Touch a source or run make clean |
Circular dependency dropped | Target depends on itself | Trace the prerequisite chain |
missing separator | Spaces where a tab belongs | Recipes need a literal tab |
multiple target patterns | Bad pattern rule syntax | Check % placement |
| Rebuilds everything | Wrong timestamps or missing .PHONY | Check date; mark all and clean phony |
| Header edit rebuilds nothing | No dependency tracking | Add -MMD -MP and -include $(DEPS) |
Useful flags: make -j"$(nproc)" parallel, make -O synchronizes output, make -n dry run, make -B force rebuild, make -k keep going, make -p print the rule database, make --warn-undefined-variables catch typos.
For the full variable, function, and special-target reference see references/cheatsheet.md.
make does nothing after a header edit: dependency files are missing; add -MMD -MP and -include $(DEPS).missing separator: convert the recipe's leading spaces to a tab.= defers expansion to use time, := expands at definition; pick := unless late expansion is the point. ::= is the POSIX immediate form, available in GNU Make 4.4 and later..mk files from the top Makefile instead of $(MAKE) -C.A Makefile that builds incrementally, tracks header dependencies, supports clean and install, and survives make -j. For debugging tasks, the diagnosed cause and the minimal fix.
What SKILL.md sets; muted values are Claude Code's defaults
138 skills in this plugin
/abi-and-calling-conventionsUse when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi./adc-dac-baremetalUse when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal./af-xdpUse when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk./apple-siliconUse when tuning or profiling native code on Apple M-series Macs: unified memory, 16 KiB pages, Accelerate and Metal for matrix work, xctrace and leaks, Rosetta 2, or sysctl hardware queries./arm-sveUse when writing or porting AArch64 SIMD to SVE or SVE2: arm_sve.h intrinsics, predicates, vector-length-agnostic loops, auto-vectorization, or SVE registers in GDB. Not for NEON: use simd-intrinsics./assembly-armUse when reading or writing AArch64 or AArch32 Thumb assembly, inline asm in C, AAPCS64 register roles, or NEON and SVE vector code. Not for ABI detail across ISAs: use abi-and-calling-conventions.npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-nativeOther plugins' skills for the same job