2008-11-20 11:27:31 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2008-11-25 19:54:23 +00:00
|
|
|
# $Id$
|
2008-11-20 11:27:31 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES)
|
|
|
|
LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng)
|
2009-03-02 06:13:18 +00:00
|
|
|
LANG_O = $(BUILDDIR)/lang/lang_core.o
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 06:13:18 +00:00
|
|
|
CLEANOBJS += $(BUILDDIR)/lang/max_language_size.h $(BUILDDIR)/lang/lang*
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
# $(BUILDDIR)/apps/lang must exist before we create dependencies on it,
|
|
|
|
# otherwise make will simply ignore those dependencies.
|
|
|
|
# Therefore we create it here.
|
|
|
|
#DUMMY := $(shell mkdir -p $(BUILDDIR)/apps/lang)
|
|
|
|
|
2009-10-18 00:56:42 +00:00
|
|
|
# Calculate the maximum language size. Currently based on the file size
|
|
|
|
# of the largest lng file. Subtract 10 due to HEADER_SIZE and
|
|
|
|
# SUBHEADER_SIZE.
|
|
|
|
# TODO: In the future generate this file within genlang or another script
|
|
|
|
# in order to only calculate the maximum size based on the core strings.
|
2009-03-02 06:13:18 +00:00
|
|
|
$(BUILDDIR)/lang/max_language_size.h: $(LANGOBJ)
|
2008-11-20 11:27:31 +00:00
|
|
|
$(call PRINTS,Create $(notdir $@))
|
2009-10-18 00:56:42 +00:00
|
|
|
$(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/* | awk '{print $$5-10}' | sort -n | tail -1`" > $@
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 06:13:18 +00:00
|
|
|
$(BUILDDIR)/lang/lang_core.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
|
2008-11-20 11:27:31 +00:00
|
|
|
$(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
|
|
|
|
perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
|
2009-03-02 06:13:18 +00:00
|
|
|
$(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2010-01-17 13:03:10 +00:00
|
|
|
$(BUILDDIR)/lang/lang.h: $(BUILDDIR)/lang/lang_core.o
|
|
|
|
|
2008-11-20 11:27:31 +00:00
|
|
|
$(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
|
|
|
|
$(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<))
|
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2010-07-13 18:19:33 +00:00
|
|
|
$(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$@ $<
|