rockbox/tools/checkwps/checkwps.make
Solomon Peachy 9d3d2c6e67 checkwps: validate themes against builtin cabbiev2 assets
Themes for a given device often reference the assets of the default
cabbiev2 theme.  Record a list of what is bundled, and check anything
not included with the theme against that list.

If something is still missing, then that's an error.

This applies to fonts, wps files, backdrops, icons, and so forth.

Change-Id: I5ff7feaae892c8b9a81c2cb3035879672f3e6c29
2026-10-06 23:24:34 -04:00

87 lines
3.5 KiB
Makefile

# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
ENGLISH := english
# Use global GCCOPTS
GCCOPTS += -D__PCTOOL__ -DCHECKWPS
CHECKWPS_SRC = $(call preprocess, $(TOOLSDIR)/checkwps/SOURCES)
CHECKWPS_OBJ = $(call c2obj,$(CHECKWPS_SRC)) $(BUILDDIR)/lang/lang_core.o
OTHER_SRC += $(CHECKWPS_SRC)
INCLUDES = -I$(ROOTDIR)/apps/gui \
-I$(ROOTDIR)/apps/gui/skin_engine \
-I$(FIRMDIR)/kernel/include \
-I$(ROOTDIR)/firmware/export \
-I$(ROOTDIR)/firmware/include \
-I$(ROOTDIR)/firmware/target/hosted \
-I$(ROOTDIR)/firmware/target/hosted/sdl \
-I$(ROOTDIR)/apps \
-I$(ROOTDIR)/apps/recorder \
-I$(ROOTDIR)/apps/radio \
-I$(ROOTDIR)/lib/rbcodec \
-I$(ROOTDIR)/lib/rbcodec/metadata \
-I$(ROOTDIR)/lib/rbcodec/dsp \
-I$(APPSDIR) \
-I$(BUILDDIR) \
-I$(BUILDDIR)/lang \
$(TARGET_INC)
.SECONDEXPANSION: # $$(OBJ) is not populated until after this
$(BUILDDIR)/$(BINARY): $$(CHECKWPS_OBJ) $$(CORE_LIBS)
@echo LD $(BINARY)
$(SILENT)$(HOSTCC) -o $@ $+ $(INCLUDE) $(GCCOPTS) \
-L$(BUILDDIR)/lib $(call a2lnk,$(CORE_LIBS))
$(BUILDDIR)/fontbundle.h: $(ROOTDIR)/fonts/*bdf
@echo FONTBUNDLE
$(SILENT)echo "static const unsigned char* bundledfonts[] = {" > $@
$(SILENT)ls $(ROOTDIR)/fonts/*bdf | perl -pne 's|.*/(\d+-.*)\.bdf| "$$1",|;' >> $@
$(SILENT)echo " NULL, " >> $@
$(SILENT)echo "};" >> $@
$(BUILDDIR)/themeassets.h: $(ROOTDIR)/firmware/export/config/$(MODELNAME).h $(ROOTDIR)/wps/WPSLIST
@echo THEMEASSETS
$(SILENT)rm -Rf $(BUILDDIR)/.rockbox
$(SILENT)mkdir $(BUILDDIR)/.rockbox
$(SILENT)echo "static const unsigned char* themeassets[] = {" > $@
$(SILENT)$(ROOTDIR)/wps/wpsbuild.pl $(ROOTDIR)/wps/WPSLIST $(TARGET) > /dev/null 2>&1
$(SILENT)find $(BUILDDIR)/.rockbox -type f | perl -pne 's|.*/(\S+)\.\S+| "$$1",|;' >> $@
$(SILENT)echo " NULL, " >> $@
$(SILENT)echo "};" >> $@
$(SILENT)rm -Rf $(BUILDDIR)/.rockbox
#### Everything below is hacked in from apps.make and lang.make
$(BUILDDIR)/apps/features: $(ROOTDIR)/apps/features.txt
$(SILENT)mkdir -p $(BUILDDIR)/apps
$(SILENT)mkdir -p $(BUILDDIR)/lang
$(call PRINTS,PP $(<F))
$(SILENT)$(CC) $(PPCFLAGS) \
-E -P -imacros "config.h" -imacros "button.h" -x c $< | \
grep -v "^#" | grep -v "^ *$$" > $(BUILDDIR)/apps/features; \
$(BUILDDIR)/apps/genlang-features: $(BUILDDIR)/apps/features
$(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))tr \\n : < $< > $@
$(BUILDDIR)/lang_enum.h: $(BUILDDIR)/lang/lang.h $(TOOLSDIR)/genlang
$(BUILDDIR)/lang/lang.h: $(ROOTDIR)/apps/lang/$(ENGLISH).lang $(BUILDDIR)/apps/features $(TOOLSDIR)/genlang $(BUILDDIR)/apps/genlang-features
$(call PRINTS,GEN lang.h)
$(SILENT)$(TOOLSDIR)/genlang -e=$(ROOTDIR)/apps/lang/$(ENGLISH).lang -p=$(BUILDDIR)/lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` $<
$(BUILDDIR)/lang/lang_core.c: $(BUILDDIR)/lang/lang.h $(TOOLSDIR)/genlang
$(BUILDDIR)/lang/lang_core.o: $(BUILDDIR)/lang/lang.h $(BUILDDIR)/lang/lang_core.c
$(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
$(BUILDDIR)/lang/max_language_size.h: $(BUILDDIR)/lang/lang.h
$(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))
$(SILENT)echo "#define MAX_LANGUAGE_SIZE 131072" > $@