You you handle it via dependencies we have the %/ pattern rule so all you need to do is make $(testdata)/ the dependency. In other places we just use $(make-target-directory) as first command.