I sort of like this. I wonder if it is enforceable.
"For my friends everything, for my enemies the law" software license.
Why would it not be enforceable? If you own the copyright on your software anybody that wants to use it has to get a license from you. The traditional way is for you to sell those licenses for money, but you could also decide to give them away based on how much you like the buyer.
Or a hybrid, sell them, but refuse to sell to certain entities and discount up to 100% to others based on how much you like them.
Of course it is, that’s literally contract law. You’re agreeing a contract to licence them access with specific terms.
The reason they invented the standard licences is to avoid this cost and effort. Do you really want to write a 200 page legal contract for every user for software you’re giving away for free?
> I wonder if it is enforceable.
I can't imagine that it wouldn't be. If a company has explicit written permission from the copyright owner granting permission to use that copyright, then they can use it.
Also, it wouldn't be a special license. If you wanted to do a "For my friends everything, for my enemies the law" thing, you'd just set it as all rights reserved and add special note encouraging people to ask for permission to use it.
Plus, copyright enforcement typically goes in the other direction. It's not about who you can sue, it's about who you can't. Licenses are just a way of specifying who you cannot sue. If you want everybody to use your project but don't want to bother with a license, you can make it all rights reserved (the legal default) and just not sue anybody. You could sue them if you wanted to (which is why nobody would ever use your code: because of the risk that you change your mind and sue them), but nobody is forcing you to.