Makefile
Universal build tool
$@
= target name$^
= all prerequisites$<
= first prerequisite:=
→ evaluated once in whole script=
→ evaluated every time value is being used
Ensuring Cross Platform Compatibility
Here’s some tips on ensuring cross platform compatibility for Linux (shell) and Windows (cmd/powershell):
- use tabs to indent commands in makefile targets
- use
cd dir && command
instead ofcd dir; command
- use built in
@echo "TEXT $(VAR)"
function for printing output - avoid special characters after
@echo
statements