The easiest way to create such a file is to save it under the name of Makefile
before you set the syntax of the new file to be Makefile
. Since the file is assumed to be plain text, it should accept the name with no extension and save it, and as soon as it’s saved the correct syntax is automatically applied and you’re good to go.
Apart from that, despite any protestations that MacOS might have about you renaming the file to not have an extension, it should be safe to do so if you’re used to working with Makefiles without any extension.
A bit of playing around shows that this behaves slightly differently based on the operating system that you use. Saving a file for the first time when it has a syntax set makes the Save dialog select an appropriate file type, which makes the OS suggest an extension to use for the file.
On Linux (at least my distribution), it accepts whatever I tell it, so it’s easy to make a file with no extension.
On Windows, if I just enter the filename Makefile
it seems to detect that I don’t have an extension on the file and adds .make
, but if I use the filename Makefile.
(trailing period), it leaves the file with no extension.
On MacOS, entering Makefile
ends me up with a Makefile.make
and using Makefile.
gets me a filename of Makefile..make
, which is even less helpful.
This all seems to point out that at some level what the eventual file name is set to is either controlled by the OS, or Sublime is following an OS specific rule to try and behave like other applications on the same OS would act.