Skip Navigation

Search

makefile @lemmy.ml
bahmanm @lemmy.ml

bmakelib v0.7.0

github.com Release v0.7.0 · bahmanm/bmakelib

The highlight is the introduction of fail-fast alternative to $(shell) which relieves you from checking .SHELLSTATUS every time $(shell) is used. Makefile: VAR1 := $(call bmakelib.shell.error-if-no...

Release v0.7.0 · bahmanm/bmakelib

bmakelib v0.7.0 has just been released.

The highlight is the fail-fast alternative to $(shell) which relieves you from checking .SHELLSTATUS every time $(shell) is used.


Makefile:

 makefile
    
include  bmakelib/bmakelib.mk

VAR1 := $(call bmakelib.shell.error-if-nonzero,\
           echo Fails hard❗ && false)

unreachable-target :

  

Shell:

 text
    
$ make unreachable-target
Makefile:3: *** shell.error-if-nonzero: Command exited with non-zero value 1.  Stop.


  
makefile @lemmy.ml
bahmanm @lemmy.ml

bmakelib v0.6.0 with enums

github.com Release v0.6.0 · bahmanm/bmakelib

The highlight of this release is the introduction of enums (aka variants or options) which can be used to limit and validate a variable's value. For example: Makefile: define-enum : bmakelib.enum.d...

Release v0.6.0 · bahmanm/bmakelib

bmakelib is a collection of useful targets, recipes and variables you can use to augment your Makefiles.


I just released bmakelib v0.6.0 w/ the main highlight being the ability to define enums and validate variable values against them.


➤ Makefile:

 Makefile
    
define-enum : bmakelib.enum.define( DEPLOY-ENV/dev,staging,prod )
include define-enum

deploy : bmakelib.enum.error-unless-member( DEPLOY-ENV,ENV )
deploy :
    @echo 🚀 Deploying to $(ENV)...

  

➤ Shell:

 text
    
$ make ENV=local-laptop deploy
*** 'local-laptop' is not a member of enum 'DEPLOY-ENV'.  Stop.

$ make ENV=prod deploy
🚀 Deploying to prod...