@@ -375,18 +375,34 @@ LVGL_DIR = $(LVGL_BINDING_DIR)/lvgl
375
375
LVGL_GENERIC_DRV_DIR = $(LVGL_BINDING_DIR ) /driver/generic
376
376
INC += -I$(LVGL_BINDING_DIR )
377
377
ALL_LVGL_SRC = $(shell find $(LVGL_DIR ) -type f -name '* .h') $(LVGL_BINDING_DIR ) /lv_conf.h
378
+ LVGL_ALL_H = $(BUILD ) /lvgl/lvgl_all.h
379
+ LVGL_ALL_JSON = $(BUILD ) /lvgl/lvgl_all.json
378
380
LVGL_PP = $(BUILD ) /lvgl/lvgl.pp.c
379
381
LVGL_MPY = $(BUILD ) /lvgl/lv_mpy.c
380
382
LVGL_MPY_METADATA = $(BUILD ) /lvgl/lv_mpy.json
381
383
CFLAGS_EXTMOD += $(LV_CFLAGS )
382
384
383
- $(LVGL_MPY ) : $(ALL_LVGL_SRC ) $(LVGL_BINDING_DIR ) /gen/gen_mpy.py
385
+ ifneq (,$(wildcard $(LVGL_DIR ) /scripts/gen_json/gen_json.py) )
386
+ $(LVGL_ALL_JSON ) : $(ALL_LVGL_SRC ) $(LVGL_DIR ) /scripts/gen_json/gen_json.py
387
+ $(ECHO ) " LVGL-JSON-GEN $@ "
388
+ $(Q ) mkdir -p $(dir $@ )
389
+ $(ECHO ) " #include \" $( LVGL_DIR) /lvgl.h\" \n#include \" $( LVGL_DIR) /src/lvgl_private.h\" " > $(LVGL_ALL_H )
390
+ $(Q )$(PYTHON ) $(LVGL_DIR ) /scripts/gen_json/gen_json.py --target-header $(LVGL_ALL_H ) > $(LVGL_ALL_JSON )
391
+ else
392
+ $(LVGL_ALL_JSON ) :
393
+ $(ECHO ) " LVGL-JSON-GEN $@ "
394
+ $(Q ) mkdir -p $(dir $@ )
395
+ $(ECHO ) " {}" > $(LVGL_ALL_JSON )
396
+ endif
397
+
398
+ $(LVGL_MPY ) : $(ALL_LVGL_SRC ) $(LVGL_BINDING_DIR ) /gen/gen_mpy.py $(LVGL_ALL_JSON )
384
399
$(ECHO ) " LVGL-GEN $@ "
385
400
$(Q ) mkdir -p $(dir $@ )
386
401
$(Q )$(CPP ) $(CFLAGS_EXTMOD ) -DPYCPARSER -x c -I $(LVGL_BINDING_DIR ) /pycparser/utils/fake_libc_include $(INC ) $(LVGL_DIR ) /lvgl.h > $(LVGL_PP )
387
- $(Q )$(PYTHON ) $(LVGL_BINDING_DIR ) /gen/gen_mpy.py -M lvgl -MP lv -MD $(LVGL_MPY_METADATA ) -E $(LVGL_PP ) $(LVGL_DIR ) /lvgl.h > $@
402
+ $(Q )$(PYTHON ) $(LVGL_BINDING_DIR ) /gen/gen_mpy.py -M lvgl -MP lv -MD $(LVGL_MPY_METADATA ) -E $(LVGL_PP ) -J $( LVGL_ALL_JSON ) $(LVGL_DIR ) /lvgl.h > $@
388
403
389
404
.PHONY : LVGL_MPY
405
+ LVGL_ALL_JSON : $(LVGL_ALL_JSON )
390
406
LVGL_MPY : $(LVGL_MPY )
391
407
392
408
CFLAGS_EXTMOD += -Wno-unused-function
0 commit comments