Compiling Selected Files and Directories

Compiling Individual Files or Directories

After choosing and configuring the compiler, follow the steps below to compile a group of files or directories:

1. Select the desired files or directories in NetBeans Explorer, highlighting their names.

2. From the Build menu or the Explorer popup menu, select Compile or Build.

Selecting a directory complies all the source files within that directory. Choosing Compile or Build will not compile any files contained in subdirectories of the selected directory.

 

explorer_file_selector.png

 

The Compile option performs an up-to-date check on the selected file before invoking the compiler. If the selected source file has already been tokenized, and the tokenized file has a more recent date than the source file, then the source file will not be compiled again. The system considers the work already completed. The Build option does not perform an up-to-date check on the file. The source file will be compiled regardless of the status of an already existing tokenized file. If a tokenized file is already present, it will be overwritten.

 

Recursive Compiling of Directories

Recursive compiling refers to the process of compiling not just the files in a single directory, but also all the files in all the subdirectories of the selected directory. To perform recursive compiling of a directory:

 

1. Select the directory in the NetBeans Explorer so that its name is highlighted.

2. From the Build menu or the Explorer popup menu, choose Compile All or Build All.

 

All files in the originally selected directory are submitted to the compiler in a group, followed by the files of each of the subdirectories in turn. If an output directory was specified in the compiler options, the subdirectories of the top-level directory will be mirrored under the output directory. The resulting output tree structure will exactly parallel the directory tree containing the source files.

Compile All performs recursive compiling of directories while performing an up-to-date check on each of the files contained in them. Build All performs recursive compiling without performing an up-to-date check.