GNU Make and bmake

I was trying to create a Makefile for a personal project when I recalled that bmake exists, a portable version of make from NetBSD. bmake seems quite similar to OpenBSD's make as well. I was interested in making my Makefile portable and compatible with both GNU Make and bmake but I quickly ran into a roadblock.

=> bmake | OpenBSD make man page

GNU Make uses "$^" as an automatic variable to expand into the list of all prerequisites (sometimes called dependencies or sources) provided to a target but bmake uses "$>" to do the same thing. Here's a simple Makefile.

myfile: file1 file2
	cat file1 file2 > myfile

=> automatic variables in GNU Make

The second line of this Makefile can be rewritten as "cat $^ > $@" for GNU Make. However, it needs to be written as "cat $> > $@" for bmake. "$@" is the name of the target, which is myfile.

It looks like I can either

Am I missing something?


Created: 2022-09-08

=> MicroGemlog | Home

Proxy Information
Original URL
gemini://ayushnix.com/microgemlog/2022-09-08-gnu-make-and-bmake.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
637.583449 milliseconds
Gemini-to-HTML Time
0.421101 milliseconds

This content has been proxied by September (3851b).