Write simple, explicit file rules compatible with standard make.
Section: Portable make basics
POSIX-style portable rule
makefile
makefile
all: app
app: main.o util.o
cc -o app main.o util.oExplanation
Explicit rules are the most portable foundation.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Portable make basics
Use standard macros
Honor user-overridable standard compiler variables.
Suffix rule
Use classic suffix rules when targeting very portable make implementations.
Use shell short-circuit safely
Stop on failure explicitly within one recipe line.
Avoid eval for POSIX portability
Prefer explicit rules over GNU metaprogramming.