-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
为了测试用例增加了从.sh到.bat的转换脚本;应对vc没有装在c盘的情形
- Loading branch information
Showing
4 changed files
with
28 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
@REM cl /EHsc /showIncludes main.cpp > main.inc | ||
|
||
@REM 剔除库文件;剩下的写入one.txt后并从标准输出中删除。有bug:foo.h在one.txt中出现两次 | ||
TYPE main.inc | ..\minised -e "/Note: including file:[ \t]\+C:\\Program Files/d" -e "/Note: including file:/w bug.txt" -e "/Note: including file:/d" | ||
|
||
@REM 把最后一个-e的内容用管道再次给minised,就可以避免这个bug | ||
TYPE main.inc | ..\minised -e "/Note: including file:[ \t]\+C:\\Program Files/d" -e "/Note: including file:/w ok.txt" | ..\minised -e "/Note: including file:/d" | ||
|
||
@REM 可以运行a.sh以跟正常sed的行为做对比 | ||
|
||
|
||
@REM 这个文件换行用dos风格才行,用unix风格换行会报错 | ||
@REM cl /EHsc /showIncludes main.cpp > main.inc | ||
|
||
@REM 剔除库文件;剩下的写入one.txt后并从标准输出中删除。有bug:foo.h在one.txt中出现两次 | ||
TYPE main.inc | ..\minised -e "/Note: including file:[ \t]\+[A-Z]:\\Program Files/d" -e "/Note: including file:/w bug.txt" -e "/Note: including file:/d" | ||
|
||
@REM 把最后一个-e的内容用管道再次给minised,就可以避免这个bug | ||
TYPE main.inc | ..\minised -e "/Note: including file:[ \t]\+[A-Z]:\\Program Files/d" -e "/Note: including file:/w ok.txt" | ..\minised -e "/Note: including file:/d" | ||
|
||
@REM 可以运行a.sh以跟正常sed的行为做对比 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ $# -lt 2 ] ; then | ||
echo "Usage: $0 <.sh name> vc" | ||
exit 1 | ||
fi | ||
|
||
#batname="${1%.*}.bat" | ||
#echo $batname | ||
|
||
#sed -e "/#!/d" -e "s/^#/@REM/g" -e "s/gcc.exe/$2.exe/g" -e "s/-c gcc/-c $2/g" -e "s@/dev/null@NUL@g" $1 -e "s/^cp /COPY /g" -e "s/rm/DEL/g" -e 's/\//\\/g' | ||
sed -e 's/#!.*/@ECHO OFF/g' -e "s/^#/@REM/g" -e "s/gcc.exe/$2.exe/g" -e "s/-c gcc/-c $2/g" -e "s@/dev/null@NUL@g" $1 -e "s/^cp /COPY /g" -e "s/rm/DEL/g" -e 's/\//\\/g' | ||
|