Well, as you have your own makefile, you do not really use the capabilities of UEStudio for creating a makefile for all files of a project according to selected compiler and the editable configuration for this compiler.
So you can make the build or rebuild simply by
- creating 1 or more project tools via Advanced - Project Tool Configuration,
- assign the project tools to hotkeys you like at Advanced - Configuration - Key Mapping (commands AdvancedProjectToolx) and
- add them to a customized toolbar for a quick execution by key or mouse click via right clicking on a toolbar, left clicking on context menu item Customize Toolbar, and adding User Project Tool x to an existing toolbar or a new toolbar.
Before customization of a toolbar I suggest to use
View - Layouts - Layouts and use
Save current state as to store entire current layout with a custom name which is in future never updated automatically on first start of UEStudio after an upgrade (which of course means new commands of new UEStudio must be also added manually to menu/toolbars of a custom layout after upgrade).
But after playing around with compiler configuration I can offer also an alternate solution for using a predefined makefile instead of a makefile created by UEStudio and use nevertheless the built-in commands for build and rebuild.
- Open the UEStudio project you have already configured for your project.
- Open Build - Select Compiler.
- Select right compiler and configuration (application, library, ...) if not already done.
Well, in your case with a predefined makefile the configuration does not really matter as the makefile defines what is build and how. So also all the compiler options do not matter, except on using command compile to just compile a single file.
- Click on button Edit configuration.
- Click on button Make configuration local (save in project directory).
Hint: Pressing key F1 opens the help page for the Select Compiler dialog with the possibility to edit the configuration. On this help page there are links to other help pages explaining the various groups in configuration (not too deeply).
- Of interest here is the group [General] as there can be configured a different make tool than mymake.exe in program files directory of UEStudio.
- Insert a line with
MakeTool = MyMakeTool.bat
- Click on buttons Save configuration and OK.
So far so good.
But what should
MyMakeTool.bat contain and why is it specified without full path?
As I have never tried this before I needed one to find out an answer on that question and the others below and write this post.
I have the batch file first specified with full path on my trials. But this resulted always on execution of a build in the error message
Cannot find make utility 'C:\Temp\MyMakeTool.bat'. Built-in make utility will be used
output in the output window of UEStudio. As you can imagine, I was astonished to see that message as the file was definitely in this directory. I found out with free tool Process Monitor of Sysinternals that UEStudio does not even try to access this file.
Therefore I had the idea to specify the batch file without path in the compiler configuration. This time I could see in log of Process Monitor that UEStudio tries to find the batch file first in directory of project set in
Project - Project Settings for
Project directory as this is always the current working directory on starting a compile, build or rebuild, and next in all directories specified in environment variable
PATH.
So I knew now where I have to put
MyMakeTool.bat. I put it into the project directory which is for my project a subdirectory
UEStudio in real project directory as I don't like it if IDE files and all the object files are mixed with the source and header files of the project.
But which parameters does UEStudio pass to the make tool on build and rebuild?
This was easy to find out as I needed just to add into the batch file following commands:
Code: Select all
@echo off
echo Make tool parameters: %*
On execution of a
build I could see now in output window
/f ProjectName.mak ALL
and on execution of a
rebuild
/f ProjectName.mak CLEAN ALL
Okay, I thought now that I know which command is necessary to use a fixed make file with
mymake of UEStudio. I just need to replace second parameter and use in batch file just the single line
Code: Select all
@"%ProgramFiles(x86)%\IDM Computer Solutions\UEStudio\mymake.exe" /f "Custom makefile with full path" %3 %4
or use
Code: Select all
@echo off
copy /Y "Custom makefile with full path" "%~2">nul
"%ProgramFiles(x86)%\IDM Computer Solutions\UEStudio\mymake.exe" %*
But to my surprise this resulted in two error messages on execution of a build:
don't know how to make '/f'
don't know how to make 'hex2chex.mak'
So it was obviously that UEStudio does not call
mymake.exe with those parameters by default. It does this only on running a configured other make tool.
You most likely use your own make tool in the batch file. But I wanted to know how
ProjectName.mak is passed to
mymake.exe by UEStudio. I executed
mymake.exe from command line and indeed it does not support any parameters to specify the makefile to use. So it was clear for me that the file name of the makefile must be passed via environment variable.
I added to my batch file now additionally the command
set and executed again a build. Comparing the list of environment variables in output window of UEStudio with the output of
set executed in a command prompt window showed my what UEStudio defines before running a build or rebuild for my small test project using DJGPP compiler.
Code: Select all
#UE#FNI#=
CTAGSDEFEXT=h
DJGPP=C:\Compiler\DJGPP\DJGPP.ENV
INCLUDE=C:\Compiler\DJGPP\include
LIB=C:\Compiler\DJGPP\Lib
MYMAKESTOPAT=3
Path=C:\Compiler\DJGPP\BIN;C:\Program Files (x86)\IDM Computer Solutions\UEStudio\;%PATH%
UeApp=UEStudio
UEHELPATH=C:\Program Files (x86)\IDM Computer Solutions\UEStudio.chm
UESDlgAct=|1C0374|20039C|1D0364|140548
UESMAKEFILE=ProjectName.mak
UESMMTO=0
UESMode=Release
UESNOCMD=0
uespawnAct=
uespawnDbg=
uespawnPrj=ProjectDirectoryPath\ProjectName.prj
UESPropEffect=
UESUSF=tag4E871509%d
It is easy to see that environment variable
UESMAKEFILE is used to pass the name of the make file from UEStudio to
mymake and just
%3 %4 must be passed as parameter.
So to use a custom makefile with
mymake of UEStudio the batch file needs to contain either
Code: Select all
@echo off
copy /Y "Custom makefile with full path" "%~2">nul
"%ProgramFiles(x86)%\IDM Computer Solutions\UEStudio\mymake.exe" %3 %4
or even better
Code: Select all
@echo off
set "UESMAKEFILE=Custom makefile with full path"
mymake.exe %3 %4
You can of course specify in the batch file a different make tool instead of using
mymake of UEStudio.
By looking on environment variable
PATH really used during build/rebuild I understood now also why the developers of UEStudio expect the name of the make tool without full path. A custom make tool is usually in the same directory as the used compiler. The directory path to the binaries of the compiler is the first directory in environment variable
PATH on build/rebuild. So there is no need to specify the make tool with full path especially if the project should work independent on environment of used computer, i.e. in which directory the compiler and its tools are installed.