Skip to main content
FShai.11
Associate
May 4, 2020
Solved

Automate make command in Touchgfx environment.

  • May 4, 2020
  • 3 replies
  • 1117 views

I want to automate the process of "make" command using a batch file or whatever way convenient. Is it possible to send command to touchgfx environment using batch script ? Or write a batch script in touchgfx environment.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

For batch, try something like this - Let's call it `mingwexe.bat`:

@echo off
setlocal
set root=%~dp0
set PATH=%root%env\MinGW\bin;%root%env\MinGW\msys\1.0\bin;%root%env\MinGW\msys\1.0\Ruby193\bin;%root%env\MinGW\msys\1.0\gnu-arm-gcc\bin;%PATH%
echo "%root%env\MinGW /mingw" > %root%env\MinGW\msys\1.0\etc\fstab
 
set _first=%1
set _all=%*
call set _tail=%%_all:*%2=%%
set _tail=%2%_tail%
 
if exist %_first% (
 cd %_first%
 %_tail%
) else (
 cd %root%
 %_all%
)

And call with something like:

mingwexe.bat make -f simulator/gcc/Makefile

This is pretty similar to what we do in our build environment on windows agents. Or, you can set up your windows path to include the PATH defined in the above script and avoid the batch script (makes it less portable).

/Martin

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 4, 2020

For batch, try something like this - Let's call it `mingwexe.bat`:

@echo off
setlocal
set root=%~dp0
set PATH=%root%env\MinGW\bin;%root%env\MinGW\msys\1.0\bin;%root%env\MinGW\msys\1.0\Ruby193\bin;%root%env\MinGW\msys\1.0\gnu-arm-gcc\bin;%PATH%
echo "%root%env\MinGW /mingw" > %root%env\MinGW\msys\1.0\etc\fstab
 
set _first=%1
set _all=%*
call set _tail=%%_all:*%2=%%
set _tail=%2%_tail%
 
if exist %_first% (
 cd %_first%
 %_tail%
) else (
 cd %root%
 %_all%
)

And call with something like:

mingwexe.bat make -f simulator/gcc/Makefile

This is pretty similar to what we do in our build environment on windows agents. Or, you can set up your windows path to include the PATH defined in the above script and avoid the batch script (makes it less portable).

/Martin

FShai.11
FShai.11Author
Associate
May 4, 2020

Thank you that really helped.

Martin KJELDSEN
Principal III
May 4, 2020

No problem! :)