build.awk

来自「空战游戏flacon源码」· AWK 代码 · 共 48 行

AWK
48 行
字号
#!/usr/local/bin/gawk -f

#  FUNCTION: This [g]awk script is to automatically
#  generate the "shi/targets.h" file.


# At the top of the file, dump in this header

  BEGIN {
    print " "
    print "/*"
    print "  This cludge 'enumerates' the various valid TARGETs so we"
    print "  may use them for #if tests with the BUILDING_FOR_* macros."
    print "  (SEE: shi.h)"
    print " "
    print "     ** THIS FILE IS AUTOMATICALLY GENERATED **"
    print "*/"
    print " "
    print " "
    print "#ifndef _SHI__TARGETS_H_"
    print "#define _SHI__TARGETS_H_"
    print " "
    }


# For every line (sub-directory name) that begins with "m_"
# generate a define line

  /^m_/  { print "#define SHI_CS_"  $1 "	" NR-1 }


# For every other type of line, do nothing

  { }


# Once done, finish up with this

  END {
    print " "
    print "#endif  /* _SHI__TARGETS_H_ */"
    }





⌨️ 快捷键说明

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