浏览代码

OS-native targets for "mftest -a"

Scott Lahteine 3 年前
父节点
当前提交
08f392cdd3
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10
    1
      buildroot/share/git/mftest

+ 10
- 1
buildroot/share/git/mftest 查看文件

@@ -138,6 +138,15 @@ if ((AUTO_BUILD)); then
138 138
   #
139 139
   # List environments that apply to the current MOTHERBOARD.
140 140
   #
141
+  case $(uname | tr '[:upper:]' '[:lower:]') in
142
+    darwin) SYS='mac' ;;
143
+    *linux) SYS='lin' ;;
144
+      win*) SYS='win' ;;
145
+     msys*) SYS='win' ;;
146
+   cygwin*) SYS='win' ;;
147
+    mingw*) SYS='win' ;;
148
+         *) SYS='uni' ;;
149
+  esac
141 150
   echo ; echo -n "Auto " ; ((AUTO_BUILD == 2)) && echo "Upload..." || echo "Build..."
142 151
   MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//' )
143 152
   [[ -z $MB ]] && { echo "Error - Can't read MOTHERBOARD setting." ; exit 1 ; }
@@ -145,7 +154,7 @@ if ((AUTO_BUILD)); then
145 154
   BNUM=$( $SED -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
146 155
   BDESC=$( $SED -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" )
147 156
   [[ -z $BNUM ]] && { echo "Error - Can't find $MB in boards list." ; exit 1 ; }
148
-  ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E '#include.+//.+env:[^ ]+' | grep -oE 'env:[^ ]+' | $SED -E 's/env://' ) )
157
+  ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | $SED -E "s/(env|$SYS)://" ) )
149 158
   [[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; }
150 159
   ECOUNT=${#ENVS[*]}
151 160
 

正在加载...
取消
保存