conv_args.awk

来自「是地震解释软件OpenglTect的源码,3d效果很棒」· AWK 代码 · 共 77 行

AWK
77
字号
BEGIN { FS=" "; isprog=0; outfil=""; link=1; linkflags=""; compileflags="" }{    for( i=1; i<= NF; i++ )    {        if( $i ~ /^-I/ )        {            keep = $0;            tmp = substr($i,3);            if( tmp ) {tmp = "cygpath -w " tmp; }            else { i++; tmp = "cygpath -w " $(i); }            if( tmp | getline )                compile_flags = compile_flags " -I" $0;            close( tmp );            $0=keep;        }        else if( $i ~ /^-L/ )        {            keep = $0;            tmp = substr($i,3);            if( tmp ) {tmp = "cygpath -w " tmp; }            else { i++; tmp = "cygpath -w " $(i); }            if( tmp | getline )                compile_flags = compile_flags " -L" $0;            close( tmp );            $0=keep;        }        else if( $i ~ /^-o/ )        {            keep = $0;            tmp = substr($i,3);            if( tmp ) {tmp = "cygpath -w " tmp; }            else { i++; tmp = "cygpath -w " $(i); }            if( tmp | getline )                compile_flags = compile_flags " -o " $0;            close( tmp );            $0=keep;        }        else if( $i ~ /^\// )        {            keep = $0;            tmp = "cygpath -w " $(i);            if( tmp | getline )                compile_flags = compile_flags " " $0;            close( tmp );            $0=keep;	}        else if( $i ~ /=\// )        {            keep = $0;	    curword = $i;	    len = length( curword );	    start = index( $i, "=/");	    head =  substr(curword,0,start);	    tail =  substr(curword,start+1);            tmp = "cygpath -w " tail;            if( tmp | getline )                compile_flags = compile_flags " " head $0;            close( tmp );            $0=keep;	}	else { compile_flags = compile_flags " " $i ;}    }    printf( compile_flags );}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?