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

makeusing OpenBSD make

make [-f MAKEFILE]

use bmake on linux. It's Slackbuild on Slackware.
Slackware has a core package pmake which works as well (as far as I have tested).

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

openbsd

- example makefiles: </dev/ohazot.mk>

- OpenBSD manpages: make(1)

- ArchLinux manpages: bmake (OpenBSD make):

back to top

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

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