I need to copy a few files to another directory. The source structure is as follows
src/foo1.h
src/foo2.h
src/bar/foobar.h
I need to copy these so they end up here
/usr/include/foo/foo1.h
/usr/include/foo/foo2.h
/usr/include/foo/bar/foobar.h
In Linux I use cp -u --parents *.h bar/*.h /usr/include/foo
from src
, which works great. However, I can't find a suitable replacement in Mac OSX - cp
doesn't support parents
or an equivalent option, and install
supports -d
which is supposed to preserve the structure, but gives me the following error: install: foo1.h exists but it's not a directory
I'm stuck. Any ideas?