md %1_objs
cd %1_objs
for /F %%i in ('link -lib /list %1.lib') do link -lib /extract:%%i %1.lib
for %%i in (*.obj) do pcf %%i
sigmake -n"%1.lib" *.pat %1.sig
if exist %1.exc for %%i in (%1.exc) do find /v ";" %%i > abc.exc
if exist %1.exc for %%i in (%1.exc) do > abc.exc more +2 "%%i"
copy abc.exc %1.exc
del abc.exc
sigmake -n"%1.lib" *.pat %1.sig
copy %1.sig ..\%1.sig
cd ..
del %1_objs /s /q
rd %1_objs
对于if exist %1.exc for %%i in (%1.exc) do find /v ";" %%i > abc.exc 这一句我认为是把对应的exc中除去注释行全部复制到abc.exc中。
而if exist %1.exc for %%i in (%1.exc) do > abc.exc more +2 "%%i"这一句又从新开始把对应的exc从第二行开始复制到abc.exc中。那么上一句相当于白干了吧
求大家帮忙看看这两句到底是做什么用途呢?谢谢!
多谢soechin的回答,要实现去除注释行和两行空白行,我测试了下,是在
if exist %1.exc for %%i in (%1.exc) do find /v ";" %%i > abc.exc
和
if exist %1.exc for %%i in (%1.exc) do > abc.exc more +2 "%%i"
之间少了一行脚本;
即copy abc.exc %1.exc