sed -n “/.*Configured with/s/[^:]*: //p“ “$@“ | sh;

2023-12-26 00:20:56
all: fio
# make all will make to generate config-host.mak. if configure is newer than config-host.mak, though  config-host.mak is exist, will do this target again, otherwise not do it
config-host.mak: configure
	@if [ ! -e "$@" ]; then					\
	  echo "if $@ is not exist, Running ./configure ... to gennerate $@";				\
	  ./configure;						\
	else							\
	  echo "is out-of-date, running configure";		\
	  #1 # Automatically generated by configure - do not modify Configured with: './configure'
	  echo "repace file $@'s content '*Configured with: ' with NULL strings, then execuate sh ./configure CONFIG_XXX=y ..." \
	  sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh;	\
	fi
  1 # Automatically generated by configure - do not modify
  2 # Configured with: './configure'
  3 CONFIG_TARGET_OS=Linux
  4 CONFIG_64BIT=y
  5 CONFIG_LITTLE_ENDIAN=y
  6 CONFIG_ZLIB=y
  7 CONFIG_LIBAIO=y
  8 CONFIG_POSIXAIO=y
  9 CONFIG_POSIXAIO_FSYNC=y
 10 CONFIG_PSHARED=y
 11 CONFIG_PTHREAD_CONDATTR_SETCLOCK=y
 12 CONFIG_PTHREAD_SIGMASK=y
 13 CONFIG_HAVE_ASPRINTF=y
 14 CONFIG_HAVE_VASPRINTF=y
 15 CONFIG_LINUX_FALLOCATE=y
 16 CONFIG_POSIX_FALLOCATE=y
 17 CONFIG_FDATASYNC=y
 18 CONFIG_PIPE=y
 19 CONFIG_PIPE2=y
 20 CONFIG_PREAD=y
 21 CONFIG_SYNC_FILE_RANGE=y

config-host.mak文件

sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh; 就是将config-host.mak文件开头的

? 1 # Automatically generated by configure - do not modify
? 2 # Configured with: './configure'

'Configured with: ' 及其前面的字符串替换成空,最后剩下的就是? ./condigure CONFIG_TARGET_OS=Linux

CONFIG_LITTLE_ENDIAN=y

......

也就是 根据配置文件config-host.mak的内容重新配置生成新的.config文件

文章来源:https://blog.csdn.net/weixin_38987932/article/details/135210651
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。