Prepare new maemo release
[maemo-rb.git] / apps / lang / lang.make
blob70629f52f383f7074d0ce05fa30b03d9b9696a06
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES)
11 LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng)
12 VOICEOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.vstrings)
13 LANG_O = $(BUILDDIR)/lang/lang_core.o
15 CLEANOBJS += $(BUILDDIR)/lang/max_language_size.h $(BUILDDIR)/lang/lang*
17 # $(BUILDDIR)/apps/lang must exist before we create dependencies on it,
18 # otherwise make will simply ignore those dependencies.
19 # Therefore we create it here.
20 #DUMMY := $(shell mkdir -p $(BUILDDIR)/apps/lang)
22 # Calculate the maximum language size. Currently based on the file size
23 # of the largest lng file. Subtract 10 due to HEADER_SIZE and
24 # SUBHEADER_SIZE.
25 # TODO: In the future generate this file within genlang or another script
26 # in order to only calculate the maximum size based on the core strings.
27 $(BUILDDIR)/lang/max_language_size.h: $(LANGOBJ) $(BUILDDIR)/apps/lang/voicestrings.zip
28 $(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))
29 $(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/*.lng | awk '{print $$5-10}' | sort -n | tail -1`" > $@
31 $(BUILDDIR)/lang/lang_core.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
32 $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
33 perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
34 $(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
36 $(BUILDDIR)/lang/lang.h: $(BUILDDIR)/lang/lang_core.o
38 $(BUILDDIR)/%.lng $(BUILDDIR)/%.vstrings: $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
39 $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<))
40 $(SILENT)mkdir -p $(dir $@)
41 $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$*.lng -c=$*.vstrings $<
43 $(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ)
44 $(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@))
45 $(SILENT)zip -9 -q $@ $(subst $(BUILDDIR)/,,$^)