"Fossies" - the Fresh Open Source Software Archive

Member "sfk-1.9.6/scripts/xmake.bat" (22 Feb 2020, 3379 Bytes) of package /linux/misc/sfk-1.9.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) MS DOS Batch source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 @echo off
    2 rem XMake 0.5 - Cross network make of projects.
    3 rem Client script for the Windows command line.
    4 rem 
    5 rem Sync sources, compile remote, receive error output,
    6 rem forward compiled binaries to target device.
    7 rem requires:
    8 rem   sfk.exe on your Windows PC, download from
    9 rem     stahlworks.com/sfk.exe
   10 rem   xmakeserv.sh running on build server (which runs sfk)
   11 rem example call:
   12 rem   xmake.bat mp9 i686 200 clean
   13 rem   meaning: compile product mp9 for architecture i686
   14 rem            and target ip .200 from scratch (clean)
   15 
   16 rem === short parameters ===
   17 set PRODUCT=%1
   18 set TOOLCHAIN=%2
   19 set TARGET=%3
   20 set CLEAN=%4
   21 
   22 IF NOT "%TOOLCHAIN%"=="" GOTO haveparms
   23 
   24 echo "usage  : xmake product architecture targetip [clean]"
   25 echo "example: xmake mp8 bbb 192.168.1.100"
   26 echo "         xmake mp9 a13 192.168.1.200 clean"
   27 GOTO end
   28 
   29 :haveparms
   30 
   31 rem === dataway defaults ===
   32 rem = all source code is edited in: LOCAL_WORK
   33 rem = xmakeserv.sh runs on machine: BUILD_SERVER
   34 rem = file transfer uses password : TRANSFER_PW
   35 rem = your Windows PC running DView is  : LOG_TARGET
   36 rem = the target devices are in a subnet: TARGET_NET
   37 
   38 set LOCAL_WORKDRIVE=c:
   39 set LOCAL_WORKDIR=c:\work
   40 set BUILD_SERVER=192.168.1.101:2201
   41 set TRANSFER_PW=mycmdpw123
   42 set LOG_TARGET=192.168.1.100
   43 set TARGET_NET=192.168.1
   44 
   45 rem === internal inits ===
   46 rem = this batch file logs to DView by network text
   47 rem = (enable Setup / General / Network text).
   48 rem = file sync should be non verbose.
   49 rem = redirect output of some commands using TONETLOG.
   50 rem = sfk uses ftp password from SFK_FTP_PW.
   51 
   52 set SFK_LOGTO=term,net:%LOG_TARGET%
   53 set FTPOPT=-nohead -quiet -noprog
   54 set TONETLOG=sfk filt "-! files of*sent" -lshigh cyan "<*" +tonetlog
   55 set SFK_FTP_PW=%TRANSFER_PW%
   56 
   57 rem === auto extend short parms to full parms ===
   58 rem = extend product "mp9" to "m9player".
   59 rem = extend target "200" to "192.168.1.200".
   60 
   61 IF "%PRODUCT%"=="mp8" (set PRODUCT=m8player)
   62 IF "%PRODUCT%"=="mp9" (set PRODUCT=m9player)
   63 
   64 sfk -quiet strlen "%TARGET%"
   65 IF %ERRORLEVEL% LEQ 3 (set TARGET=%TARGET_NET%.%TARGET%)
   66 
   67 rem === show a hello in the network text (SFK_LOGTO) ===
   68 
   69 sfk echo "[green]=== xmake: %PRODUCT% %TOOLCHAIN% %CLEAN% for %TARGET% ===[def]" +tolog
   70 
   71 rem change parameter "clean" to "0" or "1"
   72 IF "%CLEAN%"=="clean" ( SET CLEAN="1" ) ELSE ( SET CLEAN="0" )
   73 
   74 rem === go into local workspace containing project folders ===
   75 
   76 %LOCAL_WORKDRIVE%
   77 cd %LOCAL_WORKDIR%
   78 
   79 rem === 1. sync changed files to build server ===
   80 
   81 rem send compile script. enforce unix line endings before upload:
   82 sfk -quiet=2 remcr xmakerem.sh
   83 sfk select xmakerem.sh +sft %FTPOPT% %BUILD_SERVER% cput -yes | %TONETLOG%
   84 
   85 rem send changed sources.
   86 sfk select -dir %PRODUCT% -file !.bak !.tmp +sft %FTPOPT% %BUILD_SERVER% cput -yes | %TONETLOG%
   87 
   88 rem === 2. run build on server ===
   89 
   90 del xmakerem.log
   91 sfk sft %FTPOPT% %BUILD_SERVER% run "bash xmakerem.sh %PRODUCT% %TOOLCHAIN% %TARGET% %CLEAN% %LOG_TARGET% >xmakerem.log 2>&1" -yes | %TONETLOG%
   92 
   93 rem get terminal output
   94 sfk sft %FTPOPT% %BUILD_SERVER% get xmakerem.log
   95 type xmakerem.log
   96 
   97 rem === 3. confirm completion ===
   98 
   99 sfk echo "[green]=== xmake done. ===[def]" +tolog
  100 
  101 rem === uncomment this to keep script window open ===
  102 rem sfk echo "[Magenta]=== waiting for user to close script window. ===[def]" +tolog +then pause
  103 
  104 :end