This question already has an answer here:
I want to create a commercial application, but I want to make a significant portion of my back-end open source. It applies some really interesting math that I want people to learn from, but I don't want others to take that back-end code and start selling it. As a result, I'd like to license that back-end code under either the GPL or RPL (I'm not sure which one yet).
These licenses prevent people from distributing software using code licensed other these licenses without making its code open-source. I don't want to make my entire program open-source, just that part of it.
Does licensing part of my own software force me to release the rest of my software under the GPL/RPL? If it does, will anyone actually enforce it?