Well, that process is named Build
process using a makefile
. Because UEStudio is an IDE and not just a text editor it has the feature to create on the fly a makefile (batch file) next executed when you execute the command Build
from the toolbar, the menu or by hotkey. The command Compile
makes only the first step of a build process, it compiles the current file to an object file.
So instead of your user tools it would be best to create a config file containing all your commands to be able to use the commands Compile
. With the config file you define the commands
required to compile a file with extension .C using a C/C++ compiler first for example to an assembler file with extension .SRC compiled next with an assembler to an object file. You define in the config file also which commands are necessary to compile a file with extension .ASM to an object file. And so on for every other file type.
Further you define in the config file which additional commands are necessary to link and locate all the object files together to an application or library. For embedded firmware further commands can be specified for the Build process to create Intel HEX files or files for a debugger/emulator after successful link/locate, or even upload and program the just created firmware into the target device, or start the debugger with the just created output, or whatever you want to do after successfully "building" the output. The build process is smart enough to first check if the object file for a source code file already exists or not and when it exists, if the file date of the object file is newer than the file date of the source code file. If object file for a source code file is present and newer than source code file, then this file must not be compiled again and next project file is evaluated next.
The Rebuild process is the same as the build process with only 1 difference, all object files are deleted first which results automatically in compiling all source code files again to object files.
So my first suggestion is to take the time and look into existing config files of UEStudio and help of UES and try to create such a config file using the commands you have already defined as user tools. That makes it later possible to use the commands compile, build and rebuild for all your projects without the need to adapt something all time for your various projects using the same tools.
But if you want to use your existing project tools to create on the fly your own makefile
you have to develop a script (or macro, but script is better). It is possible to call user and project tools from within a script. It is also possible to get a list of project files from within a script using my function GetListOfFiles
. So you have the possibility to write a script which first gets a list of project files, and next run your tools on each file depending on your own rules packed as code into the script.
But there is one big difference between using a config file in UES and its ability to create a makefile for a build process and execute it in comparison to your own makefile using a script: the build process is 1 batch job and all the output to stdout and stderr devices of all the console tools executed within this batch job is captured and displayed in the output window for easy evaluting the result of the build process and fix mistakes in source code. When using a script and calling each project tool from within the script on every project file the output window contains only the output of last called project tool. Also the script interpreter writes by default to the output window. It would be possible to collect all the tool outputs by the script itself because from within a script you have access to content of output window, and as final step write all the collected outputs of the tools at once to the output window. But all that needs a lot of script coding and without knowing your tool chain I think it would be really easier to create a config file and let UES do the job for creating and executing the makefile according to the commands you have defined in the config file.
I have written here for C/C++ projects with assembler files because I think you are also a programmer. But in general a config file could be used for everything. For example it can be used to define commands to convert with command "compile" the active file with an UE script or UE macro executed in a separate instance of UE/UES, or console application, or vb script or whatever executable from format A to format B. The build process would than do that for all project files. You always have to take into account that a config file is just a set of rules how to build a batch file (script). It is up to you what the batch file named makefile
contains and therefore what happens.