The .NET Compact Framework is a subset of the full .NET Framework with some additional niceties for mobile development. If you want to compile a library for Windows and Windows Phone, you need to build your code for each platform.
You can still leverage much of the same code you used for your .NET library, but you will need to use preprocessor symbols and conditional compilation to exclude functionality for the desktop (or phone) that is not supported in the other framework.
To do this: create two projects. One project will contain all of your files targeted for the desktop framework. The other will contain linked versions of your files for the compact framework. You can define symbols in each project in order to trigger conditionally compiled blocks of code.
This means that any investment you have already made in .NET will be easily translated into the Windows Phone world, but you also want to be sure that the performance characteristics of your library will be easily supported by a less-powerful device.
Best of luck!