Skip to content

Commit 6be968b

Browse files
committed
Makefile creates generated files
1 parent 1bf4ef4 commit 6be968b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

source/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,21 @@ SOURCE:=$(shell find ${THREADS_DIR} -type f -name '*.c') \
319319
$(shell find ${MIDDLEWARES_DIR} -type f -name '*.c') \
320320
$(BRIEFLZ_DIR)/depack.c
321321

322+
# UI screen drawing code is generated from TOML descriptors at build
323+
# time. The generator is fast (~0.1s) and idempotent; it writes one
324+
# .cpp per screen per resolution into generated/mono_<W>x<H>/, which
325+
# the SOURCE_CPP find immediately below picks up automatically.
326+
#
327+
# See Core/Threads/UI/drawing/LAYOUT_DESIGN.md for the schema, and
328+
# Core/Threads/UI/drawing/screens/*.toml for the inputs.
329+
DRAWING_DIR:=$(THREADS_DIR)/UI/drawing
330+
DRAWING_GEN:=$(shell $(HOST_PYTHON) $(DRAWING_DIR)/tools/render_screens.py \
331+
--screens $(DRAWING_DIR)/screens \
332+
--output $(DRAWING_DIR)/generated 2>&1)
333+
ifneq ($(DRAWING_GEN),$(filter Generated%file(s)%, $(DRAWING_GEN)))
334+
$(info $(DRAWING_GEN))
335+
endif
336+
322337
# We exclude the USB-PD stack tests $(PD_DRIVER_TESTS_DIR)
323338
SOURCE_CPP:=$(shell find ${THREADS_DIR} -type f -name '*.cpp') \
324339
$(shell find ${SOURCE_CORE_DIR} -type f -name '*.cpp') \
@@ -691,6 +706,7 @@ $(foreach group_code,$(LANGUAGE_GROUPS),$(eval $(call multi_lang_rule,$(group_co
691706

692707
clean:
693708
rm -Rf Core/Gen
709+
rm -Rf Core/Threads/UI/drawing/generated
694710
rm -Rf $(OUTPUT_DIR_BASE)
695711
rm -Rf $(HEXFILE_DIR)/*
696712
rm -Rf ../Translations/__pycache__

0 commit comments

Comments
 (0)