1 1.4.2.1 cjep # $NetBSD: varmod-unique.mk,v 1.4.2.1 2021/05/31 22:15:25 cjep Exp $ 2 1.1 rillig # 3 1.2 rillig # Tests for the :u variable modifier, which discards adjacent duplicate 4 1.2 rillig # words. 5 1.1 rillig 6 1.3 rillig .if ${:U1 2 1:u} != "1 2 1" 7 1.4 rillig . warning The :u modifier only merges _adjacent_ duplicate words. 8 1.3 rillig .endif 9 1.3 rillig 10 1.3 rillig .if ${:U1 2 2 3:u} != "1 2 3" 11 1.3 rillig . warning The :u modifier must merge adjacent duplicate words. 12 1.3 rillig .endif 13 1.3 rillig 14 1.3 rillig .if ${:U:u} != "" 15 1.4 rillig . warning The :u modifier must do nothing with an empty word list. 16 1.3 rillig .endif 17 1.3 rillig 18 1.4.2.1 cjep .if ${:U :u} != "" 19 1.4.2.1 cjep . warning The modifier ':u' must normalize the whitespace. 20 1.4.2.1 cjep .endif 21 1.4.2.1 cjep 22 1.4.2.1 cjep .if ${:Uword:u} != "word" 23 1.4 rillig . warning The :u modifier must do nothing with a single-element word list. 24 1.3 rillig .endif 25 1.3 rillig 26 1.4.2.1 cjep .if ${:U word :u} != "word" 27 1.4.2.1 cjep . warning The modifier ':u' must normalize the whitespace. 28 1.4.2.1 cjep .endif 29 1.4.2.1 cjep 30 1.4 rillig .if ${:U1 1 1 1 1 1 1 1:u} != "1" 31 1.3 rillig . warning The :u modifier must merge _all_ adjacent duplicate words. 32 1.3 rillig .endif 33 1.3 rillig 34 1.4 rillig .if ${:U 1 2 1 1 :u} != "1 2 1" 35 1.3 rillig . warning The :u modifier must normalize whitespace between the words. 36 1.4 rillig .endif 37 1.4 rillig 38 1.4 rillig .if ${:U1 1 1 1 2:u} != "1 2" 39 1.4 rillig . warning Duplicate words at the beginning must be merged. 40 1.4 rillig .endif 41 1.4 rillig 42 1.4 rillig .if ${:U1 2 2 2 2:u} != "1 2" 43 1.4 rillig . warning Duplicate words at the end must be merged. 44 1.3 rillig .endif 45 1.1 rillig 46 1.1 rillig all: 47 1.1 rillig @:; 48