#!/bin/false ifeq ($(findstring target-specific,$(.FEATURES)),) $(error missing feature: target-specific variable assignments) endif # works: no private keyword P = 1 # works: only global private keyword P = 2 # works for prereq, but also tries to build `private' for target P = ifeq ($(P),1) GLOBAL = global target: LOCAL = local else ifeq ($(P),2) private GLOBAL = global # not visible within recipes target: LOCAL = local else private GLOBAL = global # not visible within recipes target: private LOCAL = local # suppress inheritance endif endif target: prereq @echo $@: $(GLOBAL) $(LOCAL) prereq: @echo $@: $(GLOBAL) $(LOCAL) # ***** end of source *****