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文件