#How to check in Makefile that some feature is enabled in the json config?

4 messages · Page 1 of 1 (latest)

reef igloo
#

Suppose I enable a feature in my keymap.json file like this:

{
    "config": {
        "features": {
            "rgblight": true
        }
    }
}

How can I test for this in the keyboard’s rules.mk file to add a specific C-file or not?

ifdef RGBLIGHT_ENABLE and ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) don’t seem to work.

hearty crystal
#

In the C file, you would want #ifdef RGBLIGHT_ENABLE. Make sure to end it with #endif at the appropriate line.

#

I think what you’ve got there would be useful to check for flags supplied from the command line.

gentle flower
#

ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) is fine, but you should be using a post_rules.mk instead