0

How can I construct an iterative number list from boolean config flags in makefile?

Defined in Config.in

config CONFIG_VAR_1
  bool "var 1"
  default y

config CONFIG_VAR_2
  bool "var 2"
  default y

Makefile

VAR = \
    $(if $(CONFIG_VAR_1), 0) \
    $(if $(CONFIG_VAR_2), 1)

$(foreach i, $(VAR), $(info AVR=$i))

Expected result

VAR=0
VAR=1

With displayed approach I get variable VAR to be empty.

Shnookie
  • 11
  • 4

1 Answers1

0

This approach actually works as intended. The variable VAR was empty, because .config was cashed with old values.To make it work I only had to do a make defconfig && make

Shnookie
  • 11
  • 4