_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

makeusing OpenBSD make

back_to_top

make [-f MAKEFILE]

use bmake on linux.

back_to_top

makefile
if no makefile is specified with -f makefile it defaults to makefile, Makefile.
target
defaults to the first defined target, unless .MAIN: is specified.
echo
it echoes the command unless the command is called @command.
errors
exits on error unless ignored by calling -command.

back_to_top

:S : Substitute string :S/old/new/
:C : Substitute regex :C/pattern/replacement

back_to_top

target:
	commands
target! #run even when up-to-date
target: prereq
target1 target2:
	@echo "this only displays this text but not the command itself."
	-cat /tmp/file_that_does_not_exist
VAR=something
VAR_RES!=command result
VAR_SUB=${VAR:S/STRING/REP/}
VAR_REGSUB=${VAR:C/REGEX/REP/}
target_show:
	echo 'target name: ' ${@}

back_to_top

t2:
	-cat Makefile
t1: t2
	cat makefile
makefile t3!
	echo ${@}
t4_t5:
	@echo 'target: ' ${@}
	@echo 'change t5 to t6: ' ${@:S/t5/t6/}
	@echo 't4: ' ${@:C/_.*$//}
	@echo 't5: ' ${@:C/^.*_//}

back_to_top

back_to_top

make(1)

<make.oh>

back_to_top

ohazot | about | ohazot.com <admin@ohazot.com>

Created:2025-10-03|Updated:2025-10-06 OpenBSD linux