recursively compile used fragments