diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-05-23 21:36:54 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-05-24 21:37:54 -0400 |
commit | 8b8c0c7c2ac40cd729a9eeb39189c184978b6d57 (patch) | |
tree | 09ab71d2b8f13ae47960d5508a5afd3ac135e588 /tools/checkwps/checkwps.make | |
parent | ac20f8a73c9898ab66e176ab66f3ef89bb76692d (diff) | |
download | rockbox-8b8c0c7c2ac40cd729a9eeb39189c184978b6d57.tar.gz rockbox-8b8c0c7c2ac40cd729a9eeb39189c184978b6d57.zip |
checkwps: Validate translated strings (%Sx)
In verbose mode it will log valid the strings found, otherwise it will
only complain when we encounter a missing string.
Unfortunately a missing string is not inherently a problem, due to
conditional expressions. So all we can do is complain in checkwps
or if wps debugging is turned on.
Meanwhile, this is the first step in actually enumerating the translated
strings used by themes.
Change-Id: Ia93b333085e825d5b085c4d372ad8e13aa3e3ba1
Diffstat (limited to 'tools/checkwps/checkwps.make')
-rw-r--r-- | tools/checkwps/checkwps.make | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/tools/checkwps/checkwps.make b/tools/checkwps/checkwps.make index 3004bbc2ed..ce02ce3ffd 100644 --- a/tools/checkwps/checkwps.make +++ b/tools/checkwps/checkwps.make | |||
@@ -4,14 +4,14 @@ | |||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
6 | # \/ \/ \/ \/ \/ | 6 | # \/ \/ \/ \/ \/ |
7 | # $Id$ | 7 | |
8 | # | 8 | ENGLISH := english |
9 | 9 | ||
10 | # Use global GCCOPTS | 10 | # Use global GCCOPTS |
11 | GCCOPTS += -D__PCTOOL__ -DCHECKWPS | 11 | GCCOPTS += -D__PCTOOL__ -DCHECKWPS |
12 | 12 | ||
13 | CHECKWPS_SRC = $(call preprocess, $(TOOLSDIR)/checkwps/SOURCES) | 13 | CHECKWPS_SRC = $(call preprocess, $(TOOLSDIR)/checkwps/SOURCES) |
14 | CHECKWPS_OBJ = $(call c2obj,$(CHECKWPS_SRC)) | 14 | CHECKWPS_OBJ = $(call c2obj,$(CHECKWPS_SRC)) $(BUILDDIR)/lang/lang_core.o |
15 | 15 | ||
16 | OTHER_SRC += $(CHECKWPS_SRC) | 16 | OTHER_SRC += $(CHECKWPS_SRC) |
17 | 17 | ||
@@ -29,7 +29,9 @@ INCLUDES = -I$(ROOTDIR)/apps/gui \ | |||
29 | -I$(ROOTDIR)/lib/rbcodec/metadata \ | 29 | -I$(ROOTDIR)/lib/rbcodec/metadata \ |
30 | -I$(ROOTDIR)/lib/rbcodec/dsp \ | 30 | -I$(ROOTDIR)/lib/rbcodec/dsp \ |
31 | -I$(APPSDIR) \ | 31 | -I$(APPSDIR) \ |
32 | -I$(BUILDDIR) | 32 | -I$(BUILDDIR) \ |
33 | -I$(BUILDDIR)/lang \ | ||
34 | $(TARGET_INC) | ||
33 | 35 | ||
34 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this | 36 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this |
35 | 37 | ||
@@ -37,3 +39,32 @@ $(BUILDDIR)/$(BINARY): $$(CHECKWPS_OBJ) $$(CORE_LIBS) | |||
37 | @echo LD $(BINARY) | 39 | @echo LD $(BINARY) |
38 | $(SILENT)$(HOSTCC) -o $@ $+ $(INCLUDE) $(GCCOPTS) \ | 40 | $(SILENT)$(HOSTCC) -o $@ $+ $(INCLUDE) $(GCCOPTS) \ |
39 | -L$(BUILDDIR)/lib $(call a2lnk,$(CORE_LIBS)) | 41 | -L$(BUILDDIR)/lib $(call a2lnk,$(CORE_LIBS)) |
42 | |||
43 | #### Everything below is hacked in from apps.make and lang.make | ||
44 | |||
45 | $(BUILDDIR)/apps/features: $(ROOTDIR)/apps/features.txt | ||
46 | $(SILENT)mkdir -p $(BUILDDIR)/apps | ||
47 | $(SILENT)mkdir -p $(BUILDDIR)/lang | ||
48 | $(call PRINTS,PP $(<F)) | ||
49 | $(SILENT)$(CC) $(PPCFLAGS) \ | ||
50 | -E -P -imacros "config.h" -imacros "button.h" -x c $< | \ | ||
51 | grep -v "^#" | grep -v "^ *$$" > $(BUILDDIR)/apps/features; \ | ||
52 | |||
53 | $(BUILDDIR)/apps/genlang-features: $(BUILDDIR)/apps/features | ||
54 | $(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))tr \\n : < $< > $@ | ||
55 | |||
56 | $(BUILDDIR)/lang_enum.h: $(BUILDDIR)/lang/lang.h $(TOOLSDIR)/genlang | ||
57 | |||
58 | $(BUILDDIR)/lang/lang.h: $(ROOTDIR)/apps/lang/$(ENGLISH).lang $(BUILDDIR)/apps/features $(TOOLSDIR)/genlang | ||
59 | $(call PRINTS,GEN lang.h) | ||
60 | $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ | ||
61 | perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< | ||
62 | |||
63 | $(BUILDDIR)/lang/lang_core.c: $(BUILDDIR)/lang/lang.h $(TOOLSDIR)/genlang | ||
64 | |||
65 | $(BUILDDIR)/lang/lang_core.o: $(BUILDDIR)/lang/lang.h $(BUILDDIR)/lang/lang_core.c | ||
66 | $(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@ | ||
67 | |||
68 | $(BUILDDIR)/lang/max_language_size.h: $(BUILDDIR)/lang/lang.h | ||
69 | $(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@)) | ||
70 | $(SILENT)echo "#define MAX_LANGUAGE_SIZE 131072" > $@ | ||