"Fossies" - the Fresh Open Source Software Archive

Member "sfk-1.9.6/scripts/xmakerem.sh" (22 Feb 2020, 2004 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) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 #
    3 # XMakeRem 0.5 - Cross network make of projects.
    4 # Compile command script.
    5 # 
    6 # Compile on build server, send error output to your PC,
    7 # forward compiled binaries to target device.
    8 #
    9 # This is edited on your Windows PC, and on every change
   10 # sent again to the build server, to allow easy editing
   11 # of all XMake scripts in one place.
   12 #
   13 # Store and edit this using UNIX LINE ENDINGS (LF only).
   14 # While editing in DView check the line end info after :file:.
   15 # If it shows [crlf] click on the gray arrows nearby.
   16 
   17 # === parameters and dataway ===
   18 export PRODUCT=$1
   19 export TOOLCHAIN=$2
   20 export TARGET=$3
   21 export CLEAN=$4
   22 export LOG_TARGET=$5
   23 export UPDATE_PW=mybinpw456
   24 
   25 # === expand short parameters ===
   26 if [ "$CLEAN" -eq "1" ]; then
   27    export CLEAN="clean"
   28 else
   29    export CLEAN=""
   30 fi
   31 
   32 # === internal inits ===
   33 if [ "$LOG_TARGET" = "" ]; then
   34    export SFK_LOGTO="term"
   35 else
   36    export SFK_LOGTO="term,net:$LOG_TARGET"
   37 fi
   38 export FTPOPT="-nohead -quiet -noprog"
   39 export TONETLOG="sfk filt -srep _\xe2\x80\x3f_\q_ -high Red error +tolog"
   40 export SFK_FTP_PW=$UPDATE_PW
   41 if [ ! -d $PRODUCT ]; then
   42    sfk echo "[Red]no product dir found: $PRODUCT[def]" +tolog
   43    exit
   44 fi
   45 
   46 # define output binaries, clean them up first
   47 export BINARY=bin$TOOLCHAIN/$PRODUCT
   48 rm $BINARY
   49 rm $PRODUCT.new
   50 
   51 # === 1. run whatever build system exists ===
   52 
   53 sfk echo "[green]=== xmakerem: $PRODUCT $TOOLCHAIN $CLEAN for $TARGET ===[def]" +tolog
   54 cd $PRODUCT
   55 bash 01-make-all.sh $TOOLCHAIN $CLEAN 2>&1 | $TONETLOG
   56 if [ ! -f $BINARY ]; then
   57    sfk echo "[Red]build failed, no binary: $BINARY[def]" +tolog
   58    exit
   59 fi
   60 
   61 # === 2. send output binary to target ===
   62 # = in this example, target reacts on an update file like m9player.new,
   63 # = replacing it's own binary by that, re-running itself.
   64 # = an sfk sftserv must be running on the target.
   65 
   66 sfk echo "[green]=== update target $TARGET ===[def]" +tolog
   67 cp $BINARY $PRODUCT.new | $TONETLOG
   68 sfk sft $TARGET put $PRODUCT.new | $TONETLOG
   69 
   70 sfk echo "[green]=== xmakerem done. ===[def]" +tolog