Modify 'generate' to support multiple targets