📄 gendepend
字号:
#!/bin/sh# to use this script, cd to the utils source directory and sh# gendepend.gdep=`pwd`/g++dep.shcd ..popdir=`pwd`gxx_include=${popdir}/g\+\+-includeio_dir=${popdir}/iostreamsrc_dir=${popdir}/srcgxx_flags="-I. -I${gxx_include} -I${io_dir}"for i in `find . -name depend -print` ; do down=`dirname $i` up=`echo $down | sed -e "s:/[-a-zA-Z0-9]*:/..:g" -e "s:^\./::"` cd ${popdir}/${down} echo "" > depend.tmp ${gdep} -f depend.tmp ${gxx_flags} *.[cC]*# --- Generate depend rules ---# The sed script below attempts to make the depend output portable by# making the output use the same macros used elsewhere in the Makefile:# - It replaces double // by a single /.# - It replaces include files that match part of the GXX_INCLUDE_DIRS# by names defined in terms of the macros used to define GXX_INCLUDE_DIRS.# However, files in g++-include are ignored.# - It removes any absolute include file names that remain.# - then remove lines, which contain only `\'## -e 's|$(srcdir)|$$(srcdir)|g'# -e 's|: *\$$(srcdir)/\(.*\.[cC]*\)|: \1|' sed < depend.tmp \ -e 's|//|/|g' \ -e "s|${io_dir}|\$(srcdir)/${up}/\$(IO_DIR)|g" \ -e "s| ${gxx_include}/[^ ]*[.]h||g" \ -e "s|${src_dir}|\$(srcdir)/${up}/src_dir|g" \ -e 's| /[^ ]*[.]h||g' \ -e '/^[ ]*\\$/d' -e 's/^[ ]*$//' \ | awk 'BEGIN { prev = "" } \ /^( )*$/ { if (prev ~ /\\$/) \ { prev = substr(prev,1,length(prev)-1); next } \ } \ { print prev; prev = $0 } \ END { if (prev !~ /^( )*$/) print prev }' \ > depend rm -f depend.tmpdoneexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -