forked from len0rd/rockbox
Move generated lang-related files to their own directory in preparation of localizable plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20170 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2d8813e26b
commit
4fb5864a6c
6 changed files with 18 additions and 17 deletions
|
@ -17,6 +17,7 @@ SRC += $(call preprocess, $(APPSDIR)/SOURCES)
|
|||
#
|
||||
features $(BUILDDIR)/apps/features $(BUILDDIR)/apps/genlang-features: $(APPSDIR)/features.txt
|
||||
$(SILENT)mkdir -p $(BUILDDIR)/apps
|
||||
$(SILENT)mkdir -p $(BUILDDIR)/lang
|
||||
$(call PRINTS,PP $(<F))
|
||||
$(SILENT)$(CC) $(PPCFLAGS) \
|
||||
-E -P -imacros "config.h" -imacros "button.h" -x c $< | \
|
||||
|
|
|
@ -9,23 +9,23 @@
|
|||
|
||||
LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES)
|
||||
LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng)
|
||||
LANG_O = $(BUILDDIR)/lang.o
|
||||
LANG_O = $(BUILDDIR)/lang/lang_core.o
|
||||
|
||||
CLEANOBJS += $(BUILDDIR)/max_language_size.h $(BUILDDIR)/lang.*
|
||||
CLEANOBJS += $(BUILDDIR)/lang/max_language_size.h $(BUILDDIR)/lang/lang*
|
||||
|
||||
# $(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)
|
||||
|
||||
$(BUILDDIR)/max_language_size.h: $(LANGOBJ)
|
||||
$(BUILDDIR)/lang/max_language_size.h: $(LANGOBJ)
|
||||
$(call PRINTS,Create $(notdir $@))
|
||||
$(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/* | awk '{print $$5}' | sort -n | tail -1`" > $@
|
||||
|
||||
$(BUILDDIR)/lang.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
|
||||
$(BUILDDIR)/lang/lang_core.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
|
||||
$(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
|
||||
perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
|
||||
$(call PRINTS,CC lang.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@
|
||||
$(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
|
||||
|
||||
$(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
|
||||
$(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<))
|
||||
|
|
|
@ -32,9 +32,9 @@ c2obj = $(addsuffix .o,$(basename $(subst $(ROOTDIR),$(BUILDDIR),$(1))))
|
|||
mkdepfile = $(shell \
|
||||
$(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h $(2) | \
|
||||
$(TOOLSDIR)/addtargetdir.pl $(ROOTDIR) $(BUILDDIR) | \
|
||||
sed -e "s: lang.h: $(BUILDDIR)/lang.o:" \
|
||||
sed -e "s: lang.h: $(BUILDDIR)/lang/lang_core.o:" \
|
||||
-e "s: sysfont.h: $(BUILDDIR)/sysfont.h:" \
|
||||
-e "s: max_language_size.h: $(BUILDDIR)/max_language_size.h:" \
|
||||
-e "s: max_language_size.h: $(BUILDDIR)/lang/max_language_size.h:" \
|
||||
-e "s: bitmaps/: $(BUILDDIR)/bitmaps/:g" \
|
||||
-e "s: pluginbitmaps/: $(BUILDDIR)/pluginbitmaps/:g" \
|
||||
-e "s: lib/: $(APPSDIR)/plugins/lib/:g" \
|
||||
|
|
|
@ -535,13 +535,13 @@ if ($sortfile) {
|
|||
if($prefix) {
|
||||
# We create a .c and .h file
|
||||
|
||||
open(HFILE, ">$prefix.h") ||
|
||||
die "Error: couldn't create file $prefix.h\n";
|
||||
open(CFILE, ">$prefix.c") ||
|
||||
die "Error: couldn't create file $prefix.c\n";
|
||||
open(HFILE, ">$prefix/lang.h") ||
|
||||
die "Error: couldn't create file $prefix/lang.h\n";
|
||||
open(CFILE, ">$prefix/lang_core.c") ||
|
||||
die "Error: couldn't create file $prefix/lang_core.c\n";
|
||||
|
||||
# get header file name
|
||||
$headername = "$prefix.h";
|
||||
$headername = "$prefix/lang.h";
|
||||
$headername =~ s/(.*\/)*//;
|
||||
|
||||
print HFILE <<MOO
|
||||
|
|
|
@ -17,7 +17,7 @@ $(OBJDIR)/%.o: %.S
|
|||
# errors/warnings to cause an error code to get returned and thus stop the
|
||||
# build
|
||||
#
|
||||
# This script checks for the presence of $(BUILDDIR)/lang.h and if it doesn't
|
||||
# This script checks for the presence of $(BUILDDIR)/lang/lang.h and if it doesn't
|
||||
# alreay exist, it is created. This is because lots of files include this
|
||||
# *generated* file and if it doesn't exist when we generate the deps it is no
|
||||
# good. There's a -MG compiler option to cover for this case, but it doesn't
|
||||
|
@ -45,7 +45,7 @@ $(DEPFILE): $(SOURCES)
|
|||
rm $$del; \
|
||||
del=""; \
|
||||
fi \
|
||||
done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" \
|
||||
done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang/lang_core.o:" \
|
||||
-e "s:[^[:space:]]*sysfont.h:$(BUILDDIR)/sysfont.h:" \
|
||||
-e "s:[^[:space:]]*max_language_size.h:$(BUILDDIR)/max_language_size.h:" \
|
||||
-e "s: bitmaps/: $(BUILDDIR)/bitmaps/:g" \
|
||||
|
|
|
@ -13,7 +13,7 @@ DEFINES = -DROCKBOX -DMEMORYSIZE=$(MEMORYSIZE) -DMEM=$(MEMORYSIZE) $(TARGET) \
|
|||
-DTARGET_ID=$(TARGET_ID) -DTARGET_NAME=\"$(MODELNAME)\" \
|
||||
-DAPPSVERSION=\"$(VERSION)\" $(BUILDDATE) \
|
||||
$(EXTRA_DEFINES) # <-- -DSIMULATOR or not
|
||||
INCLUDES = -I$(BUILDDIR) $(TARGET_INC)
|
||||
INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC)
|
||||
|
||||
CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
|
||||
PPCFLAGS = $(filter-out -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
|
||||
|
@ -97,11 +97,11 @@ veryclean: clean
|
|||
clean:
|
||||
$(SILENT)echo Cleaning build directory
|
||||
$(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \
|
||||
rockbox.tar.bz2 TAGS apps firmware comsim sim lang.[ch] \
|
||||
rockbox.tar.bz2 TAGS apps firmware comsim sim lang \
|
||||
manual *.pdf *.a credits.raw rockbox.ipod bitmaps \
|
||||
pluginbitmaps UI256.bmp rockbox-full.zip html txt \
|
||||
rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids \
|
||||
*.wav *.mp3 *.voice max_language_size.h $(CLEANOBJS) \
|
||||
*.wav *.mp3 *.voice $(CLEANOBJS) \
|
||||
$(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin \
|
||||
make.dep rombox.elf rombox.map rombox.bin rombox.ucl romstart.txt \
|
||||
$(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue