update build_package.bat by using a subrouting
This commit is contained in:
@@ -1,31 +1,32 @@
|
||||
@ECHO OFF
|
||||
MKDIR bin\dll bin\static bin\example bin\include
|
||||
SET CpyError=
|
||||
COPY tests\fullbench.c bin\example\ || (SET CpyError=%CpyError% tests\fullbench.c)
|
||||
COPY programs\datagen.c bin\example\ || (SET CpyError=%CpyError% programs\datagen.c)
|
||||
COPY programs\datagen.h bin\example\ || (SET CpyError=%CpyError% programs\datagen.h)
|
||||
COPY programs\util.h bin\example\ || (SET CpyError=%CpyError% programs\util.h)
|
||||
COPY programs\platform.h bin\example\ || (SET CpyError=%CpyError% programs\platform.h)
|
||||
COPY lib\common\mem.h bin\example\ || (SET CpyError=%CpyError% lib\common\mem.h)
|
||||
COPY lib\common\zstd_internal.h bin\example\ || (SET CpyError=%CpyError% lib\common\zstd_internal.h)
|
||||
COPY lib\common\error_private.h bin\example\ || (SET CpyError=%CpyError% lib\common\error_private.h)
|
||||
COPY lib\common\xxhash.h bin\example\ || (SET CpyError=%CpyError% lib\common\xxhash.h)
|
||||
COPY lib\libzstd.a bin\static\libzstd_static.lib || (SET CpyError=%CpyError% lib\libzstd.a)
|
||||
COPY lib\dll\libzstd.* bin\dll\ || (SET CpyError=%CpyError% lib\dll\libzstd.*)
|
||||
COPY lib\dll\example\Makefile bin\example\ || (SET CpyError=%CpyError% lib\dll\example\Makefile)
|
||||
COPY lib\dll\example\fullbench-dll.* bin\example\ || (SET CpyError=%CpyError% lib\dll\example\fullbench)
|
||||
COPY lib\dll\example\README.md bin\ || (SET CpyError=%CpyError% lib\dll\example\README.md)
|
||||
COPY lib\zstd.h bin\include\ || (SET CpyError=%CpyError% lib\zstd.h)
|
||||
COPY lib\zstd_errors.h bin\include\ || (SET CpyError=%CpyError% lib\zstd_errors.h)
|
||||
COPY lib\dictBuilder\zdict.h bin\include\ || (SET CpyError=%CpyError% lib\dictBuilder\zdict.h)
|
||||
COPY programs\zstd.exe bin\zstd.exe || (SET CpyError=%CpyError% programs\zstd.exe)
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
IF "[%CpyError%]" == "[]" goto :EOF
|
||||
rem Create required directories.
|
||||
mkdir bin\dll bin\static bin\example bin\include
|
||||
|
||||
:error
|
||||
SET errorlevel=1
|
||||
echo Failed with error #%errorlevel%: unable to copy following files:
|
||||
echo %CpyError%
|
||||
exit /b %errorlevel%
|
||||
rem Copy files using a subroutine. Exits immediately on failure.
|
||||
call :copyFile "tests\fullbench.c" "bin\example\"
|
||||
call :copyFile "programs\datagen.c" "bin\example\"
|
||||
call :copyFile "programs\datagen.h" "bin\example\"
|
||||
call :copyFile "programs\util.h" "bin\example\"
|
||||
call :copyFile "programs\platform.h" "bin\example\"
|
||||
call :copyFile "lib\common\mem.h" "bin\example\"
|
||||
call :copyFile "lib\common\zstd_internal.h" "bin\example\"
|
||||
call :copyFile "lib\common\error_private.h" "bin\example\"
|
||||
call :copyFile "lib\common\xxhash.h" "bin\example\"
|
||||
call :copyFile "lib\libzstd.a" "bin\static\libzstd_static.lib"
|
||||
call :copyFile "lib\dll\libzstd.*" "bin\dll\"
|
||||
call :copyFile "lib\dll\example\Makefile" "bin\example\"
|
||||
call :copyFile "lib\dll\example\fullbench-dll.*" "bin\example\"
|
||||
call :copyFile "lib\dll\example\README.md" "bin\"
|
||||
call :copyFile "lib\zstd.h" "bin\include\"
|
||||
call :copyFile "lib\zstd_errors.h" "bin\include\"
|
||||
call :copyFile "lib\dictBuilder\zdict.h" "bin\include\"
|
||||
call :copyFile "programs\zstd.exe" "bin\zstd.exe"
|
||||
|
||||
:EOF
|
||||
endlocal
|
||||
exit /b
|
||||
|
||||
:copyFile
|
||||
copy "%~1" "%~2" || (echo Failure processing "%~1" & exit /b %errorlevel%)
|
||||
goto :eof
|
||||
|
||||
Reference in New Issue
Block a user