You can read about it here:
Hey, if our troops are in violation of the US-Turkey status of forces agreement, the NATO Charter, and/or international law, wouldn't it be legal for Turkey to do such a thing?
Legal - maybe. Smart - no. But since the EU has continued to rebuff Turkey, why not go for it?
After all, we have the almighty dollar ... but they have their god.