RSS

 
WinEdt Macro Library  | program previous macro  | next macro

Compile Tools

Description

This is a set of tools for compiling code in different programming languages (such as C, C++, Fortran and I hope some others but I don't have the compilers)

The final menu will have the following commands (macros):

Tools

Compile Document
Works on current file (%p\%n%t)
In order to use the other tools you need bo build a Tree. Since the compiler should not recognize the different components as part of the same file a dummy include directive should be used (possibly inside comments).
Build All
Compile all files and link objects to build executable.
Build Executable
Compile only necessary and build if any file has changed.
Execute program
Check if source code has changed and ask for rebuild. After that it executes the program.

Compiler Managing

Select Compiler
Select compiler from the list stored in compiler.edt (do not edit!). Observe that if mode-dependent configurations are defined. Only those compiler defined for the present mode will be available.
Add compiler
Add a new compiler. The configuration file has to be defined independently
Remove compiler
Remove an existing compiler
Add Customized Compiler
Permits (via MUI) define a new compiler and create the corresponding configuration file. For removing such compiler use the Remove Compiler as usual.

Requirements

This set of macros requires the "Configuration Section reader macro" cfgSectionReader.edt and (for full use) the new MUI plugin.

Installation Instructions

Uncompress the zip file in %B\Macros\program.

The simple _compileTools_install.edt will append the menu for using the macros to the accessories menu.

Configuration

You have to configure the compiler and linker that you want to use through a configuration file or through the (friendlier) Customize New compiler menu (requires the MUI plugin). In any case you have to know the command line of your compiler. If you have different configurations for different modes (more specifically if exists the folder %B\Config\YourMode, where YourMode is Fortran, C, Java or some other that you define) the configuration file will be located in such folder. Otherwise it will be located in %B\Macros\program (see below).

The set has also got included a configuration file for gnu Fortran (gnu_77) as an example.

If you use the New Customized compiler command (via MUI) the configuration file is created automatically. Every compiler installed is retained in a file called compiler.edt (that in principle should not be edited). If you have a configuration folder (%B\Config\FolderMode) for the mode that the compiler is defined for (C, Java, Fortran, etc) the compiler.edt file will be located in such folder. Otherwise it will be located in %B\Macros\program.

Download

compileTools.zip

Additionally:
cfgSectionReader.edt
mui.zip

Macro contributed by Juan Fiol <fioljumr.edu>.

WinEdt Macro Library  | program previous macro  | next macro