# HelperRules # # Helper rules without side effects. rule FFilter { # FFilter : ; # # Removes all occurrences of in . local list = $(1) ; local excludes = $(2) ; local newList ; local item ; for item in $(list) { local skip ; local exclude ; for exclude in $(excludes) { if $(item) = $(exclude) { skip = true ; } } if ! $(skip) { newList += $(item) ; } } return $(newList) ; } rule FSplitPath { # FSplitPath ; # # Decomposes a path into its components. # # : The path to be decomposed. # local path = $(1:G=) ; local components ; # $(path:D) for "/" is "/". Therefore the second condition. while $(path:D) && $(path:D) != $(path) { # Note: $(path:B) returns "." for "..", but $(path:D=) is fine. components = $(path:D=) $(components) ; path = $(path:D) ; } components = $(components) ; # Use this to return initial / #components = $(path) $(components) ; return $(components) ; }