makefile-mode

makefile-mode is an interactive autoloaded compiled Lisp function in `make-mode.el'.


(makefile-mode)

Parent mode: `prog-mode'.

Major mode for editing standard Makefiles.

If you are editing a file for a different make, try one of the
variants `makefile-automake-mode', `makefile-gmake-mode',
`makefile-makepp-mode', `makefile-bsdmake-mode' or,
`makefile-imake-mode'. All but the last should be correctly
chosen based on the file name, except if it is *.mk. This
function ends by invoking the function(s) `makefile-mode-hook'.

It is strongly recommended to use `font-lock-mode', because that
provides additional parsing information. This is used for
example to see that a rule action `echo foo: bar' is a not rule
dependency, despite the colon.

key binding
--- -------

C-c Prefix Command
ESC Prefix Command

C-M-i completion-at-point
M-n makefile-next-dependency
M-p makefile-previous-dependency

C-c C-b makefile-switch-to-browser
C-c C-c comment-region
C-c C-f makefile-pickup-filenames-as-targets
C-c TAB makefile-insert-gmake-function
C-c RET Prefix Command
C-c C-p makefile-pickup-everything
C-c C-u makefile-create-up-to-date-overview
C-c C-\ makefile-backslash-region
C-c : makefile-insert-target-ref

C-c RET C-a makefile-automake-mode
C-c RET C-b makefile-bsdmake-mode
C-c RET C-g makefile-gmake-mode
C-c RET TAB makefile-imake-mode
C-c RET RET makefile-mode
C-c RET C-p makefile-makepp-mode



In the browser, use the following keys:

key binding
--- -------

C-c Prefix Command
C-n makefile-browser-next-line
C-p makefile-browser-previous-line
SPC makefile-browser-toggle
I makefile-browser-insert-selection-and-quit
i makefile-browser-insert-selection
n makefile-browser-next-line
p makefile-browser-previous-line
q makefile-browser-quit

C-c RET makefile-browser-insert-continuation



Makefile mode can be configured by modifying the following variables:

`makefile-browser-buffer-name':
Name of the macro- and target browser buffer.

`makefile-target-colon':
The string that gets appended to all target names
inserted by `makefile-insert-target'.
":" or "::" are quite common values.

`makefile-macro-assign':
The string that gets appended to all macro names
inserted by `makefile-insert-macro'.
The normal value should be " = ", since this is what
standard make expects. However, newer makes such as dmake
allow a larger variety of different macro assignments, so you
might prefer to use " += " or " := " .

`makefile-tab-after-target-colon':
If you want a TAB (instead of a space) to be appended after the
target colon, then set this to a non-nil value.

`makefile-browser-leftmost-column':
Number of blanks to the left of the browser selection mark.

`makefile-browser-cursor-column':
Column in which the cursor is positioned when it moves
up or down in the browser.

`makefile-browser-selected-mark':
String used to mark selected entries in the browser.

`makefile-browser-unselected-mark':
String used to mark unselected entries in the browser.

`makefile-browser-auto-advance-after-selection-p':
If this variable is set to a non-nil value the cursor
will automagically advance to the next line after an item
has been selected in the browser.

`makefile-pickup-everything-picks-up-filenames-p':
If this variable is set to a non-nil value then
`makefile-pickup-everything' also picks up filenames as targets
(i.e. it calls `makefile-pickup-filenames-as-targets'), otherwise
filenames are omitted.

`makefile-cleanup-continuations':
If this variable is set to a non-nil value then Makefile mode
will assure that no line in the file ends with a backslash
(the continuation character) followed by any whitespace.
This is done by silently removing the trailing whitespace, leaving
the backslash itself intact.
IMPORTANT: Please note that enabling this option causes Makefile mode
to MODIFY A FILE WITHOUT YOUR CONFIRMATION when "it seems necessary".

`makefile-browser-hook':
A function or list of functions to be called just before the
browser is entered. This is executed in the makefile buffer.

`makefile-special-targets-list':
List of special targets. You will be offered to complete
on one of those in the minibuffer whenever you enter a `.'.
at the beginning of a line in Makefile mode.