[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15. Editing Makefiles

This mode is used for editing Makefiles. It is automatically invoked for for buffers visiting the following types of files:

The mode knows about Makefile syntax and defines M-n and M-p to move to next and previous productions.

The keys $, =, : and . are electric; they try to help you fill in a macro reference, macro definition, ordinary target name, or special target name, respectively. Such names are completed using a list of targets and macro names parsed out of the makefile. This list is automatically updated, if necessary, whenever you invoke one of these commands. You can force it to be updated with C-c C-p.

The command C-c C-f adds certain filenames in the current directory as targets. You can filter out filenames by setting the variable makefile-ignored-files-in-pickup-regex.

The command C-c C-u grinds for a bit, then pops up a report buffer showing which target names are up-to-date with respect to their prerequisites, which targets are out-of-date, and which have no prerequisites.

The command C-c C-b pops up a browser window listing all target and macro names. You can mark or unmark items wit C-c SPC, and insert all marked items back in the Makefile with C-c TAB.

The command C-c TAB in the makefile buffer inserts a GNU make builtin. You will be prompted for the builtin's args.

The following key mappings are defined:

C-c << Prefix Command >>
M-n makefile-next-dependency
M-p makefile-previous-dependency
M-tab makefile-complete
M-C-i makefile-complete
C-c : makefile-insert-target-ref
C-c tab makefile-insert-gmake-function
C-c C-\ makefile-backslash-region
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 C-i makefile-insert-gmake-function
C-c C-p makefile-pickup-everything
C-c C-u makefile-create-up-to-date-overview

In the browser, use the following keys:

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
space makefile-browser-toggle
C-c << Prefix Command >>
C-n makefile-browser-next-line
C-p makefile-browser-previous-line
C-c return makefile-browser-insert-continuation
C-c C-m 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-p:
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.

To configure this package, type:

 
  M-x customize-group RET makefile RET

15.1 About Make  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.1 About Make

A Makefile is used by a `make' utility to automatically determine which pieces of a large program need to be recompiled, and to issue the commands to recompile them. See section `Top' in GNU Make Manual., for details.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.