
In message 20071121055107.19848.96219.stgit@trillian.cg.shawcable.net you wrote:
Use cpp and sed to postprocess config.h and import the defined values into include/autoconf.mk. autoconf.mk is then included by config.mk to give 'make' access to the board configuration.
Doing this enables conditional compilation at the Makefile level instead of by wrapping every .c file with #ifdef/#endif wrappers.
Unfortunately this breaks building with older (GCC-3.x) compilers.
+$(OBJTREE)/include/autoconf.mk: $(obj)include/config.h
- @echo Generating include/autoconf.mk
- @# Generate the dependancies
- @$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Does not work with GCC-3.x:
+ ppc_8xx-gcc -M -g -Os -fPIC -ffixed-r14 -meabi -fno-strict-aliasing -D__KERNEL__ -DTEXT_BASE=0x40000000 -I/home/wd/git/u-boot/work/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/eldk-3.1.1/usr/bin/../lib/gcc-lib/ppc-linux/3.3.3/include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_8xx -ffixed-r2 -ffixed-r29 -mstring -mcpu=860 -msoft-float -MQ /home/wd/git/u-boot/work/include/autoconf.mk include/common.h ppc_8xx-gcc: compilation of header file requested + echo RC=1 RC=1
[Tested with ELDK 3.1.1]
The effect is even more nasty, as make will not stop afgter the error; if you ignore the "compilation of header file requested" message, but continues until it runs into problems later (when linking).
Best regards,
Wolfgang Denk