cancel
Showing results for 
Search instead for 
Did you mean: 

Automate make command in Touchgfx environment.

FShai.11
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

3 REPLIES 3
Martin KJELDSEN
Chief III

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
Associate II

Thank you that really helped.

Martin KJELDSEN
Chief III

No problem! :)