Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Environment Variables expanded in subdir.mk when "Expand Env. Variables Refs in Makefiles" not checked

Hi,

I'm using CDT 8.8.1 with Mars.2 Release of Eclipse (4.5.2) and have setup a project for cross compilation which works great.  We put the generated makefiles under source control as they are used by external tools that can compile and package the same code base.  

Before starting eclipse we set several Environment variables which are then used within the CDT (mainly $CC and $CFLAGS), then we ensure that the "Expand Env. Variables Refs in Makefiles" is not checked.  Then in the C/C++ build settings -> Tool Settings we use ${CC} ${CFLAGS} in the Command to invoke our cross compiler.  The main generated makefile uses the environment variables as expected:

    ....
    @echo 'Building target: $@'
    @echo 'Invoking: Cross GCC Linker'
    ${CC} ${CFLAGS} ${LDFLAGS} -shared -o "mod_smu.so" $(OBJS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '
    ....


but the generated subdir.mk files do expand the environment variables:

	@echo 'Building file: $<'
	@echo 'Invoking: Cross GCC Compiler'
	arm-none-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/sdk/2016.01/....[snip]....
	@echo 'Finished building: $<'
	@echo ' '

Is this a bug? if so has it been fixed in 9.0?
Also if someone could point me to where in the code that the subdir.mk files are generated so I can put a temporary fix in place it would be most appreciated.


Many Thanks,
Martin.



Back to the top