Copy file with path preserved on Linux

find . -name '*.[chp]*' -exec cp --parent {} ~/codes \;