Is Pres. Erdogan of Turkey alienating the U.S. and EU?

Why and how is Pres. Erdogan of Turkey alienating the U.S. and EU (which for many years has been its friend and has certainly invested billions of dollars into that country)?