export-variants.mk revision 1.2
11.2Srillig# $NetBSD: export-variants.mk,v 1.2 2020/08/08 13:00:07 rillig Exp $ 21.2Srillig# 31.2Srillig# Test whether exported variables apply to each variant of running 41.2Srillig# external commands: 51.2Srillig# 61.2Srillig# The != assignments. 71.2Srillig# The :!cmd! modifier. 81.2Srillig# The :sh modifier. 91.2Srillig 101.2SrilligSHVAR!= env | grep ^UT_ || true 111.2Srillig.if ${SHVAR} != "" 121.2Srillig.warning At this point, no variable should be exported. 131.2Srillig.endif 141.2Srillig 151.2Srillig.if ${:!env | grep ^UT_ || true!} != "" 161.2Srillig.warning At this point, no variable should be exported. 171.2Srillig.endif 181.2Srillig 191.2Srillig.if ${env | grep ^UT_ || true:L:sh} != "" 201.2Srillig.warning At this point, no variable should be exported. 211.2Srillig.endif 221.2Srillig 231.2SrilligUT_VAR= value 241.2Srillig.export UT_VAR 251.2Srillig 261.2SrilligSHVAR!= env | grep ^UT_ || true 271.2Srillig.if ${SHVAR} != "UT_VAR=value" 281.2Srillig.warning At this point, no variable should be exported. 291.2Srillig.endif 301.2Srillig 311.2Srillig.if ${:!env | grep ^UT_ || true!} != "UT_VAR=value" 321.2Srillig.warning At this point, some variables should be exported. 331.2Srillig.endif 341.2Srillig 351.2Srillig.if ${env | grep ^UT_ || true:L:sh} != "UT_VAR=value" 361.2Srillig.warning At this point, some variables should be exported. 371.2Srillig.endif 381.2Srillig 391.2Srilligall: 401.2Srillig @:; 41