Skip to content

Commit

Permalink
Рефакторинг сборки префиксов (4) — стилевые правки (#261, #87)
Browse files Browse the repository at this point in the history
В файле make.sh устраняются предупреждения ShellCheck. Файл make.bat
переписан параллельно с make.sh.

Относительный путь к корню абстрагирован в переменной ROOT.
  • Loading branch information
Mazdaywik committed Feb 4, 2020
1 parent 8fea616 commit 565630c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 33 deletions.
36 changes: 17 additions & 19 deletions src/lib-prefixes/make.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
@echo off
setlocal
set SCRIPT_FLAGS=--scratch --static
set DEBUG=
call :MAKE_PREFIXES
goto :MAIN

set SCRIPT_FLAGS=--scratch --static --debug
set DEBUG=-debug
call :MAKE_PREFIXES
:CALL_SRMAKE
call %ROOT%\bin\srmake --scratch --static %*
goto :EOF

if exist *.obj erase *.obj
if exist ..\..\lib\*.tds erase ..\..\lib\*.tds
endlocal
:CALL_SRMAKE_DEBUG
call %ROOT%\bin\srmake --scratch --static --debug %*
goto :EOF

:MAKE_PREFIXES
setlocal
call ..\..\bin\srmake %SCRIPT_FLAGS% rich-prefix-exe ^
-o ..\..\lib\rich%DEBUG%.exe-prefix
call :%1 rich-prefix-exe -o %ROOT%\lib\rich%2.exe-prefix
call :%1 slim-prefix-exe -o %ROOT%\lib\slim%2.exe-prefix
call :%1 --makelib rich-prefix-lib -o %ROOT%\lib\rich%2.lib-prefix
goto :EOF

call ..\..\bin\srmake %SCRIPT_FLAGS% slim-prefix-exe ^
-o ..\..\lib\slim%DEBUG%.exe-prefix
:MAIN
set ROOT=..\..

call ..\..\bin\srmake %SCRIPT_FLAGS% --makelib rich-prefix-lib ^
-o ..\..\lib\rich%DEBUG%.lib-prefix
endlocal
goto :EOF
call :MAKE_PREFIXES CALL_SRMAKE ""
call :MAKE_PREFIXES CALL_SRMAKE_DEBUG "-debug"

if exist *.obj erase *.obj
if exist %ROOT%\lib\*.tds erase %ROOT%\lib\*.tds
24 changes: 10 additions & 14 deletions src/lib-prefixes/make.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#!/bin/bash

SRMAKE_FLAGS=${SRMAKE_FLAGS}
ROOT=../..

make_prefixes() {
DEBUG=$1

../../bin/srmake ${SCRIPT_FLAGS} rich-prefix-exe \
-o ../../lib/rich"$DEBUG".exe-prefix
call_srmake() { "$ROOT"/bin/srmake --scratch --static "$@"; }
call_srmake_debug() { "$ROOT"/bin/srmake --scratch --static --debug "$@"; }

../../bin/srmake ${SCRIPT_FLAGS} slim-prefix-exe \
-o ../../lib/slim"$DEBUG".exe-prefix

../../bin/srmake ${SCRIPT_FLAGS} --makelib rich-prefix-lib \
-o ../../lib/rich"$DEBUG".lib-prefix
make_prefixes() {
"$1" rich-prefix-exe -o "$ROOT"/lib/rich"$2".exe-prefix
"$1" slim-prefix-exe -o "$ROOT"/lib/slim"$2".exe-prefix
"$1" --makelib rich-prefix-lib -o "$ROOT"/lib/rich"$2".lib-prefix
}

SCRIPT_FLAGS="--scratch --static" make_prefixes ""
SCRIPT_FLAGS="--scratch --static --debug" make_prefixes "-debug"
chmod -x ../../lib/*.*-prefix
make_prefixes call_srmake ""
make_prefixes call_srmake_debug "-debug"
chmod -x "$ROOT"/lib/*.*-prefix

0 comments on commit 565630c

Please sign in to comment.