I think the "notdir" make function does the same than "shell basename" and is probably faster. see http://www.gnu.org/software/make/manual/make.html#File-Name-Functions

also, you use it a lot, maybe it's a good idea to set it as a shell variable at the start of your recipe here