Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions bricks/_common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ PYDFU = $(TOP)/tools/pydfu.py
PYBRICKSDEV = pybricksdev
METADATA = $(PBTOP)/tools/metadata.py
MEDIA_CONVERT = $(PBTOP)/lib/pbio/src/image/media.py
FONT_CONVERT = $(PBTOP)/lib/pbio/src/image/fontconvert.py
CREDITS_CONVERT = $(PBTOP)/bricks/ev3/make_credits.py
OPENOCD ?= openocd
OPENOCD_CONFIG ?= openocd_stm32$(PB_MCU_SERIES_LCASE).cfg
Expand Down Expand Up @@ -557,6 +558,12 @@ PBIO_SRC_C += $(BUILD)/pbio_image_media.c
PBIO_SRC_C += $(BUILD)/hmi_ev3_ui_credits.c
endif

ifeq ($(PB_FONTS),1)
PBIO_SRC_C += $(BUILD)/font_liberationsans_regular_14.c
PBIO_SRC_C += $(BUILD)/font_terminus_normal_16.c
PBIO_SRC_C += $(BUILD)/font_mono_8x5_8.c
endif

OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(PY_EXTRA_SRC_C:.c=.o))
Expand Down Expand Up @@ -676,6 +683,23 @@ $(BUILD)/pbio_image_media.c $(BUILD)/pb_type_image_attributes.c: $(MEDIA_CONVERT
$(ECHO) "Generating image media files"
$(Q)$(PYTHON) $(MEDIA_CONVERT) $(BUILD)

include $(PBTOP)/lib/pbio/src/image/fonts/fonts.mk

$(BUILD)/font_liberationsans_regular_14.c: $(PBTOP)/lib/pbio/src/image/fonts/$(FONT_LIBERATION_SANS_REGULAR) $(FONT_CONVERT)
$(ECHO) "GEN $@"
$(Q)$(PYTHON) $(FONT_CONVERT) $< 14 \
--license $(FONT_LIBERATION_LICENSE) $(FONT_LIBERATION_COPYRIGHT) > $@

$(BUILD)/font_terminus_normal_16.c: $(PBTOP)/lib/pbio/src/image/fonts/$(FONT_TERMINUS_NORMAL) $(FONT_CONVERT)
$(ECHO) "GEN $@"
$(Q)$(PYTHON) $(FONT_CONVERT) $< 16 \
--license $(FONT_TERMINUS_LICENSE) $(FONT_TERMINUS_COPYRIGHT) > $@

$(BUILD)/font_mono_8x5_8.c: $(PBTOP)/lib/pbio/src/image/fonts/$(FONT_NXOS) $(FONT_CONVERT)
$(ECHO) "GEN $@"
$(Q)$(PYTHON) $(FONT_CONVERT) --image $< 8 \
--license $(FONT_NXOS_LICENSE) $(FONT_NXOS_COPYRIGHT) > $@

$(BUILD)/hmi_ev3_ui_credits.c: $(CREDITS_CONVERT)
$(ECHO) "Generating EV3 credits file"
$(Q)$(PYTHON) $(CREDITS_CONVERT) $(BUILD)
Expand Down Expand Up @@ -755,4 +779,6 @@ deploy-openocd: $(BUILD)/firmware-base.bin
$(ECHO) "Writing $< to the board via ST-LINK using OpenOCD"
$(Q)$(OPENOCD) -f $(OPENOCD_CONFIG) -c "stm_flash $< $(TEXT0_ADDR)"

.DELETE_ON_ERROR:

include $(TOP)/py/mkrules.mk
3 changes: 0 additions & 3 deletions bricks/_common/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ PBIO_SRC_C = $(addprefix lib/pbio/,\
src/drivebase.c \
src/error.c \
src/geometry.c \
src/image/font_liberationsans_regular_14.c \
src/image/font_terminus_normal_16.c \
src/image/font_mono_8x5_8.c \
src/image/image.c \
src/imu.c \
src/int_math.c \
Expand Down
1 change: 1 addition & 0 deletions bricks/ev3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ PB_FROZEN_MODULES = 1
PB_LIB_UMM_MALLOC = 1
PB_LIB_BTSTACK = 1
PB_MEDIA = 1
PB_FONTS = 1

include ../_common/common.mk
1 change: 1 addition & 0 deletions bricks/nxt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ PBIO_PLATFORM = nxt
PB_MCU_FAMILY = AT91SAM7

PB_LIB_UMM_MALLOC = 1
PB_FONTS = 1

include ../_common/common.mk
1 change: 1 addition & 0 deletions bricks/virtualhub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ MICROPY_ROM_TEXT_COMPRESSION = 1
PB_LIB_UMM_MALLOC = 1
PB_LIB_BTSTACK = 1
PB_MEDIA = 1
PB_FONTS = 1

include ../_common/common.mk
34 changes: 0 additions & 34 deletions lib/pbio/src/image/Makefile

This file was deleted.

261 changes: 0 additions & 261 deletions lib/pbio/src/image/font_liberationsans_regular_14.c

This file was deleted.

Loading
Loading