editing Makefile in Xcode editor

I want to edit a Makefile using the Xcode editor (part of my project). I can create and edit the file, but Xcode seems to assume it’s a Swift file — it applies Swift syntax highlighting, and I get incorrect suggestions while editing.

I tried changing the “Open As” option from “Source Code,” but there’s no “Plain Text” option available.

I’m using Xcode 16.4.

I’ve seen suggestions like: • Using an external editor (which works, but feels clunky), • Renaming the file to something like Makefile.txt (but that breaks standard CLI use, e.g. make expects Makefile).

Not too happy with either workaround — did I overlook a proper way to just edit a Makefile in Xcode without confusion?

Any suggestions appreciated!

Thanks, Lourens

Answered by DTS Engineer in 858151022

One thing to look at is if the type of the file is set to makefile in Xcode. You can find that in the File Inspector, pictured here.

— Ed Ford,  DTS Engineer

Looks fine here.

Accepted Answer

One thing to look at is if the type of the file is set to makefile in Xcode. You can find that in the File Inspector, pictured here.

— Ed Ford,  DTS Engineer

Thanks for the comments/answers.

I assumed that the type of file should be set by the "Open as" context menu. But, I now understand to use the file inspector to set the type. I still have a bit of an issue that in one of my projects, the editor aggressively suggests text completion with swift entities.

editing Makefile in Xcode editor
 
 
Q