Questions tagged [makefile-mode]

12 questions
11
votes
3 answers

Customizing indentation in makefile mode?

In my makefiles, I prefer the following indentation for continuation lines: FILES:= \ file1.cpp \ file2.cpp \ fileYetAnother.cpp LIBS:= \ libsth1.so \ …
Mekk
  • 1,017
  • 7
  • 14
6
votes
1 answer

Why are leading spaces colored before comments in makefile-mode?

In Makefile mode, leading spaces are fontified in makefile-space face (bright pink without customization), when there is no other text on the line. It seems to indicate incomplete lines, and makes sense for that. The color gets back to white when…
Nikana Reklawyks
  • 322
  • 4
  • 15
4
votes
0 answers

How to make indent-region keep the TAB in Makefile buffer?

A very simple Makefile: all: gcc -o hello hello.c And I already set: (add-hook 'before-save-hook '(lambda () (delete-trailing-whitespace) ;; indent the whole buffer before-save (when (derived-mode-p…
CodyChan
  • 2,599
  • 1
  • 19
  • 33
3
votes
1 answer

How to have emacs recognize Makefile as a prefix for makefile-mode?

I figured the following would tell emacs to recognize files starting with "Makefile" and start makefile-mode: (add-to-list 'auto-mode-alist '("\\`Makefile" . makefile-mode)) The \\` indicates the start of the string. This doesn't work though. Can…
ana
  • 183
  • 5
3
votes
0 answers

Indentation in makefile: alignment in multi-line assignments

What is the best solution for writing Makefile, GNU Makefile specifically? For example: FILES:= file0.cpp \ file1.cpp \ file2.cpp \ fileYetAnother.cpp After typing the first \(or after saving the…
CodyChan
  • 2,599
  • 1
  • 19
  • 33
2
votes
2 answers

Bind the make command to a shortcut

I use Emacs under Ubuntu. I would like to bind the make command to a shortcut, so that makefile could be launched. If the compilation fails, I would the error message to be shown in a sub-window or the message bar; otherwise, I would all the…
SoftTimur
  • 121
  • 2
1
vote
0 answers

Automatically change ediff-diff-options based on buffer mode of targets

I use ediff all the time and have ediff-diff-options set to -wBb. This works most of the time but I've gotten burned diff-ing some Python scripts and the occasional makefile since whitespace matters there. Anyone have some code that would…
David R
  • 21
  • 3
1
vote
1 answer

extend/customize Makefile syntax table

I work with a Makefile-like infrastructure that allows having lists as variables and appending values to them. For this, the += operator is used. However, I'm having incorrect highlighting using this operator. The + is being highlighted as part of…
Felipe Lema
  • 737
  • 3
  • 11
1
vote
0 answers

Smarter compile in emacs

I often got to work with projects organized as follows: src/ include/ ... Makefile Is there a way to teach emacs' "compile" function to always use that top-level Makefile regardless which file I'm editing in the current buffer? For example it can be…
god
  • 266
  • 1
  • 8
0
votes
0 answers

Tab is not inserted when indent-line-function is defined

I defined indent-line-function variable for Makefile corresponding to the problem referred in the link. But when this configuration is activated, pressing TAB key does not insert tab letter at the point. How can I fix it ? Following is from my…
hotoku
  • 1
  • 1
0
votes
1 answer

Makefile layer in spacemacs

I've searched all over internet, but couldn't find how can I invoke make from spacemacs with a keybinding (not in shell window). All I found was this: @agriffis on gitter said the following Aron Griffis @agriffis Nov 03 2016 22:07 I'm editing…
Asalle
  • 113
  • 4
-1
votes
1 answer

How to compile makefile files for newbies

I just got cloned a piece of software and the download folder looks like this: What I am to do next to compile this piece of software? Thanks!