Add logic to compile directory.