GNU shtoolshtool provides such a feature:
shtool mkshadow srcdir destdir Moreover, if your point is to make a shallow copy of a source directory into a build tree, you can distribute shtoolshtool with your source tree as it is a portable shell script (which provides many other facilities you might be interested in).