2017-12-22 13:24:09 +01:00
|
|
|
@ECHO OFF
|
|
|
|
IF "%1"=="" GOTO USAGE
|
|
|
|
REM assumes ran in same directory as this file, ie base of kernel source
|
|
|
|
SET BASEPATH=%CD%
|
|
|
|
CD ..
|
2021-05-15 04:57:59 +02:00
|
|
|
REM setup command aliases
|
|
|
|
SET ZIPIT=7z.exe a -tzip -mx9 -mm=deflate -mpass15 -r
|
2021-05-14 05:30:27 +02:00
|
|
|
REM when called from RELEASE.BAT assume clean source exported from version control
|
|
|
|
IF "%2"=="RELEASE" GOTO PACK
|
2017-12-22 13:24:09 +01:00
|
|
|
|
|
|
|
ECHO create source copy
|
|
|
|
if EXIST SOURCE RMDIR /S /Q SOURCE > NUL
|
|
|
|
MKDIR SOURCE
|
|
|
|
ECHO \.svn>SOURCE\SKIPLIST
|
|
|
|
ECHO .git>>SOURCE\SKIPLIST
|
2021-05-14 04:17:48 +02:00
|
|
|
ECHO .yml>>SOURCE\SKIPLIST
|
|
|
|
ECHO CNAME>>SOURCE\SKIPLIST
|
2017-12-22 13:24:09 +01:00
|
|
|
XCOPY %BASEPATH% SOURCE\ke%1 /S /V /I /Q /G /H /R /Y /EXCLUDE:SOURCE\SKIPLIST
|
|
|
|
DEL SOURCE\SKIPLIST > NUL
|
|
|
|
ECHO ensuring clean
|
|
|
|
PUSHD .
|
|
|
|
CD SOURCE\ke%1
|
|
|
|
CALL clobber.bat
|
|
|
|
POPD
|
|
|
|
|
2021-05-14 05:30:27 +02:00
|
|
|
:PACK
|
2017-12-22 13:24:09 +01:00
|
|
|
SET VERSION=%1
|
|
|
|
SET LSMRET=SRC
|
|
|
|
SET LSMFILE=SOURCE\ke%1\docs\fdkernel.lsm
|
|
|
|
GOTO LSM
|
|
|
|
:SRC
|
2021-05-14 05:30:27 +02:00
|
|
|
REM remove CONFIG.BAT if exists, such as building packages from develoment directory
|
|
|
|
IF EXIST SOURCE\ke%1\CONFIG.BAT DEL SOURCE\ke%1\CONFIG.BAT > NUL
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO zipping source
|
2021-05-15 04:57:59 +02:00
|
|
|
%ZIPIT% ke%1s.zip SOURCE\*
|
|
|
|
ECHO gathering source and creating APPINFO and expected packaging dir structure
|
|
|
|
REM FreeDOS package format, has APPINFO, BIN, DOC\KERNEL, SOURCE\KERNEL\
|
|
|
|
MKDIR PACKAGE
|
|
|
|
MKDIR PACKAGE\SOURCE
|
|
|
|
XCOPY /S /I /Q SOURCE\ke%1 PACKAGE\SOURCE\KERNEL
|
|
|
|
MKDIR PACKAGE\DOC
|
|
|
|
MKDIR PACKAGE\DOC\KERNEL
|
|
|
|
COPY /N SOURCE\ke%1\DOCS\* PACKAGE\DOC\KERNEL\
|
|
|
|
COPY SOURCE\ke%1\COPYING PACKAGE\DOC\KERNEL\COPYING
|
|
|
|
MKDIR PACKAGE\APPINFO
|
|
|
|
MOVE PACKAGE\DOC\KERNEL\fdkernel.lsm PACKAGE\APPINFO\KERNEL.LSM
|
|
|
|
MKDIR PACKAGE\BIN
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO using working configuration file
|
2021-05-14 05:30:27 +02:00
|
|
|
COPY %BASEPATH%\CONFIG.BAT SOURCE\ke%1\ > NUL
|
2017-12-22 13:24:09 +01:00
|
|
|
CD SOURCE\ke%1
|
|
|
|
|
|
|
|
ECHO build and packaging
|
|
|
|
SET VERSION=%1 (FAT12/FAT16)
|
|
|
|
SET FAT=16
|
2021-05-15 04:57:59 +02:00
|
|
|
SET CPU=86
|
2017-12-22 13:24:09 +01:00
|
|
|
SET BZKRET=F16
|
|
|
|
GOTO BZK
|
|
|
|
:F16
|
|
|
|
SET VERSION=%1 (FAT12/FAT16/FAT32)
|
|
|
|
SET FAT=32
|
2021-05-15 04:57:59 +02:00
|
|
|
SET CPU=386
|
2017-12-22 13:24:09 +01:00
|
|
|
SET BZKRET=F32
|
|
|
|
GOTO BZK
|
|
|
|
:F32
|
2021-05-15 04:57:59 +02:00
|
|
|
ECHO building FreeDOS package
|
|
|
|
CD ..\..\PACKAGE
|
|
|
|
%ZIPIT% ..\kernel.zip APPINFO BIN DOC SOURCE
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO clean up
|
2021-05-15 04:57:59 +02:00
|
|
|
CD ..
|
2017-12-22 13:24:09 +01:00
|
|
|
RMDIR /S /Q SOURCE > NUL
|
2021-05-15 04:57:59 +02:00
|
|
|
RMDIR /S /Q PACKAGE > NUL
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO Done.
|
|
|
|
SET BZKRET=
|
|
|
|
GOTO DONE
|
|
|
|
|
|
|
|
|
|
|
|
:BZK
|
|
|
|
ECHO build kernel %VERSION%
|
2021-05-15 04:57:59 +02:00
|
|
|
CALL build.bat /D KERNEL_VERSION /V "%1 " %CPU% win upx fat%FAT%
|
|
|
|
DEL BIN\K*86??.sys
|
2017-12-22 13:24:09 +01:00
|
|
|
SET LSMRET=BZK_2
|
|
|
|
SET LSMFILE=docs\fdkernel.lsm
|
|
|
|
GOTO LSM
|
|
|
|
:BZK_2
|
|
|
|
SET LSMRET=
|
|
|
|
ECHO zipping FAT%FAT% release version
|
2021-05-15 04:57:59 +02:00
|
|
|
%ZIPIT% ..\..\ke%1_%CPU%f%FAT%.zip BIN\* DOCS\*
|
|
|
|
ECHO storing binaries for FreeDOS package
|
|
|
|
COPY BIN\KERNEL.SYS ..\..\PACKAGE\BIN\KERNL%CPU%.SYS
|
|
|
|
COPY /B /Y BIN\country.sys ..\..\PACKAGE\BIN\COUNTRY.SYS
|
|
|
|
COPY /B /Y BIN\setver.sys ..\..\PACKAGE\BIN\SETVER.SYS
|
|
|
|
COPY /B /Y BIN\sys.com ..\..\PACKAGE\BIN\SYS.COM
|
|
|
|
IF EXIST BIN\share.com COPY /B /Y BIN\share.com ..\..\PACKAGE\BIN\SHARE.COM
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO cleaning up between builds
|
|
|
|
CALL clobber.bat
|
|
|
|
GOTO %BZKRET%
|
|
|
|
|
|
|
|
:LSM
|
|
|
|
ECHO Begin3>%LSMFILE%
|
|
|
|
ECHO Title: The FreeDOS Kernel>>%LSMFILE%
|
|
|
|
ECHO Version: %VERSION%>>%LSMFILE%
|
|
|
|
ECHO Entered-date: %DATE%>>%LSMFILE%
|
|
|
|
ECHO Description: The FreeDOS Kernel>>%LSMFILE%
|
|
|
|
ECHO Keywords: kernel, FreeDOS, DOS, MSDOS>>%LSMFILE%
|
|
|
|
ECHO Author: (developers: can be reached on the freedos-kernel mailing list)>>%LSMFILE%
|
|
|
|
ECHO Maintained-by: freedos-kernel@lists.sourceforge.net>>%LSMFILE%
|
2021-05-14 04:17:48 +02:00
|
|
|
ECHO Primary-site: http://github.com/fdos/kernel>>%LSMFILE%
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO Alternate-site: http://www.fdos.org/kernel/>>%LSMFILE%
|
2021-05-14 04:17:48 +02:00
|
|
|
ECHO Alternate-site: http://freedos.sourceforge.net/kernel/>>%LSMFILE%
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO Original-site: http://www.gcfl.net/pub/FreeDOS/kernel>>%LSMFILE%
|
2021-05-14 04:17:48 +02:00
|
|
|
ECHO Platforms: DOS, FreeDOS, DOSEMU (OpenWatcom/Borland/GCC-ia16, NASM, UPX)>>%LSMFILE%
|
2017-12-22 13:24:09 +01:00
|
|
|
ECHO Copying-policy: GPL2>>%LSMFILE%
|
|
|
|
ECHO End>>%LSMFILE%
|
|
|
|
SET LSMFILE=
|
|
|
|
SET VERSION=
|
|
|
|
GOTO %LSMRET%
|
|
|
|
|
|
|
|
:USAGE
|
2021-05-14 05:30:27 +02:00
|
|
|
ECHO Build kernel packages (interim builds or release without tagging) - usage: %0 {VERSION} e.g. %0 2039 or %0 git
|
2017-12-22 13:24:09 +01:00
|
|
|
:DONE
|
|
|
|
CD %BASEPATH%
|
|
|
|
SET BASEPATH=
|
2021-05-15 04:57:59 +02:00
|
|
|
SET ZIPIT=
|