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 This content has been proxied by September (3851b).Proxy Information
text/gemini