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 buffer), and ENTER
, I want the file1.cpp to align with the file0.cpp, do not mind the \
at the end of each line, I can use align-regexp
to align all of them after finished.
But it turns out this by default:
FILES:= file0.cpp \
file1.cpp \
file2.cpp \
fileYetAnother.cpp
I know I can define my own indentation like Customizing indentation in makefile mode?, but it will fix the indentation to number like 4, that is not smart for different situations, what if the FILES
word is long.
Besides it does not work for:
all:
gcc ...
I have to type C-q TAB
to indent the gcc ...
line.
Another problem for this kind of situation, by default, if you keep typing TAB
below the all:
line and then type the real commands for all
, Emacs will keep inserting Tab
when typing TAB
, AFAIK, it must be 8 spaces (a Tab
exactly) at the beginning of the command line after all
, so typing multiple typing-TAB
s should only remain one TAB
.
Is there any package to handle all the messed up format in the Makefile, or you just do that manually?
TAB
to just insert a tab character inmakefile-mode
. That's what I am doing.