I want to post a question with a significant chunk of Makefile code, but the preview given from my code isn't very exciting, and it highlights seemingly random words here and there.

The seemingly-authoritative What is syntax highlighting and how does it work? doesn't list Makefile as a supported language, but https://github.com/google/code-prettify does. There is an existing makefile tag. Is it possible to add support for the Makefile language to the Stack Exchange servers' instance of Google Code Prettify?

  • are you sure there is a specific prettifier for Make - files? Because I can't find an explicit implementation for that in the GitHub repo. Did you try, surrounded by empty lines, this <!-- language: lang-default --> before your code block to see how it looks?
    – rene
    Commented Jan 30, 2017 at 12:53
  • What tags did your question have? Commented Jan 30, 2017 at 22:35

1 Answer 1


Now that Stack Exchange moved to Highlight.js lang-makefile is definitely supported (it might already have been supported on prettify earlier but I didn't intend to make this answer an accurate historical recollection of facts).

And here is an example makefile, taken from the answer on What is the purpose of .PHONY in a Makefile? from user Eli Bendersky

.PHONY: clean
  rm -rf *.o

This is the markup of above snippet:

    .PHONY: clean
      rm -rf *.o
  • 1
    I can confirm that makefile is present in the highlight-loader.js file on the dev CDN.
    – Luuklag
    Commented Nov 11, 2020 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .