Index: tools/configure =================================================================== --- tools/configure (revision 16121) +++ tools/configure (working copy) @@ -1968,14 +1968,14 @@ # Do not print "Entering directory ..." MAKEFLAGS += --no-print-directory -.PHONY: all clean tags zip tools manual bin build info +.PHONY: all clean tags zip tools manual bin build info langs all: info info: build \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt -build: tools +build: tools langs @SIMUL1@ @SIMUL2@ \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware @@ -2001,7 +2001,7 @@ manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \ @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \ html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \ - voicefontids *.wav *.mp3 *.voice + voicefontids *.wav *.mp3 *.voice max_language_size.h tools: \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@ @@ -2045,6 +2045,10 @@ gzip: tar \$(SILENT)gzip -f9 rockbox.tar +langs: features + $(SILENT)mkdir -p $(BUILDDIR)/apps/lang + $(SILENT)$(MAKE) -C $(APPSDIR)/lang OBJDIR=$(BUILDDIR)/apps/lang + manual: manual-pdf manual-pdf: \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf Index: tools/buildzip.pl =================================================================== --- tools/buildzip.pl (revision 16121) +++ tools/buildzip.pl (working copy) @@ -154,21 +154,6 @@ return $size; } -sub buildlangs { - my ($outputlang)=@_; - my $dir = "$ROOT/apps/lang"; - opendir(DIR, $dir); - my @files = grep { /\.lang$/ } readdir(DIR); - closedir(DIR); - - for(@files) { - my $output = $_; - $output =~ s/(.*)\.lang/$1.lng/; - print "$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_\n" if($verbose); - system ("$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_ >/dev/null 2>&1"); - } -} - sub buildzip { my ($zip, $image, $fonts)=@_; @@ -404,16 +389,8 @@ # and the info file system("cp rockbox-info.txt .rockbox/"); - # now copy the file made for reading on the unit: - #if($notplayer) { - # `cp $webroot/docs/Help-JBR.txt .rockbox/docs/`; - #} - #else { - # `cp $webroot/docs/Help-Stu.txt .rockbox/docs/`; - #} + `cp apps/lang/*lng .rockbox/langs/` - buildlangs(".rockbox/langs"); - } my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = Index: apps/language.h =================================================================== --- apps/language.h (revision 16121) +++ apps/language.h (working copy) @@ -1,3 +1,5 @@ +#ifndef __LANGUAGE_H +#define __LANGUAGE_H /*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ @@ -7,7 +9,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2002 Daniel Stenberg + * Copyright (C) 2002, 2008 Daniel Stenberg * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. @@ -17,6 +19,11 @@ * ****************************************************************************/ +/* The following header is generated by the build system and only defines + MAX_LANGUAGE_SIZE to be the size of the largest currently available + language! */ +//#include "max_language_size.h" + /* size of the buffer used for loadable, translated strings */ #define MAX_LANGUAGE_SIZE 23500 @@ -29,3 +36,5 @@ /* load a given language file */ int lang_load(const char *filename); + +#endif Index: apps/Makefile =================================================================== --- apps/Makefile (revision 16121) +++ apps/Makefile (working copy) @@ -218,7 +218,8 @@ $(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \ grep -v "^\#" | grep -v "^$$" > $@; \ - echo "" >/dev/null + for f in `cat $(OBJDIR)/features`; do feat="$$feat:$$f" ; done ; \ + echo "$$feat" >$(OBJDIR)/genlang-features $(OBJDIR)/lang.o: lang/$(LANGUAGE).lang $(OBJDIR)/features $(SILENT)for f in `cat $(OBJDIR)/features`; do feat="$$feat:$$f" ; done; \ Index: apps/lang/Makefile =================================================================== --- apps/lang/Makefile (revision 0) +++ apps/lang/Makefile (revision 0) @@ -0,0 +1,36 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id: Makefile 15615 2007-11-14 10:31:57Z jethead71 $ +# + +# the header we generate +HEADER = $(BUILDDIR)/max_language_size.h + +# get all input files with wildcard to easily support newly added ones +SOURCES = $(wildcard *.lang) + +# OUTP is the list of files to depend upon +OUTP = $(patsubst %.lang,$(OBJDIR)/%.lng, $(SOURCES)) + +# the generated file with features specified genlang-style +FEATS=$(BUILDDIR)/apps/genlang-features + +ifndef V +SILENT=@ +endif +PRINTS=$(SILENT)$(call info,$(1)) + +all: $(HEADER) + +# generic rule for creating .lng from .lang +$(OBJDIR)/%.lng : %.lang $(FEATS) + $(call PRINTS,GENLANG $<) + $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(ARCHOS)`cat $(FEATS)` -i=$(TARGET_ID) -b=$@ $< + +$(HEADER): $(OUTP) + $(call PRINTS,Make $(HEADER)) + echo "#define MAX_LANGUAGE_SIZE `du -b $(OBJDIR)/* |sort -n |tail -n 1 |cut -f 1`" > $(HEADER)