Updated makefile to match build.bat (build with e.g. 'make all lang=en')

Made small synt/func corrections in build.bat

git-svn-id: svn://kolibrios.org@467 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2007-04-20 03:21:48 +00:00
parent 17dcdac5d8
commit 69252dd603
5 changed files with 59 additions and 29 deletions

View File

@ -1,7 +1,7 @@
@echo off
set languages=en ru ge et
set drivers=sound sis infinity ati2d
set drivers=sound sis infinity ati2d vmode
set targets=all kernel drivers skins clean
call :Check_Target %1
@ -10,8 +10,8 @@ call :Target_%target%
if ERRORLEVEL 0 goto Exit_OK
echo Probably at runing has been created error
echo For help send a report...
echo There was an error executing script.
echo For any help, please send a report.
pause
goto :eof
@ -24,9 +24,8 @@ goto :eof
for %%a in (%languages%) do if %%a==%res% set lang=%res%
if defined lang goto :eof
echo Language "%res%" is not founded
echo Enter valide languege
echo [%languages%]
echo Language '%res%' is incorrect
echo Enter valid language [ %languages% ]:
set /P res=">
goto Check_Lang_loop
@ -38,9 +37,8 @@ goto :eof
for %%a in (%targets%) do if %%a==%res% set target=%res%
if defined target goto :eof
echo Target "%res%" is not valide
echo Enter valide target
echo [%targets%]
echo Target '%res%' is incorrect
echo Enter valid target [ %targets% ]:
set /P res=">
goto Check_Target_loop
@ -48,7 +46,7 @@ goto :eof
:Target_kernel
echo building kernel with language %lang% ...
echo *** building kernel with language '%lang%' ...
if not exist bin mkdir bin
echo lang fix %lang% > lang.inc
@ -59,7 +57,6 @@ goto :eof
:Target_all
echo building all ...
call :Target_kernel
call :Target_drivers
call :Target_skins
@ -67,7 +64,7 @@ goto :eof
:Target_drivers
echo building drivers ...
echo *** building drivers ...
if not exist bin\drivers mkdir bin\drivers
cd drivers
@ -76,11 +73,12 @@ goto :eof
if not %errorlevel%==0 goto :Error_FasmFailed
)
cd ..
move bin\drivers\vmode.obj bin\drivers\vmode.mdr
goto :eof
:Target_skins
echo building skins ...
echo *** building skins ...
if not exist bin\skins mkdir bin\skins
cd skin
@ -91,7 +89,7 @@ goto :eof
:Target_clean
echo cleaning ...
echo *** cleaning ...
del /Q bin\drivers\*.*
del /Q bin\skins\*.*

View File

@ -1,16 +1,48 @@
FASM=fasm
KSRC=kernel.asm
KOUT=kernel.mnt
FLAGS=-m 65536
languages=en|ru|ge|et
drivers_src=sound sis infinity ati2d vmode
skins_src=default
en: kernel.asm
rm -f lang.inc
echo lang fix en > lang.inc
$(FASM) $(KSRC) $(KOUT)
ru: kernel.asm
rm -f lang.inc
echo lang fix ru > lang.inc
$(FASM) $(KSRC) $(KOUT)
.PHONY: all kernel drivers skins clean
all: kernel drivers skins
kernel: check_lang
@echo "*** building kernel with language '$(lang)' ..."
@mkdir -p bin
@echo "lang fix $(lang)" > lang.inc
@echo "--- building 'bin/kernel.mnt' ..."
@$(FASM) $(FLAGS) kernel.asm bin/kernel.mnt
@rm -f lang.inc
drivers:
@echo "*** building drivers ..."
@mkdir -p bin/drivers
@cd drivers; for f in $(drivers_src); do \
echo "--- building 'bin/drivers/$${f}.obj' ..."; \
$(FASM) $(FLAGS) $${f}.asm ../bin/drivers/$${f}.obj; \
done
@mv bin/drivers/vmode.obj bin/drivers/vmode.mdr
skins:
@echo "*** building skins ..."
@mkdir -p bin/skins
@cd skin; for f in $(skins_src); do \
echo "--- building 'bin/skins/$${f}.skn' ..."; \
$(FASM) $(FLAGS) $${f}.asm ../bin/skins/$${f}.skn; \
done
check_lang:
@case "$(lang)" in \
$(languages)) \
;; \
*) \
echo "*** error: language is incorrect or not specified"; \
exit 1; \
;; \
esac
clean:
rm -f $(KOUT)
rm -rf bin
rm -f lang.inc