2019 |
mateusz.vi |
1 |
@echo off
|
|
|
2 |
|
|
|
3 |
REM This batch file expects to be run in the tree directory.
|
|
|
4 |
REM And it expects compiler CC [bcc32] to be in the path.
|
|
|
5 |
REM It also expects Borland's Include and Lib directories to be set
|
|
|
6 |
REM via the enviroment variables INCLUDE and LIB respectively.
|
|
|
7 |
REM eg:
|
|
|
8 |
REM set INCLUDE=C:\Borland\bcc55\Include
|
|
|
9 |
REM set LIB=C:\Borland\bcc55\Lib;C:\Borland\bcc55\Lib\PSDK
|
|
|
10 |
REM for easier cleanup use BIN as output directory
|
|
|
11 |
|
|
|
12 |
if %1'==' goto badArgument
|
|
|
13 |
|
|
|
14 |
REM check if CC set, otherwise use default Borland's bcc32
|
|
|
15 |
if NOT %CC32%'==' goto usecats
|
|
|
16 |
set CC32=bcc32
|
|
|
17 |
|
|
|
18 |
:usecats
|
|
|
19 |
REM if adding cats add necessary files to compile command line
|
|
|
20 |
if NOT %1==CATS goto checkDefDrive
|
|
|
21 |
set TREECMPLXDEF=-DUSE_CATGETS
|
|
|
22 |
set TREECMPLXTRA=catgets.c db.c get_line.c
|
|
|
23 |
|
|
|
24 |
:checkDefDrive
|
|
|
25 |
if NOT %BORLANDINSTDRV%'==' goto checkInclude
|
|
|
26 |
set BORLANDINSTDRV=C:
|
|
|
27 |
|
|
|
28 |
:checkInclude
|
|
|
29 |
if NOT "%INCLUDE%"=="" goto checkLib
|
|
|
30 |
set INCLUDE=%BORLANDINSTDRV%\Borland\bcc55\Include
|
|
|
31 |
|
|
|
32 |
:checkLib
|
|
|
33 |
if NOT "%LIB%"=="" goto checkStub
|
|
|
34 |
set LIB=%BORLANDINSTDRV%\Borland\bcc55\Lib;%BORLANDINSTDRV%\Borland\bcc55\Lib\PSDK
|
|
|
35 |
|
|
|
36 |
:checkStub
|
|
|
37 |
REM note the %2 on the end is use to specify the name of the DOS STUB program.
|
|
|
38 |
REM if %2 is blank then it is assumed the default DOS stub should be used
|
|
|
39 |
REM i.e. the normal 'This program must run under Windows' message is displayed.
|
|
|
40 |
if %2'==' goto nostub
|
|
|
41 |
echo STUB '%2' > tree.def
|
|
|
42 |
:nostub
|
|
|
43 |
|
|
|
44 |
:compileDOS
|
|
|
45 |
md BIN > \NUL
|
|
|
46 |
%CC32% -DWIN32 -I%INCLUDE% -L%LIB% %TREECMPLXDEF% -nBIN -tWC -etree.exe tree.cpp stack.c %TREECMPLXTRA% user32.lib
|
|
|
47 |
copy BIN\tree.exe . > \NUL
|
|
|
48 |
|
|
|
49 |
:cleanup
|
|
|
50 |
echo cleaning up
|
|
|
51 |
set TREECMPLXTRA=
|
|
|
52 |
set TREECMPLXDEF=
|
|
|
53 |
REM set BORLANDINSTDRV=
|
|
|
54 |
REM copy tree.exe to current directory
|
|
|
55 |
del BIN\*.* < YES.TXT > \NUL
|
|
|
56 |
rd BIN > \NUL
|
|
|
57 |
if exist tree.def del tree.def
|
|
|
58 |
@echo Tree for Windows is now compiled. [tree.exe]
|
|
|
59 |
goto done
|
|
|
60 |
|
|
|
61 |
:badArgument
|
|
|
62 |
REM display proper usage
|
|
|
63 |
echo Usage: makedos CATS/NOCATS
|
|
|
64 |
echo where CATS specifies compile with Cats support and any thing
|
|
|
65 |
echo else means do not use cats. NOTE: compiling with cats
|
|
|
66 |
echo will cause the resulting executable (NOT source) to be
|
|
|
67 |
echo under the LGPL as the cats files are LGPL and not PD.
|
|
|
68 |
echo.
|
|
|
69 |
echo It expects Borland's Include and Lib directories to be set
|
|
|
70 |
echo via the enviroment variables INCLUDE and LIB respectively.
|
|
|
71 |
echo.
|
|
|
72 |
echo The default compiler is bcc32, but the environment variable CC may
|
|
|
73 |
echo be set before calling makwinbc.bat to use a different compiler
|
|
|
74 |
echo that is compatible with bcc32.
|
|
|
75 |
echo.
|
|
|
76 |
echo This batch file must be ran from the tree\ directory.
|
|
|
77 |
echo Try again.
|
|
|
78 |
|
|
|
79 |
:done
|