Friday 23 January 2015

Edit Makefile in Intellij

My projects now tend to use a lot of different tooling.
eg: Vagrant, docker, Node, Bower, CURL, ANT, Maven, Gradle and a bunch of other custom tools that I have to remember how to use. Worse still we are moving to mass production, so I will need to remember them across projects.

To solve this, I have recently started using Makefiles to aggregate all the command line stuff. Now I can store the rarely used commands and port them from project to project without needing to go and look them up again.

Anyway, I need to edit a Makefile in Intellij IDEA.
Easy right...

Nope, I now keep getting:
Makefile:17: *** missing separator.  Stop.

FYI: The Cause of this error: MAKE requires a TAB at the start of each command line, but Intellij has converted all TABs to multiple Spaces. You can change the Makefile to use space as indents, but it looks horrible.

Anyway, I found a few solutions, and this is mainly to remind myself. But if you happen to find this post and it helps, please let me know, or worse if it fails, do please let me know in the comments, as I will look into it.

Firstly, install the C/C++ plugin from the plugin repositories.
This adds Makefile syntax checking and highlighting.

Second: to sort out the tab converting syntax problem, open your Makefile and then...
EDIT -> Convert Indents -> To Tabs

FYI: to see the Spaces/Tabs, I used "Show Whitepaces", by...
HELP -> Find Action -> "Whitepace"
which shows the characters in the active editor.

4 comments:

  1. 1 extra point: add keyboard shortcuts to the 2 whitespace commands, that way modifying a file when you have 4 spaces instead of tabs takes 1 second.

    ReplyDelete
  2. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    vstkey.com
    PhpStorm Crack

    ReplyDelete
  3. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost

    the past 6 years, but I had no idea of solving some basic issues. I do not know how to

    Download Cracked Pro Softwares
    But thankfully, I recently visited a website named Crack Software Free Download
    All Pro Cracked Softwares Download
    PhpStorm Crack

    ReplyDelete