[riot-notifications] [RIOT-OS/RIOT] makefiles: do not remove defines from CFLAGS (#12262)

Gaëtan Harter notifications at github.com
Tue Sep 17 16:25:59 CEST 2019


Passing the value from environment variable is tricky, even without `docker` but if defined in the Makefile it is working directly, same as https://github.com/RIOT-OS/RIOT/pull/12262#issuecomment-532234924

I need help with shell definition and escaping here :/

When used in a standard build, I managed to have the definition working from environment when doing:

```
CFLAGS=$'-DSPACE_VALUE=\'"with space"\'' QUIET=0 RIOT_CI_BUILD=1 make --no-print-directory -C examples/hello-world/; grep '#define SPACE_VALUE' examples/hello-world/bin/native/riotbuild/riotbuild.h 
Building application "hello-world" for "native" with MCU "native".

'/home/harter/work/git/RIOT/dist/tools/genconfigheader/genconfigheader.sh' -DSPACE_VALUE='"with space"' -DDEVELHELP -Werror -Wall -Wextra -pedantic -std=gnu99 -m32 -fstack-protector-all -ffunction-sections -fdata-sections -DDEBUG_ASSERT_VERBOSE -DRIOT_APPLICATION=\"hello-world\" -DBOARD_NATIVE=\"native\" -DRIOT_BOARD=BOARD_NATIVE -DCPU_NATIVE=\"native\" -DRIOT_CPU=CPU_NATIVE -DMCU_NATIVE=\"native\" -DRIOT_MCU=MCU_NATIVE -fno-common -Wall -Wextra -Wmissing-include-dirs -fno-delete-null-pointer-checks -fdiagnostics-color -Wstrict-prototypes -Wold-style-definition -gz -Wformat=2 -Wformat-overflow -Wformat-truncation -include '/home/harter/work/git/RIOT/examples/hello-world/bin/native/riotbuild/riotbuild.h' -DRIOT_VERSION=\"buildtest\" -DMODULE_AUTO_INIT -DMODULE_BOARD -DMODULE_CORE -DMODULE_CORE_MSG -DMODULE_CPU -DMODULE_NATIVE_DRIVERS -DMODULE_PERIPH -DMODULE_PERIPH_COMMON -DMODULE_PERIPH_GPIO -DMODULE_PERIPH_PM -DMODULE_PERIPH_UART -DMODULE_SYS \
        | '/home/harter/work/git/RIOT/dist/tools/lazysponge/lazysponge.py' --verbose '/home/harter/work/git/RIOT/examples/hello-world/bin/native/riotbuild/riotbuild.h'
Keeping old /home/harter/work/git/RIOT/examples/hello-world/bin/native/riotbuild/riotbuild.h (f73837f33d6e2f259b9104bf952c7b48)
DIRS=" " "make" -C /home/harter/work/git/RIOT/examples/hello-world -f /home/harter/work/git/RIOT/makefiles/application.inc.mk
gcc /home/harter/work/git/RIOT/examples/hello-world/bin/native/cpu/startup.o -Wl,--start-group /home/harter/work/git/RIOT/examples/hello-world/bin/native/application_hello-world.a  /home/harter/work/git/RIOT/examples/hello-world/bin/native/auto_init.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/board.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/core.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/cpu.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/native-drivers.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/periph.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/sys.a /home/harter/work/git/RIOT/examples/hello-world/bin/native/periph_common.a -lm -Wl,--end-group -m32 -ldl -Wl,--gc-sections -ffunction-sections -Wl,-Map=/home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.map -o /home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf
size  /home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf
   text    data     bss     dec     hex filename
  22918     568   47652   71138   115e2 /home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf
rm -f /home/harter/work/git/RIOT/examples/hello-world/bin/native/.test
#define SPACE_VALUE "with space"
```

But I currently did not manage to escape it enough for defining it with `DOCKER_ENVIRONMENT_CMDLINE` as shown in https://github.com/RIOT-OS/RIOT/issues/12219

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12262#issuecomment-532245227
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190917/50cb2654/attachment.htm>


More information about the notifications mailing list