forked from johannesthoma/winaoe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakedriver.bat
83 lines (74 loc) · 1.83 KB
/
makedriver.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@echo off
if "%1" == "" goto help
if "%2" == "" goto help
if "%1" == "/?" goto help
if "%1" == "f" goto next_1
if "%1" == "c" goto next_1
if "%1" == "32" goto next_2
if "%1" == "64" goto next_2
goto help
:next_1
if "%1" == "f" set arg1=fre
if "%1" == "c" set arg1=chk
if "%1" == "f" set obj=fre
if "%1" == "c" set obj=chk
if "%2" == "32" goto next_1_ok
if "%2" == "64" goto next_1_ok
goto help
:next_1_ok
if "%2" == "32" set arg2=w2k
if "%2" == "64" set arg2=wnet amd64
if "%2" == "32" set arch=i386
if "%2" == "64" set arch=amd64
if "%2" == "32" set name=aoe32
if "%2" == "64" set name=aoe64
if "%2" == "32" set obj=%obj%_w2k_x86
if "%2" == "64" set obj=%obj%_wnet_amd64
goto run
:next_2
if "%1" == "32" set arg2=w2k
if "%1" == "64" set arg2=wnet amd64
if "%1" == "32" set arch=i386
if "%1" == "64" set arch=amd64
if "%1" == "32" set name=aoe32
if "%1" == "64" set name=aoe64
if "%1" == "32" set obj=w2k_x86
if "%1" == "64" set obj=wnet_amd64
if "%2" == "f" goto next_2_ok
if "%2" == "c" goto next_2_ok
goto help
:next_2_ok
if "%2" == "f" set arg1=fre
if "%2" == "c" set arg1=chk
if "%2" == "f" set obj=fre_%obj%
if "%2" == "c" set obj=chk_%obj%
goto run
:help
echo.
echo Usage: "makedriver [f|c] [32|64]"
echo.
goto end
:run
mkdir bin 2>nul
call config.bat
pushd .
call %ddkdir%\bin\setenv.bat %ddkdir% %arg1% %arg2%
popd
cd src
echo !INCLUDE $(NTMAKEENV)\makefile.def > makefile
echo TARGETNAME=%name% > sources
echo TARGETTYPE=DRIVER >> sources
echo TARGETPATH=obj >> sources
echo TARGETLIBS=$(DDK_LIB_PATH)\\ndis.lib >> sources
echo SOURCES=%c% >> sources
build
copy obj%obj%\%arch%\%name%.sys ..\bin >nul
copy obj%obj%\%arch%\%name%.pdb ..\bin >nul
del makefile
del sources
del build%obj%.log
del build%obj%.wrn 2>nul
del build%obj%.err 2>nul
rd /s /q obj%obj%
cd ..
:end