kuikuitage

  博客园  ::  :: 新随笔  :: 联系 ::  :: 管理

通过windows下的mingwin可以实现linux下的find,grep,exec,sort操作处理
find ./ -name '.c' -exec grep -E '\s*#if|\s#ifdef|\s*#ifndef|\s#elif' {} \; > ./tmp;
find ./ -name '
.cpp' -exec grep -E '\s*#if|\s#ifdef|\s*#ifndef|\s#elif' {} \; >> ./tmp;
find ./ -name '.h' -exec grep -E '\s*#if|\s#ifdef|\s*#ifndef|\s#elif' {} \; >> ./tmp;
find ./ -name '
.hh' -exec grep -E '\s*#if|\s#ifdef|\s*#ifndef|\s#elif' {} \; >> ./tmp;
可以将当前目录下的所有.c,.cpp,.h,.hh类型的文件中的正则匹配的#if, #ifdef,#ifndef开始的宏定义全部找出来,缓存到./tmp

通过指定编译的makefile中的CFLAG或者CPPFLAG的-D缓存到.tmp1

通过SourceInsight的condition环境变量导入。即可实现动态解析所有的宏定义,方便看代码。

posted on 2020-05-06 02:57  kuikuitage  阅读(336)  评论(0编辑  收藏  举报