There should be no special requirements for installation of this module as opposed to any other.
When the module is installed, makefiles present in the Filesystems
Explorer tab should be recognized as such and given a distinctive
icon. You can double-click them to open them
in the Editor (as plain text). The normal IDE UI mechanisms for compiling and
executing objects should work on them (e.g. F9 to compile, or check the
context menu, etc.); these actions simply run the appropriate targets in the
makefile.
The Execution tab of the property sheet holds information about the selected compilation and testing configuration of each executor, similar to that used by Java source files and other object types. The module installs a special compiler type and a special executor designed for makefiles, which are described in the following sections. These are the defaults for makefile objects; for more information on configuring such settings in general you are referred to the User's Guide regarding Service Types.
By default, files ending in common extensions such as *.mak
as
well as files with common names such as Makefile
will be recognized
as makefiles by the IDE. You may customize this algorithm under the property
sheet for the makefile object type under Global Options |
Object Types.
Using the Makefile Pseudo-Compiler
The Run a Makefile compiler type follows similar principles to
that used for external compilation of Java sources. You may configure the actual
process to run to launch make. This process can include the make command
you use, any switches it should have, and the name of the directory plus makefile
to run (or similar information; see the arguments key for details).
You may also configure the targets to be run in the makefile under different circumstances. These may be the name of a make target, or they may be left blank to use make's default target (normally the first one found in the makefile). There are three targets you may configure:
all
. This will be
run during the IDE command Compile.
rebuild
or
force
; not all makefiles do this sort of thing so the default is
to just use the default target and not really rebuild.
clean
; and in the IDE the Clean command.
Running compile on a makefile should run the proper target, and if make reports errors in a format the IDE can recognize (e.g. from Javac compilation) then these will be hyperlinked as usual when they appear in the Output Window. But errors may not be hyperlinked correctly if your makefile uses submakes or otherwise changes working directory from the directory the makefile itself lives in. See the ToDo file for ideas on how to fix this.
Caution: the makefile compiler type will be used if the IDE is
asked to compile a makefile. But if the IDE sees a file (e.g. Java source) that
could be handled by the makefile, it does not know this and trying to compile
such a file will run the IDE's normal direct compilation step--bypassing your
makefile. That is, you must initiate the compilation on the makefile itself, not
the source files. The ToDo list includes a description of what a solution to this
deficiency might look like, and what problems might need to be solved. In the
meantime, beware that if you have a package structure like this:
+ mypackage | + Makefile | + A.java | + B.java
mypackage
, this will not do what
you want! This is because the IDE will simultaneously try to run Javac
itself on the two source files, while also asking make to build its
default target (which typically would be the same thing). This could result in
the compiles interfering with each other, make becoming confused about
the status of its targets, etc. So do not do this. Suggestions:
test
, and would start e.g. a whole application
in a testing mode after making sure it is up-to-date.
Note that the arguments key includes the ability to use a target set in the
executor itself; and each individual makefile using that executor may also have
an alternate target (or NAME=VALUE
pairs, etc.) to be passed to the
make command, which may be set in its Arguments property in the
Execution tab just as for Java applications.
Information
Information, feedback, comments, etc. for this module: see
makefile.netbeans.org
.