The minimalist Make standard library you'd always wished for!
bmakelib is essentially a collection of useful targets, recipes and variables you can use to augment your Makefiles.
The aim is not to simplify writing Makefiles but rather help you write cleaner and easier to read and maintain Makefiles.
Makefile:
include bmakelib/bmakelib.mk
my-target : bmakelib.error-if-blank( VAR1 )
my-target :
@echo ✅ VAR1 value is $(VAR1)
Shell:
$ make my-target
*** Provide value for 'VAR1'. Stop.
$ make VAR1=foo my-target
✅ VAR1 value is foo
⭐ enum
⭐ shell
⭐ dict
⭐ timed
⭐ logged
Although not an installation dependency, bmakelib relies on Gnu Make 4.4+ which was released back in 2022.
To check the version which is currently installed, simply make -v
in a terminal. The output should
look like below.
$ make -v
GNU Make 4.4.1
...
💡 Installing Gnu Make is quite easy. In fact as easy as:
$ wget https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz
$ tar xzf make-4.4.1.tar.gz
$ cd make-4.4.1
$ ./configure --prefix=/usr/local
$ make install
Simply grab the prepackaged RPM from the release page and install it using your faourite method. For example:
$ wget https://github.com/bahmanm/bmakelib/releases/download/v0.6.0/bmakelib-0.6.0-1.1.noarch.rpm
$ rpm -i bmakelib-0.6.0-1.1.noarch.rpm
Simply grab the prepackaged DEB from the release page and install it using your faourite method. For example:
$ wget https://github.com/bahmanm/bmakelib/releases/download/v0.6.0/bmakelib_0.6.0-1_all.deb
$ dpkg -i bmakelib_0.6.0-1_all.deb
Assuming you have Homebrew configured, simply install bmakelib as below:
$ brew update
$ brew tap bahmanm/bmakelib
$ brew install bmakelib
Grab the source archive from the release page:
$ wget https://github.com/bahmanm/bmakelib/releases/download/v0.6.0/bmakelib-0.6.0.tar.gz
$ tar zxf bmakelib-0.6.0.tar.gz
$ cd bmakelib-0.6.0
$ sudo PREFIX=/usr/local make install
bmakelib tries to introduce as little clutter as possible to Makefiles and be easy to use.
That is, all you need to start using bmakelib is adding a single line somewhere in your Makefile:
include bmakelib/bmakelib.mk
💡 You can safely skip this section if you have installed bmakelib using the prepackaged artefacts or
you have installed it in a standard location (such as /usr/local
or /usr
.)
In case you installed bmakelib in a non-standard location, you either need to include
bmakelib using
full path or pass the installation directory to make via --include-dir
option.
For example, assuming you installed bmakelib to /my-collection/bmakelib
:
Makefile:
include bmakelib/bmakelib.mk
my-target :
...
Shell:
$ make --include-dir /my-collection/bmakelib my-target
Makefile:
include /my-collection/bmakelib/include/bmakelib.mk
my-target :
...
Shell:
$ make my-target