2019 |
mateusz.vi |
1 |
@echo off
|
|
|
2 |
echo Compiling Win32 version of tree using MS VC.
|
|
|
3 |
|
|
|
4 |
REM This batch file expects to be run in the tree directory.
|
|
|
5 |
REM And it expects Visual C/C++ (cl) to be in the path.
|
|
|
6 |
|
|
|
7 |
REM Make sure necessary args are specified
|
|
|
8 |
if %1'==' goto badargs
|
|
|
9 |
|
|
|
10 |
REM for easier cleanup uses BIN as output directory
|
|
|
11 |
md BIN > \NUL
|
|
|
12 |
|
|
|
13 |
REM Change cl and options if you are using a compiler not
|
|
|
14 |
REM compatible with Microsoft Visual C/C++ version 5
|
|
|
15 |
|
|
|
16 |
REM The default options are specified here, change this if necessary
|
|
|
17 |
set TREECMPLOPTS=/Fe"tree.exe" /nologo /ML /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"BIN/"
|
|
|
18 |
|
|
|
19 |
REM %1 is used to specify if cats support should be added (%1==CATS) or not (%1!=CATS)
|
|
|
20 |
if NOT %1==CATS goto skipcats
|
|
|
21 |
set TREECMPLOPTS=%TREECMPLOPTS% /D USE_CATGETS catgets.c db.c get_line.c
|
|
|
22 |
:skipcats
|
|
|
23 |
|
|
|
24 |
REM add default files and libraries to link
|
|
|
25 |
set TREECMPLOPTS=%TREECMPLOPTS% tree.cpp stack.c /link user32.lib
|
|
|
26 |
|
|
|
27 |
REM note the %2 on the end is use to specify the name of the DOS STUB program.
|
|
|
28 |
REM if %2 is blank then it is assumed the default DOS stub should be used
|
|
|
29 |
REM i.e. the normal 'This program must run under Windows' message is displayed.
|
|
|
30 |
if %2'==' goto nostub
|
|
|
31 |
echo Ignore the warning about stub file missing full MS-DOS header.
|
|
|
32 |
set TREECMPLOPTS=%TREECMPLOPTS% /STUB:%2
|
|
|
33 |
:nostub
|
|
|
34 |
|
|
|
35 |
REM actually perform compile
|
|
|
36 |
cl %TREECMPLOPTS%
|
|
|
37 |
|
|
|
38 |
:cleanup
|
|
|
39 |
echo cleaning up
|
|
|
40 |
REM unset env variable
|
|
|
41 |
set TREECMPLOPTS=
|
|
|
42 |
REM copy tree.exe to current directory
|
|
|
43 |
copy BIN\tree.exe . > \NUL
|
|
|
44 |
REM cleanup (remove) temp files
|
|
|
45 |
del BIN\*.* < YES.TXT > \NUL
|
|
|
46 |
rd BIN > \NUL
|
|
|
47 |
@echo Tree for Win32 Console now compiled. [tree.exe]
|
|
|
48 |
goto done
|
|
|
49 |
|
|
|
50 |
:badargs
|
|
|
51 |
echo USAGE: makwinvc CATS [stub] OR makwinvc NOCATS [stub]
|
|
|
52 |
echo where stub is the optional DOS stub to link with
|
|
|
53 |
|
|
|
54 |
:done
|