How to automate the compilation