Peter Maydell <peter.mayd...@linaro.org> writes: > On 28 April 2017 at 14:58, Wei Huang <w...@redhat.com> wrote: >> Using #ifdef is indeed a cleaner solution. However I can't use "#ifdef >> CONFIG_ARM_V7M" & co inside target/arm/cpu.c file because CONFIG_xxx >> aren't available as preprocessor directives. From what I saw the >> CONFIG_xxx options can only control compiling source file. One solution >> is to extract out all v7M code into separate files and use >> CONFIG_ARM_V7M to direct compilation. A bit messy though. Any other >> suggestions? > > We seem to run into "CONFIG_FOO is defined for make but not > for the C preprocessor" from time to time, so maybe we should > fix that?
Hmm is should be auto-generated from config-(host|target).mak but I've never quite figured out why we need timestamps rather than a straight dependency check in rules.mk: # Generate timestamp files for .h include files config-%.h: config-%.h-timestamp @cmp $< $@ >/dev/null 2>&1 || cp $< $@ config-%.h-timestamp: config-%.mak $(SRC_PATH)/scripts/create_config $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@,"GEN","$(TARGET_DIR)config-$*.h") This seems to be one of those things that goes away on a make clean && rebuild -- Alex Bennée