在Makefile中: $(obj)include/autoconf.mk: $(obj)include/config.h @$(XECHO) Generating $@ ; / set -e ; / : Extract the config macros ; / $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | / sed -n -f tools/scripts/define2mk.sed > $@ 实际执行的命令: arm-none-linux-gnueabi-gcc -E -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0xc3e00000 -I/home/zkl/svn/compiled/uboot-1.3.4-m9_v4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv5te -mabi=apcs-gnu -mno-thumb-interwork -Wall -Wstrict-prototypes -fno-stack-protector -DDO_DEPS_ONLY -dM include/common.h | sed -n -f tools/scripts/define2mk.sed /^#define CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*/ { # Strip the #define prefix s/#define *//; # Change to form CONFIG_*=VALUE s/ */=/; # Drop trailing spaces s/ *$//; # drop quotes around string values s/="/(.*/)"$/=/1/; # Concatenate string values s/" *"//g; # Wrap non-numeral values with quotes s/=/(.*/?[^0-9].*/)$/=/"/1/"/; # Change '1' and empty values to "y" (not perfect, but # supports conditional compilation in the makefiles s/=$/=y/; s/=1$/=y/; # print the line p }