Revert r24898 and fix yellow properly so that register is still read
[kugel-rb.git] / apps / lang / lang.make
blob1b006a7468c4a910f38c193b623a602dee63ae4a
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 LANG_O = $(BUILDDIR)/lang/lang_core.o
14 CLEANOBJS += $(BUILDDIR)/lang/max_language_size.h $(BUILDDIR)/lang/lang*
16 # $(BUILDDIR)/apps/lang must exist before we create dependencies on it,
17 # otherwise make will simply ignore those dependencies.
18 # Therefore we create it here.
19 #DUMMY := $(shell mkdir -p $(BUILDDIR)/apps/lang)
21 # Calculate the maximum language size. Currently based on the file size
22 # of the largest lng file. Subtract 10 due to HEADER_SIZE and
23 # SUBHEADER_SIZE.
24 # TODO: In the future generate this file within genlang or another script
25 # in order to only calculate the maximum size based on the core strings.
26 $(BUILDDIR)/lang/max_language_size.h: $(LANGOBJ)
27 $(call PRINTS,Create $(notdir $@))
28 $(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/* | awk '{print $$5-10}' | sort -n | tail -1`" > $@
30 $(BUILDDIR)/lang/lang_core.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
31 $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
32 perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
33 $(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
35 $(BUILDDIR)/lang/lang.h: $(BUILDDIR)/lang/lang_core.o
37 $(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
38 $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<))
39 $(SILENT)mkdir -p $(dir $@)
40 $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME)`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$@ $<