From b3113674819cd8daf44750d129c5d8298e830df0 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 5 Aug 2007 19:19:39 +0000 Subject: *** Lang v2 cleanup (FS#6574) *** 1) Introduces apps/features.txt that controls which strings are included for each target based on defines. 2) .lng and .voice files are now target specific and the format versions of both these file types have been bumped, which means that new voice files are needed. 3) Use the 'features' mechanism to exclude strings for targets that didn't use them. 4) Delete unused and deprecated and duplicated strings, sort strings in english.lang Some string IDs were changed so translations will be slightly worse than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14198 a1c6a512-1295-4272-9138-f99709370657 --- apps/Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'apps/Makefile') diff --git a/apps/Makefile b/apps/Makefile index 69de3a0f78..0b8f0ad304 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -90,6 +90,8 @@ $(DEPFILE): $(BITMAPLIBS) dep: $(DEPFILE) +features: $(OBJDIR)/features + build-codecs: $(SILENT)$(MAKE) -C codecs/lib OBJDIR=$(OBJDIR)/codecs/lib $(SILENT)$(MAKE) -C codecs OBJDIR=$(OBJDIR)/codecs @@ -195,9 +197,22 @@ $(BUILDDIR)/rombox.iriver: $(OBJDIR)/rombox.bin include $(TOOLSDIR)/make.inc -$(OBJDIR)/lang.o: lang/$(LANGUAGE).lang - @mkdir -p $(dir $@) - $(call PRINTS,GENLANG)perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(ARCHOS) $< +# apps/features.txt is a file that (is preprocessed and) lists named features +# based on defines in the config-*.h files. The named features will be passed +# to genlang and thus (translated) phrases can be used based on those names. +# button.h is included for the HAS_BUTTON_HOLD define. +# + +$(OBJDIR)/features: features.txt + $(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ + $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \ + grep -v "^\#" | grep -v "^$$" > $@; \ + echo "" >/dev/null + +$(OBJDIR)/lang.o: lang/$(LANGUAGE).lang $(OBJDIR)/features + $(SILENT)mkdir -p `dirname $@` + $(SILENT)for f in `cat $(OBJDIR)/features`; do feat="$$feat:$$f" ; done; \ + perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(ARCHOS):$$feat $< $(call PRINTS,CC lang.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@ clean: -- cgit v1.2.3