What is the difference between compileSdkVersion and targetSdkVersion?

What is the difference between compileSdkVersion and targetSdkVersion?