import property ; rule compile ( target : sources * : property-set * ) { local options ; for local p in $(property-set) { if $(p) = on { options += -O2 ; } else if $(p) = on { options += -g ; } else if $(p:G) = { options += -D$(p:G=) ; } } OPTIONS on $(target) = $(options) ; } actions compile { g++ $(OPTIONS) -c -o $(<) $(>) } rule link ( target : sources * : property-set * ) { local options ; if on in $(property-set) { options += -g ; } OPTIONS on $(target) = $(options) ; } actions link { g++ $(OPTIONS) -o $(<) $(>) }