toolboxmake.txt Make Tool July 23 2015
Make Tool toolbox-make
Plug-in version 1.1
for Vim version 7.0 and above
Wolfgang Mehner <wolfgang-mehner at web.de>
The Make tool offers minimal make functionality, such as running make with the
makefile located in a different directory. The make command is run by using
the :Make command, which has command-line completion for make targets.
0. TABLE OF CONTENTS toolbox-make-contents
1. Introduction |toolbox-make-intro| 2. Commands |toolbox-make-commands| 2.1 API |toolbox-make-api| 3. Configuration |toolbox-make-config| A. Change Log |toolbox-make-change-log|
1. INTRODUCTION toolbox-make-intro
Make is run using the ex-command |:Make|. Command line arguments can either be given directly,:Make -j3
:Make clean
or specified by using |:MakeCmdlineArgs|. Arguments given to :MakeCmdlineArgs are passed on to make every time :Make is called without arguments. This feature can be used to "memorize" complicated argument lists which have to be passed to make repeatedly. Even if an argument list has been memorized, :Make can always be called with other arguments to disregard the memorized list. A call to :MakeCmdlineArgs without arguments clears the memorized argument list. By default, :Make runs in the current working directory and therefore uses the local makefile. The command |:MakeFile| sets a specific makefile, which is used every time, even when :Make is call in a different directory. This makes it possible to use the tool for larger projects, which are organized in multiple directories. The specified file is used until another is chosen or the default behavior is restored by calling :MakeFile without arguments. Whether or not the makefile is set by :MakeFile, the :Make command has command-line completion for the targets. Command Short Description ---------------------------------------------------------------------------- |:Make| [<args>
] run make with the given arguments |:MakeCmdlineArgs| [<args>
] memorize cmd. line arguments for make |:MakeCmdlineArgs|! echo memorized cmd. line arguments |:MakeFile| [<file>
] choose a makefile |:MakeFile|! echo the current makefile |:MakeHelp| help for the Make tool |:MakeSettings| shows the plug-in settings ---------------------------------------------------------------------------- Detailed explanations are given in the next section |toolbox-make-commands|.
2. COMMANDS toolbox-make-commands
This chapter provides detailed explanations of all the commands.
:Make
:Make [<args>
]
Runs make with the given arguments. If no arguments are given, uses the ones
specified with |:MakeCmdlineArgs|, which can be an empty argument list as well.
Uses the local makefile, unless a makefile has been chosen using |:MakeFile|.
The command has command-line completion for the targets of that makefile.
If the tool is not working properly, prints the reason.
:MakeCmdlineArgs:MakeCmdlineArgs [
Sets command line arguments for :Make. If make is called without arguments, these "memorized" arguments are used. The command can be called without arguments to delete the memorized argument list.<args>
]:MakeCmdlineArgs!
Echoes the currently memorized arguments on the command line.
:MakeFile:MakeFile [
Sets the makefile. If a specific file has been selected, it is always used, independent of the current working directory. If the makefile has not been chosen, or reset by calling :MakeFile without arguments, the makefile in the current working directory is used.<file>
]:MakeFile!
Echoes the current makefile on the command line.
:MakeHelp
:MakeHelp
Opens the help for the Make tool.
:MakeSettings:MakeSettings
:MakeSettings!
Shows the plug-in settings. The second version is verbose.
2.1 API toolbox-make-api
The Makefile and command-line arguments can be set via an API. This allows for setting up the configuration via a script.
mmtoolbox#make#Property() The Makefile and command-line arguments can be set using:mmtoolbox#make#Property ( mode, key [, value] )
Parameters: mode - "echo", "get" or "set" (string) key - the name of one of the properties (string) value - the new value of the property, only with mode "set" (string, optional) Returns: value - the current value of the property, only with mode "get" (various) The property is one of the following: "enabled" - non-zero if the tool is enabled (integer, no "set") "cmdline-args" - the memorized command-line arguments (string) "makefile" - the name and location of the makefile (string) To set the makefile for a project, use:call mmtoolbox#make#Property ( "set",
\ "makefile", "$HOME/Projects/MyProject" )
To always run three jobs in parallel:call mmtoolbox#make#Property ( "set", "cmdline-args", "-j3" )
3. CONFIGURATION toolbox-make-config
The tool is configured via a number of global variables, which can be set in the .vimrc file. Variable Default Description and further information ---------------------------------------------------------------------------- |g:Make_Executable| 'make' the make executable ----------------------------------------------------------------------------
g:Make_Executable
The executable is set by g:Make_Executable:
let g:Make_Executable = 'make'
A. CHANGE LOG toolbox-make-change-log
RELEASE NOTE
S FOR VERSION 1.1
- Add: Command-line completion for Make targets. - Minor changes.
RELEASE NOTE
S FOR VERSION 1.0.3
- Internal changes, less global functions. - Minor changes.
RELEASE NOTE
S FOR VERSION 1.0.2
- Minor changes.
RELEASE NOTE
S FOR VERSION 1.0.1
- Added: Command :MakeSettings to show the configuration. - Minor changes.
RELEASE NOTE
S FOR VERSION 1.0
- Initial upload.
vim:tw=78:expandtab:ts=2:ft=help:norl:
Generated by vim2html (modified) on So 14. Aug 17:16:25 CEST 2016