From f26b504bd1825894471ac8579161f493abe86900 Mon Sep 17 00:00:00 2001 From: Thatcher Chamberlin Date: Fri, 17 Feb 2023 23:14:50 -0500 Subject: [PATCH] Add LANG variable to Makefile to select language file --- Makefile | 10 ++++++++++ services/bt_app/Makefile | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1e82a74..942fb4a 100644 --- a/Makefile +++ b/Makefile @@ -195,6 +195,16 @@ $(error Invalid target: T=$(T)) endif export T +# Select sound language +LANGUAGE_SOUND_FOLDER = config/_default_cfg_src_/res/$(LANG) +ifeq ($(LANG),) +$(error Please specify the sound language in the command line: LANG=) +endif +ifeq ($(wildcard $(LANGUAGE_SOUND_FOLDER)),) +$(error Invalid target: LANG=$(LANG)) +endif +export LANG + KBUILD_OUTPUT := $(KBUILD_OUTPUT)/$(T) # That's our default target when none is given on the command line diff --git a/services/bt_app/Makefile b/services/bt_app/Makefile index 684c540..e74116e 100644 --- a/services/bt_app/Makefile +++ b/services/bt_app/Makefile @@ -9,8 +9,7 @@ ifeq ($(VOICE_DATAPATH_TYPE),gsound) obj_cpp += $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)/app_voice/app_$(VOICE_DATAPATH_TYPE)/*.cpp)) endif -obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/en/*.mp3)) -obj_mp3 += $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/cn/*.mp3)) +obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/$(LANG)/*.mp3)) obj-y := $(obj_mp3:.mp3=.snd.o) $(obj_mp3:.mp3=.snd.cpp) $(obj_c:.c=.o) $(obj_s:.S=.o) $(obj_cpp:.cpp=.o)