How to build an external module in a specified directory?