What is the simplest code to get the top-level directory part of a makefile variable? Example:
BUILD_DIR = dir/subdir/.../sub-a-dub-dir distclean: rm -rf <some code which evaluates to "dir" from $(BUILD_DIR)>
PS: I don't mean
$(dir $(dir $(BUILD_DIR))), but something which gets the first directory part of any variable value.