LANG -> AUDIO

This commit is contained in:
Thatcher Chamberlin 2023-02-19 14:36:52 -05:00
parent e9ddfd6c4a
commit 90cd88f1a8
4 changed files with 13 additions and 13 deletions

View File

@ -195,15 +195,15 @@ $(error Invalid target: T=$(T))
endif endif
export T export T
# Select sound language # Select audio source
LANGUAGE_SOUND_FOLDER = config/_default_cfg_src_/res/$(LANG) AUDIO_FOLDER = config/_default_cfg_src_/res/$(AUDIO)
ifeq ($(LANG),) ifeq ($(AUDIO),)
$(error Please specify the sound language in the command line: LANG=<languageAbbrev>) $(error Please specify the sound language in the command line: AUDIO=<audioName>)
endif endif
ifeq ($(wildcard $(LANGUAGE_SOUND_FOLDER)),) ifeq ($(wildcard $(AUDIO_FOLDER)),)
$(error Invalid target: LANG=$(LANG)) $(error Invalid target: AUDIO=$(AUDIO))
endif endif
export LANG export AUDIO
KBUILD_OUTPUT := $(KBUILD_OUTPUT)/$(T) KBUILD_OUTPUT := $(KBUILD_OUTPUT)/$(T)

View File

@ -81,10 +81,10 @@ and recompile with `./build.sh`!
### Language support ### Language support
The `LANG` environment variable can be set when running the `build.sh` script to load sound files The `AUDIO` environment variable can be set when running the `build.sh` script to load sound files
for languages other than the default English. For example, running `LANG=cn ./build.sh` will load sounds files from for languages other than the default English. For example, running `AUDIO=cn ./build.sh` will load sounds files from
`config/_default_cfg_src_/res/cn/` instead of the default `en/` folder. `config/_default_cfg_src_/res/cn/` instead of the default `en/` folder.
The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages
(or other sets of custom sounds) may be added by adding all the correct sound files into a (or other sets of custom sounds) may be added by adding all the correct sound files into a
`config/_default_cfg_src_/res/<custom_language>/` directory and building with `LANG=<custom_language> ./build.sh`. `config/_default_cfg_src_/res/<custom_sounds>/` directory and building with `AUDIO=<custom_sounds> ./build.sh`.

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# use LANG environment variable, default to "en" # use AUDIO environment variable, default to "en"
LANG="${LANG:-en}" AUDIO="${AUDIO:-en}"
make -j T=open_source DEBUG=1 >log.txt 2>&1 make -j T=open_source DEBUG=1 >log.txt 2>&1

View File

@ -9,7 +9,7 @@ ifeq ($(VOICE_DATAPATH_TYPE),gsound)
obj_cpp += $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)/app_voice/app_$(VOICE_DATAPATH_TYPE)/*.cpp)) obj_cpp += $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)/app_voice/app_$(VOICE_DATAPATH_TYPE)/*.cpp))
endif endif
obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/$(LANG)/*.mp3)) obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/$(AUDIO)/*.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) obj-y := $(obj_mp3:.mp3=.snd.o) $(obj_mp3:.mp3=.snd.cpp) $(obj_c:.c=.o) $(obj_s:.S=.o) $(obj_cpp:.cpp=.o)